Re: [eigen] Structures Having Eigen Members questions

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


2009/1/23 Ben Axelrod <baxelrod@xxxxxxxxxxxx>:
> 1. Base classes.  When is EIGEN_MAKE_ALIGNED_OPERATOR_NEW needed with
> respect to class hierarchies?  It seems that if you put
> EIGEN_MAKE_ALIGNED_OPERATOR_NEW in a base class, and the Eigen types are in
> a derived class, then it does not work.

It should really work: overloaded operator new is inherited in derived classes.
Here, it does work (with your example code even). And there are many
people relying on that already.

One idea: did you forgot to specify public inheritance? "class
Derived: public Base".

Please, can you try to make a small self contained test case? And tell
me with which compiler you get the failure?

> 2. Is EIGEN_MAKE_ALIGNED_OPERATOR_NEW needed in structs as well as classes?

Of course, in C++ structs are the same thing as classes, the only
difference is that they default to public members and public
inheritance.

> 3. Returning Eigen types is ok

That we already mention in this page, at the end ;) perhaps we should
make that more prominent then.

> and passing a pointer to an Eigen type
> instead of by const reference is also ok.

OK i'll try to remember about adding that. At low level passing by
pointer or by reference is exactly the same thing.

Cheers,
Benoit



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