18 Sep
2009
18 Sep
'09
9:48 a.m.
Dear Boost C++ Libraries Developers, According to http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/ why Boost use this (not the only example): ~~~~~~~~~~~~~~~~~~~ shared_ptr & operator=( shared_ptr const & r ) { this_type(r).swap(*this); return *this; } ~~~~~~~~~~~~~~~~~~~ and not such: ~~~~~~~~~~~~~~~~~~~ shared_ptr & operator=( shared_ptr r ) { r.swap(*this); return *this; } ~~~~~~~~~~~~~~~~~~~ Regards, Marat.