#include <iostream>
using namespace std;
string f(std::string&& s)
{
std::string res(std::move(s));
res += " plus extra";
return res;
}
int main(void)
{
std::string str = "A string";
cout << f( std::move(str) ) << endl;
std::cout << "'" << str << "'" << std::endl; // Unspecified behavior
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKc3RyaW5nIGYoc3RkOjpzdHJpbmcmJiBzKQp7CiAgICBzdGQ6OnN0cmluZyByZXMoc3RkOjptb3ZlKHMpKTsKICAgIHJlcyArPSAiIHBsdXMgZXh0cmEiOwogICAgcmV0dXJuIHJlczsKfQoKaW50IG1haW4odm9pZCkKewogICBzdGQ6OnN0cmluZyBzdHIgPSAiQSBzdHJpbmciOwogICBjb3V0IDw8IGYoIHN0ZDo6bW92ZShzdHIpICkgPDwgZW5kbDsKICAgc3RkOjpjb3V0IDw8ICInIiA8PCBzdHIgPDwgIiciIDw8IHN0ZDo6ZW5kbDsgLy8gVW5zcGVjaWZpZWQgYmVoYXZpb3IKCiAgIHJldHVybiAwOwp9