Re: std::vector<__m128i> with non-standard allocators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 11, 2012 at 06:57:05PM +0100, Jonathan Wakely wrote:

> The C++ standard says that in a psuedo-destructor call (i.e. an
> expression like p->~U() for a non-class type) the operand shall be a
> scalar type, which would seem to rule out vector types (but then the
> standard says nothing about them anyway.)

Thanks, I had no realized that the standard allows that for scalar
types.

> You could either specialize the allocator's destroy function for the
> case of __m128i so it does nothing, or file a bug asking for
> pseudo-destructor calls to be allowed on types like __m128i.

I considered specialization but that requires me to guess what vector
types someone might want to use (the various AVX, NEON, and AltiVec
types all seem reasonable in the context of the allocator I'm writing)
and additionally pollute the namespace by pulling in headers to find
the definitions, so I was hoping for another approach.

It's definitely pretty unfortunate that this is rejected in that it
seems (?) like the intent of the pseudo-destructor syntax is to ensure
that p->~U() is always well formed precisely to allow uniform syntax
for cases like this. I suppose I'll file a bug and hope that people
working on the C++ FE agree this is a reasonable thing to support. It
looks like Clang 3.1 also rejects, Intel C++ 12.1 and Visual C++ 2010
accepts. Not sure about Comeau as the online compiler doesn't seem to
know about emmintrin.h

-Jack


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux