Good links are appreciated.
Wikipedia Page on C++11 R-value references and move constructors
Type &&
).std::move()
is a cast that produces an rvalue-reference to an object, to enable moving from it.It's a new C++ way to avoid copies. For example, using a move constructor, a std::vector
could just copy its internal pointer to data to the new object, leaving the moved object in an moved from state, therefore not copying all the data. This would be C++-valid.
Try googling for move semantics, rvalue, perfect forwarding.