Re: [eigen] StdVector

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


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
>
>
>



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