Boost logo

Boost :

Subject: Re: [boost] [Review] Formal Review: Boost.Move
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2010-05-31 11:42:16


On 31/05/2010 8:46, Thomas Klimpel wrote:
> The alternative is to just define "TYPE& operator=(TYPE t)", but Ion
> doesn't like this for classes like boost::container::vector, as this
> copy assignment operator cannot reuse existing resources. So his
> proposed non-optimized mode sacrificed move-assign from temporaries
> on C++03 compilers, to avoid non-optimal code on new compilers in
> C++0x mode.

Yes. I missed that for some classes operator=(TYPE t) might be optimal
both for copy assignment and move assignment so that option should be
available in documentation for those that want to use it, since it
offers both optimal performance and no side-effects on enclosing classes.

Best,

Ion


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