[eigen] Alignment of a derived class |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Hi,
Please consider this example:
struct Base
{
Eigen::Vector4f vec4f_base;
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
struct Derived1 : public Base
{
Eigen::Vector4f vec4f_derived_1;
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
struct Derived2 : public Base
{
Eigen::Vector4f vec4f_derived_2;
};
I would like to know if Derived1 and / or Derived 2 are aligned, given that Base is aligned.
The next question is if EIGEN_MAKE_ALIGNED_OPERATOR_NEW is needed in the derived class (Derived1 vs Derived2).
The final question is what would happen for Derived1 if Base does note have EIGEN_MAKE_ALIGNED_OPERATOR_NEW?
thank you and best regards,
Martin