Boost logo

Boost :

Subject: Re: [boost] [move] auto-generated operator=
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2009-11-16 12:20:04


David Abrahams escribió:
> On Nov 16, 2009, at 7:46 AM, David Abrahams wrote:
m with requiring move-enablers to supply a swap.
>
> In fact, I don't even think we need to do that. This seems to work pretty well:
>
> #define BOOST_COPYABLE_AND_MOVABLE(TYPE)\
> public:\
> TYPE& operator=(TYPE t)\
> { return this->operator=(static_cast< ::boost::rv<TYPE>&>(t)); } \
> //

Interesting. This works for some types but it has performance impact in
types likevector because they can't reuse previous allocated resource
(e.g. capacity).

Ion


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