Is it possible to specify alignment of parent class? for example something like (which does not compiled):
template<size_t n>
class Vector : public boost::array<double,n> __attribute__ ((aligned(16)))
{
thanks
well, from comments I gather this is no good way to go. I think I will just stick to composition/alignment of private array
We don't need to request alignment on the derived class neither we can. The reason why we don't need is that it is enough to request alignment for the derived class, and that requesting alignment to the derived class will result on layout for the base class that depends on the derived.
class A : public C __attribute__ ((aligned(16)))
{
class B : public C __attribute__ ((aligned(8)))
{
Which will be alignment for C?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With