[patch] : Adding move symantics to vector

chris jefferson caj@cs.york.ac.uk
Fri Sep 9 09:45:00 GMT 2005


Howard Hinnant wrote:

> On Sep 8, 2005, at 7:43 PM, chris jefferson wrote:
>
>> 1) Find the person who put vector<bool> in the standard and beat them.
>
>
> Oh, this one is quite exciting. ;-)
>
> Have you considered:
>
> 4)  get the rvalue reference implemented in the compiler, perhaps
> under a #pragma, and use that?  Your clients could then say:  wow,
> look what happens when I turn this pragma on!  And the implementation
> difficulty in the lib could drop by an order of magnitude.
>
> I've done both lib solutions (2 and 3) and a hard core 4 (if you want
> move, you've got to change the language).  To date I'm happiest from a
> maintenance point of view with 4.  But it requires a longer point of
> view and more cooperation with compiler implementors (both good things).
>
4 would be my prefered option as well. However it's my belief (modulo a
couple of small problems like this one) that the current library
implementation is enough to figure out how to correctly add move
semantics to the library and containers, which is a fairly small job
that fits nicely into my spare time, while hopefully in parallel someone
else with either more compiler knowledge or more spare time than me to
add rvalue references to the compiler. Once true rvalue references are
added a quick search-and-replace will make use of them.

Chris



More information about the Libstdc++ mailing list