4

私はこの構造体を持っています:

struct MyStruct
{
    MyStruct(const Wrapper &wrapper, /*...*/) :
        wrapper(std::cref(wrapper)), /*...*/ {}

    std::reference_wrapper<Wrapper const> wrapper;
    /*...*/
};

ただし、デフォルトのコンストラクターがないtbb::concurrent_bounded_queue<MyStruct>ため、これは不可能です。しかし、何らかの方法で初期化する必要があるMyStructため、定義方法がわかりません。wrapperこれに対する解決策はありますか (生のポインタを使用する以外に)?

tbbエラー(ここFindAffineShapeArgsはどこMyStructですか):

/usr/include/tbb/concurrent_queue.h(453): error: no default constructor exists for class "FindAffineShapeArgs"
          T value;
            ^
          detected during:
            instantiation of "void tbb::concurrent_bounded_queue<T, A>::clear() [with T=FindAffineShapeArgs, A=tbb::cache_aligned_allocator<FindAffineShapeArgs>]" at line 446
            instantiation of "tbb::concurrent_bounded_queue<T, A>::~concurrent_bounded_queue() [with T=FindAffineShapeArgs, A=tbb::cache_aligned_allocator<FindAffineShapeArgs>]" at line 272 of "/home/luca/Dropbox/HKUST/CloudCache/cloudcache/CloudCache/Descriptors/hesaff/pyramid.cpp"
4

0 に答える 0