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. Finally, your primary source of reference for all things C++11 and C++14 should be Scott Meyers' book “Effective Modern C++.” While my presentation in this article gave you sort of a sharp focus on rvalue references, Scott Meyers' book paints the entire picture of modern C++, whithout ever cutting corners on details. |