Search code examples
c++templatestbb

TBB: Can't use an array type?


I have some code that uses TBB:

tbb::concurrent_vector<float[3]> vnors2;
vnors2.resize(NUM_VERTS);

tbb::concurrent_vector<float[3]> lnors_weighted2;
lnors_weighted2.resize(NUM_LOOPS);

and I get an error compiling this (Windows, Visual Studio 2019):

non-scalar type 'T' cannot be used in a pseudo-destructor expression

According to this it looks like I need to re-write the class, but this isn't mine. Is there any way to address this? I could re-write my code to use a struct, but I'd prefer to use the array.


Solution

  • Yes, @Yksisarvinen you are correct. The issue is indeed not related to TBB. @easythrees You can find more about the syntax of array in https://en.cppreference.com/w/cpp/container/array