
16 Nov
2009
16 Nov
'09
5:20 p.m.
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