Boost logo

Boost :

Subject: Re: [boost] [move][container] Review Request (new versions of Boost.Move and Boost.Container in sandbox and vault)
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2009-08-12 07:15:31

David Abrahams escribió:
> Very great news to hear that this project is moving forward (so to speak
> ;-))

Let's hope this is the final step!

>> The library has now new macros to declare copyable and movable types and movable only
>> types. Old macros are still there for backwards compatibility (specially unordered
>> library which was also ported to this move sandbox) but I expect to remove them if
>> current approach is considered better.
>> ->Updated documentation and tests.
> still says "all moves occur explicitly," but I think you mean "all moves
> from lvalues," right?

Yes. The new library now moves non-const rvalues in assignments:

copyable_and_movable produce();

copyable_and_movable cm;
   //now moved instead of copied!
   cm = produce();

This is not the case with constructors (the original Klaus Triendl
proposal included them, because it
terribly uglifies syntax (there is no way in C++03 to automatically
generate constructor overloads that forward to another constructor) and
because that case is in practice more efficient than moving thanks to RVO:

   //Copied? No, RVO avoids copy
   copyable_and_movable cm = produce();



Boost list run by bdawes at, gregod at, cpdaniel at, john at