|
I am indebted to Thomas Witt for the insight and information on rvalue references that he shared with me.
Thanks to Valentin David for reading the article carefully and providing valuable corrections and insights.
Many more readers have helped to improve the article. Thanks everybody for their contributions, and please
do keep sending feedback. All remaining inaccuracies and deficiencies are mine.
I very much recommend reading the article by Howard E. Hinnant, Bjarne Stroustrup, and Bronek Kozicki on the subject of C++ rvalue references at the C++ Source. This article has more and better examples than mine does, and it has an extensive list of links to proposals and technical papers which you will find interesting. As a tradeoff, the article does not go into all the details the way I do; for example, it does not explicitly state the new reference collapsing rules or the special template argument deduction rule for rvalue references.
As mentioned earlier, Dave Abrahams'
sequence of articles on value semantics on his blog explains all the subtleties of how move semantics tie
in with existing optimizations like return value optimization and copy elision.
Another one of his blog entries explains
the way rvalue references interact with exception safety, and and how the new |