Re: [eigen] StdVector again

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


Hi

On Thursday 27 August 2009 13:45:40 Markus Moll wrote:
> the problems reported in the two recent mails on StdVector sounded
> suspiciously familiar to me.
> Indeed, both are due to a problem solved quite a while ago, but
> unfortunately the changes are in the default branch, while the current
> branch seems to be 2.0, which does not contain them.

Ah, sorry. If my understanding is correct, the 2.0 branch is the stable 
branch, while default is development (right?)

Daniel, you essentially ran into two problems. StdVector in 2.0 redefines 
std::vector so that it can be used with aligned Eigen types. What happened is:

1. The redefinition of std::vector makes programs compiled with Eigen 
incompatible with libraries that export anything containing std::vector (the 
std::vector type for compiling the library is different from the one used for 
compiling your program). It _might_ work if you carefully include the library 
headers (boost in your case) _before_ including StdVector. Of course, then you 
cannot use any Eigen vectors before that point, either. However, this might be 
arbitrarily complex if not impossible in larger projects.

2. The vector interface in the stable branch is not complete and does not 
satisfy the requirements imposed by the standard. This is why your constructor 
call did not succeed.

To the developers: Would it be possible to include the fixes in the 2.0 branch 
as well? Granted, it would change the interface but I really think that most 
people who currently use StdVector run into the above mentioned problems 
anyway. A large warning box telling people that it's now necessary to use 
aligned_allocator would probably be sufficient, wouldn't it?

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