- What it is?
- What it does?
- When it should be used?
Good links are appreciated.
Good links are appreciated.
http://en.wikipedia.org/wiki/C%2B%2B0x#Rvalue_reference_and_move_semantics
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2027.html#Move_Semantics
Type&&
)It's a new c++ way to avoid copies. For example, using a move constructor, a vector could just copy its internal pointer to data to the new object, leaving the moved object in an incorrect state, avoiding to copy all data. This would be c++-valid.
Try googling for move semantics, rvalue, perfect forwarding.