alignas with templates

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

 



Hello,
I encountered a problem: alignas not work with templates.
Here is my test:

typedef xx al_type alignas(32);
al_type a, b;
cout << alignof(al_type) << endl;
cout << alignof(a) << endl;
cout << alignof(b) << endl;

That's OK:
xx = simple type - eg double
xx = array - eg int[4711]
xx = simple stuct / class
output:
32
32
32

That will not work:
xx = template <typename _Type> class Example {};
output:
1
32
1

xx = template <typename _Type> class Example
{
_Type values[4711];
};
output:
sizeof(_Type)
32
sizeof(_Type)

I used cygwin gcc 4.9.2 / 32



Another question I have:
is the ggc supported in the foreseeable future pragmas or keywords
to selectively enable and disable the auto-vectorizing? (eg #pragma(novector))
__attribute __((optimize ("no-tree-vectorize"))) does not work with inline functions.

Thanks for the help
Gero

Attachment: signature.asc
Description: OpenPGP digital signature


[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