Let's consider the following code:
class X {
std::vector<int> _v;
public:
X(std::vector<int>&& v): _v(std::move(v)) {}
};
The compiler calls this constructor only for objects that can be moved. So why not just define an rvalue references to be rvalue expressions and don't write every time std::move for them?
The ctor member initialization list would look like:
_v(v)
But this would still be a move, not a copy.
std::move()
basically just returns an unnamed rvalue reference, which is therefore an rvalue. – Withy