[eigen] Structures having Eigen members and make_shared

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hello,

We recently ran into a "bug" where we had a structure containing Eigen members that triggered the infamous "unaligned array" assertion. Unfortunately, the solution proposed by the Eigen documentation is to add EIGEN_MAKE_ALIGNED_OPERATOR_NEW somewhere in the code, but it does not have any effect on make_shared<MyStruct>(args).

As I understand it, Eigen will try to keep C++03 compatibility as much as possible, and I am not sure it is possible to support this C++11 feature without breaking that. Maybe the documentation could be updated ?

Note: a simple fix is to use the slightly less efficient:
my_ptr = std::shared_ptr<MyStruct>(new MyStruct).

Cheers,
Hervé



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/