Tbb :: cache_aligned_allocator: Getting a "query for a member ... that has a nonclass type" with __m128i. User error or error?

I try to use __m128i as the value type of an edge-aligned vector with GCC, and I get the following error:

/usr/include/tbb/cache_aligned_allocator.h:105:32: error: request for the member '~ tbb :: cache_aligned_allocator <__ vector (2) long long int> :: value_type in' * p, which is not a -class type 'tbb :: cache_aligned_allocator <__ vector (2) long long int> :: value_type {aka __vector (2) long long int}

The compiler tracks it in the following line in tbb / cache_aligned_allocator.h:

void destroy( pointer p ) {p->~value_type();}

Here is the code that causes 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;
}

Debian, GCC - 4.6.1-2, TBB - 3.0 + r147-1. Threading Building Blocks, - ?

+3
1

, , __m128 gcc. ++, POD ( , int/double/char/etc.), . vector(2) long long int - , gcc . , , , __m128i, .

, 128 , . __m128i , , __m128i, .

+2

Source: https://habr.com/ru/post/1694828/


All Articles