C++ parent class alignment
问题 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 回答1: 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