Re: [eigen] Multiple inheritance and WithAlignedOperatorNew vs. Msvc |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Multiple inheritance and WithAlignedOperatorNew vs. Msvc
- From: "Benoit Jacob" <jacob.benoit.1@xxxxxxxxx>
- Date: Tue, 6 Jan 2009 00:05:57 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=wg4f3+j3rdF8Nj9pBkcetaDwyFk32+zePidgx9GbS3U=; b=LXO0peEUJyI6Ao7LKKmhNA4dljNki9SBmbR21w40L8eY/1PDPOumxG0ki6jPI8JRJq NzYW1jK49+ye79XM2GnPJYZn7XFo2+7NDH7/EQCNa1OUxyzejq7MP0e/o9PTc5RK9AMY mDQIp/DTlEiIUhTx+4MJ3nf5273VxTxT+b6to=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=R4T1IrFl+vy3lkRmoYDKkqgELi437O5n/N9RUeuTfeYZ488StuqQGbeLdOP1UsK05x 0YXKI4o1EpHBuIFPEYHwUaeJuW9cF2T9OUH+DKhXYHY6UDtbPDWBjV31nqbqy6bc3H4f 1EeLtWcVLx/bKeK1nAhbDYW4Wz6+pN90dfr9E=
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
>
> ---
>
>
---