[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] StdVector
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 15 Apr 2009 14:30:24 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=0AxybNVewcyZ5XhGrxo56GF5/l39dIXrO/jHDsoV1BY=; b=NAQUx7Lf5EinB7QF3N7pb3Em+xoxNhfMkH8LkMV/13WRoIAnog/tKeqC/cPydBaJ24 OD2MKA591VKNfVupATGt7EiOaaHu0c1eolCPJspGk0h9J/3cIzQxAyp+9vfH3EiJ+mLw 6NJ8RYNPm9f6Hs1g3N7UbGp7UsWFncblej4EU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=FmIiOe1UMuufrvIU1Kdu7/qI3TG2H0NuM7bB+IJVa1wSP0WEfT1eDsJIUW0hy8U+CG DOahBMaq2pVJz7m7tS3+0XO5Z4s40QcrIjuVjyQorcEkG8vUQxJf25AUC0t/1au8CjlX HGj457hXCNi3RMlP3FaRzyPWuPKmoRmJ6eajk=
Arf, we'll never be done with the std::vector issue, it seems ....
also it's really frustrating that this appears the day after we
release 2.0.1 with the new StdVector!!
So Gael's current solution isn't standard compliant. First question:
maybe that can be fixed?
If not, there was the previous solution by Alex and myself. But it had
the problem of not being extensible to user types. Maybe that's worth
a second round of thinking? I don't remember exactly what prevented
making macros allowing the user to extend it to custom types.
If all else fails, we can always go back to the previous solution and
tell people that if they have custom types T having Vector4f members
and they want a std::vector<T> then instead of Vector4f they need to
use Matrix<float,4,1,DontAlign>.... or write a dox page on how to
manually write a std::vector specialization like we do for Eigen
types.
Cheers,
Benoit
2009/4/15 Markus Moll <markus.moll@xxxxxxxxxxxxxxxx>:
> Hello everyone,
>
> I want to gather opinions on the StdVector solution because I think the
> problem is solved in the wrong way.
>
> I tried to build a program yesterday that links to a C++ library which exports
> symbols containing std::vector. Unfortunately, I couldn't find a clean way to
> do so when also using Eigen's StdVector because this redefines std::vector,
> resulting in a link error (if you properly include StdVector before declaring
> std::vector). Also, Eigen's meddling with the standard library essentially
> makes every program using Eigen's StdVector exhibit undefined behavior (C++
> std 17.4.3.1)
>
> I propose to either properly specialize all container classes for Eigen
> classes (could be tricky) or to provide a separate set of containers to use
> with Eigen classes in namespace Eigen. The latter could very well turn out to
> be simpler.
>
> I would love to hear what others think about this.
>
> Markus
>
> PS: Also, Eigen's vector interface is not correct in at least one respect: it
> does not provide the constructor
>
> template<typename InputIterator> vector(InputIterator first, InputIterator
> last, const Allocator& = Allocator())
>
> --
> PGP key on www.esat.kuleuven.be/~mmoll/public_key.pgp
> Fingerprint is
> 90C4 B47D 1A00 5AC1 9147 3197 EDA7 1E0E 99E4 9EDB
>
>
>