The most interesting explanation of rvalue references yet: 

http://codesynthesis.com/~boris/blog/2008/12/01/rvalue-references-affect-your-code/

Want to know whats the need for the std::move method? As I understand it, It’s needed because as soon as you give an rvalue reference a name it “becomes” an lvalue reference! This is probably done to make it harder for you to shoot yourself in the foot (as you would not want to use the name of a rvalue reference after its rvalue had already been moved away and the rvalue reference name was invalidated). So there needs to be a way to get back to an  rvalue reference from an lvalue somehow . That is what the move function is all about. std::move()simply converts any rvalue or lvalue to an rvalue reference, by stripping away its name.

Advertisements