[patch] : RFC : rvalue / move symantics
Chris Jefferson
caj@cs.york.ac.uk
Wed Mar 16 23:23:00 GMT 2005
Hello!
While I still have some other things to finish cleaning, up I thought
I'd send out this simple patch that adds move symantics to std::vector
and std::unique, for any comments before untakeing adding the symantics
to all the other containers / algorithms. This patch looks an awful lot
like N1770 and N1771, recently posted papers to www.open-std.org about
rvalue references, which isn't suprising as it was somewhat based on an
old one. I've designed so that if and when rvalue symantics are added to
the compiler, a simple(ish) search-and-replace will move us to the
behaviour of N1770 and N1771.
This patch (of course) implements a relatively small amount of the work
in these patches.
For those interested in reading the code, some brief things I came
across while designing..
Why not allow __rvalrefs to decay back into normal references?
This might be added later. I didn't want to add it yet because there
should be no reason for that to ever occur at present, so if it does
it's because either a) a move got added where one can't be, or b) some
class is marked as moveable when it shouldn't be.
Also, it would be nice if I could just mark all classes as moveable and
then have the __rvalrefs decay to normal references when the class isn't
rvalue aware. Unfortunatly this is defeated by templated constructors...
Chris
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ChangeLog
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20050316/8edd1f00/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: movepatch
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20050316/8edd1f00/attachment-0001.ksh>
More information about the Libstdc++
mailing list