私はこの構造体を持っています:
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"