std::move , , , ++
template<typename T>
const T&
defeat_rvo(const T& t)
{ return t; }
Test foo() {
Test ret;
return defeat_rvo(ret);
}
, , :
Test foo() {
Test ret;
const Test& ref = ret;
return ref;
}
, , return " ", , , . , :
Test foo() {
Test ret;
return static_cast<const Test&>(ret);
}
, , .