Re: [eigen] Multiple inheritance and WithAlignedOperatorNew vs. Msvc

[ Thread Index | Date Index | More Archives ]

svn up, here you are...
the macro is EIGEN_MAKE_ALIGNED_OPERATOR_NEW. Just put it in the
public part of your class.
If you want to align or not depending on some template parameter, use
I have updated the 'unaligned array assert' dox page, but to see it
you need to generate the dox yourself (make doc).


2009/1/6 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> I have no idea what's going on.
> But I have an idea of a workaround. Instead of a base class
> WithAlignedOperatorNew, let's offer a macro to generate these
> operators.
> That's probably a better solution anyway, and that's what we're
> already doing (since today) in Matrix.
> Opinions?
> Benoit
> 2009/1/5 Armin Berres <trigger@xxxxxxxxxxxxxx>:
>> 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.
>> Puzzled,
>> Armin
>> ---


Mail converted by MHonArc 2.6.19+