C+11返回值优化还是移动?
std::move
using SerialBuffer = vector< unsigned char >;// let compiler optimize itSerialBuffer read( size_t size ) const{ SerialBuffer buffer( size ); read( begin( buffer ), end( buffer ) ); // Return Value Optimization return buffer;}// explicit moveSerialBuffer read( size_t size ) const{ SerialBuffer buffer( size ); read( begin( buffer ), end( buffer ) ); return move( buffer );}
慕无忌1623718
慕森卡
万千封印