Boost logo

Boost :

Subject: Re: [boost] [move] Library uploaded to sandbox
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2009-02-18 12:08:28


Olaf Peter wrote:
> Hi Ion,
>
>> I've uploaded a new version of the move emulation library to sandbox.
>> I've put it temporarily in "move_semantics" folder to avoid overwriting
>> current move code.
>
> what is the differnet to Adobe's move library
> (http://stlab.adobe.com/group__move__related.html) ??

The emulation is different because Adobe's library "move" returns T:

T move(T &t);

This library (credits to David Abrahams) returns a pseudo-rvalue reference:

boost::rv<T> & move(T &t);

so there is a way to implement forwarding without any intermediate copy
or move and to modify the original value instead of creating a temporary
one. For example Adobe.Move containers need to implement push_back by value:

push_back(T t);

whereas with this library we can implement it in a more C++0x-like approach:

push_back(const T &t);
push_back(BOOST_RV_REF(T)t);

which will provide an easier transition to C++0x code.

> Regards,
> Olaf

Best,

Ion


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk