
31 May
2010
31 May
'10
3:42 p.m.
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