[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] StdVector
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Sat, 18 Apr 2009 11:12:18 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=7cebL48SdZ8gJIUcwfZtc6SwOXt+VX5SVNrw7wYcoAo=; b=bv0AZPYVSzvJwhTP3S1VGYcHyUJFXBmPeMg/sF8QUkcMPiazcEnpd88hdFyOebs+7k emO9WpFt7+T9zDoEldouAKL6Xi8k6zlYVJ/1ycPCaANKoQOl+EsArVxzyLVhSYWxL26U O0k/14jAzVurwpARd9Hco/kn8pcXI0bsKi5zo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=KwhOATYBtuCUKKJo/US73aK8BM31FnYLqks0+5wnJf9V+EbW8AQxZa8pXrQ1Tv+DUs R1EcNArqGwpq4QJIGrX1Evcc7jZIAyEK/fxLXprd8nxQvTnYS32ZN7GA/Tyb4lwWn+pP 56BbduP5+357RdZ3XYVmhQsjVYIzp50DuIRys=
Well, that's a bummer. I just seem to have overseen this little fact. Still - assuming we would specialize std::allocator as in the attached example we could at least take care that the user is informed that he is doing something wrong when using plain Eigen types. It is clear that this is not a full fleshed solution but it is a beginning and already covering many cases.
> or do you want to 'enforce' via documentation? I would vote for enforcing itvia miss alignment assert in debug mode and segfaults in release mode ;)
I see, there are plenty of ways of dealing with it.. :) I would still prefer a compile time error - whenever possible. You already have this nice compile time assert mechanism - so why not use it?
note that we are not only talking about Eigen's types, but also about
any user classes having a fixed size matrix member. Otherwise this
would be very easy to only specialize std:vector for Eigen's type
(this was the previous solution), but that does not scale well to user
Description: Binary data