#include #include using std::cout; using std::endl; using std::move; using std::string; string ReturnFoo(void) { string x("foo"); return x; // this return might copy } int main(int argc, char **argv) { string a("hello"); // moves a to b string b = move(a); cout << "a: " << a << endl; cout << "b: " << b << endl; // moves the return value into b b = move(ReturnFoo()); cout << "b: " << b << endl; return EXIT_SUCCESS; }