[eigen] Multiple inheritance and WithAlignedOperatorNew vs. Msvc

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

Hey dudes,

I have a very special present for you:
Code which is completely fine with Gcc (at least compiled as 32bit and
executed on 64bit Linux), but happily fails with Msvc 2008 at runtime.

struct B {};

struct A : public B, public Eigen::WithAlignedOperatorNew
        Eigen::Matrix2f m;

int main()
        A *a = new A();

Guess what, it fails with an assertion claiming that A doesn't inherit from
WithAlignedOperatorNew, which means our friendly matrix 'm' is not aligned.
So far, so good, but this is not all: If I now add a Matrix to B (and
leave the rest of the code unchanged) the assertion is gone.
Has anyone the slightest idea what's going on here? Letting B inherit
WithAlignedOperatorNew instead of A also solves the problem btw., but there
are a lot of situations where one can't change the base class.



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