struct S
{
std::vector<int> data;
S doStuff() &&
{
std::cout << "rvalue
";
return {std::move(data)};
}
S doStuff() const&
{
std::cout << "const lvalue
";
return {data};
}
};
void swap(T& a, T& b){
T temp = std::move(a);
a = std::move(b);
b = std::move(temp);
}