Re: [eigen] Structures having Eigen members and make_shared

[ Thread Index | Date Index | More Archives ]

While Eigen supports compilation in non-C++11 mode, it also has some places detecting C++11 mode and enabling special code there. This could be one such instance.

2016-06-22 20:55 GMT-04:00 Hervé Audren <h.audren@xxxxxxxxxx>:

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).


Mail converted by MHonArc 2.6.19+