Suggestion: another aligned pointer work around avoiding EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Submitted by Sebastian Schmittner
Assigned to Nobody
Link to original bugzilla bug (#805)
Version: 3.2
Description
This is a suggestion for improving the documentation rather than a bug. Sorry for submitting it here, is there some more reasonable place?
The work around of aligning my own classes with
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
as explained in
http://eigen.tuxfamily.org/dox/group__TopicStructHavingEigenMembers.html
can also be avoided by using pointers to Eigen classes, instead of members. This is a little easier than the "Private structure" solution described at the bottom of the page.
I.e.
just using
class Foo
{
...
Eigen::Vector2d *v;
...
Foo(...):v(new Eigen::Vector2d()){...}
~Foo(){delete v;...}
};
instead of
class Foo
{
...
Eigen::Vector2d v;
...
};
fixes the problem as well as the more complicated solutions described in the documentation.