Re: [eigen] [patch] Missing function in StdVector

[ Thread Index | Date Index | More Archives ]

On Wed, May 6, 2009 at 4:12 PM, Markus Moll
<markus.moll@xxxxxxxxxxxxxxxx> wrote:
> Hi
> On Wednesday 06 May 2009 15:44:44 Gael Guennebaud wrote:
>> On Wed, May 6, 2009 at 3:35 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> wrote:
>> > Thanks, commited (please check the diff below)
>> actually I think a better fix would be:
>> using vector_base::insert;
> Why is insert there anyway? I thought the only problem was with resize?
> Wouldn't just removing insert and push_back suffice?

this is because of the ei_workaround_msvc_std_vector indirection  =>
we need to overload each function taking a value_type as argument.

Without these overloads, when you declare:

std::vector<Matrix> vec:

you would only have access to this version of push_back:

push_back(const ei_workaround_msvc_std_vector<Matrix>& x);

To give an example of the problem, if A and B are two Eigen matrices,
then the type of A+B is an Eigen expression, and so in:

std::vector<Matrix> vec:

you need the Matrix ctor taking an expression as argument, but, owing
to ei_workaround_msvc_std_vector indirection this ctor is not


> Markus
> --
> PGP key on
> Fingerprint is
> 90C4 B47D 1A00 5AC1 9147  3197 EDA7 1E0E 99E4 9EDB

Mail converted by MHonArc 2.6.19+