
16 Feb
2012
16 Feb
'12
10:40 p.m.
I'm using C++03 and would love some way to apply move semantics to a std::string. Can boost facilitate this in some way without using smart pointers? Consider an example like below (This is a contrived example, so assume NRVO does not apply): std::string GetInformation( int someNumber ) { // We use 'someNumber' to look up a string std::string myValue( "hello world" ); // Create the string here return myValue; } Above, the return value would result in a copy, I'd like to move it instead. --------- Robert Dailey