I'm trying to use __m128i as the value type of a cache-aligned vector with GCC, and I'm getting the following error:
/usr/include/tbb/cache_aligned_allocator.h:105:32: error: request for member ‘~tbb::cache_aligned_allocator<__vector(2) long long int>::value_type’ in ‘* p’, which is of non-class type ‘tbb::cache_aligned_allocator<__vector(2) long long int>::value_type {aka __vector(2) long long int}’
The compiler traces it to the following line in tbb/cache_aligned_allocator.h:
void destroy( pointer p ) {p->~value_type();}
Here is the code that triggers the compiler error:
#include <vector>
#include <emmintrin.h>
#include <tbb/cache_aligned_allocator.h>
int main()
{
std::vector<int, tbb::cache_aligned_allocator<int> > success;
std::vector<__m128i, tbb::cache_aligned_allocator<__m128i> > failure;
return 0;
}
According to Debian versioning, my GCC version is 4.6.1-2, and my TBB version is 3.0+r147-1. Is this a bug in Threading Building Blocks, or am I misusing something?