|Re: [eigen] [patch] Missing function in StdVector|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] [patch] Missing function in StdVector
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 6 May 2009 17:43:14 +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=EvfqM/lkYDzWjIAoR4v9DIBbbhfmLptuozAlzp2KvLM=; b=C+3e2VXxodVfAf/ZlMMS2WyumbgA4MY240K4nT/WdQn6WFrq7TuNzd1z1kLeT2HWfm 5z11tuK3tJoq/MoN0T3bkEosxLXnwRRFQz+2GQpo1b/HDKCaJJhY9j5jLHNPDkneb6MW kOJt9p8p/XOFDrnuaneo6BTbx112XkIQlF/Cg=
- 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=PelCB/WGgpXOwYLbne1AIMFCDbd8m2PQMRmhV8xDHi+vr3InnwiNmYoSPko7sqpXI1 CCedRNyfqiLBLYCxSsLRhlRNhGtysSWDknlAjiaeRdEmlL3arrqVgslmMGkA4sJ7G1Wa 3HzrLrkkokAdYQ5uRcpmAYz6lmP2JYKVJxogs=
On Wed, May 6, 2009 at 5:19 PM, Hauke Heibel
> On Wed, May 6, 2009 at 3:44 PM, Gael Guennebaud
> <gael.guennebaud@xxxxxxxxx> wrote:
>> actually I think a better fix would be:
>> using vector_base::insert;
> I just tried it and it works but seems a little bit mysterious to mee.
there is no magic. This simply tells the compiler to also look at the
base class for overloaded versions of insert. Then, as usual with C++,
the most specific overload is used.
> You have to write exactly what you suggested and what irritates me is
> how the compiler decides which of the three implementations from
> std::vector he is going to use. He is not using all of them and since
> no signature is defined the compiler choice occurs to me like 'dark
> magic' and I would suggest to stick to the initial approach - it just
> seems to be more clear what is happening.
> I also registered some more errors in the interface and attached
> another patch - these were just signature errors (const correctness &
> return values).