In July I suggested I might give a C&B talk about Move Semantics in C++, including their underlying implementation machinery, rvalue references. Rvalue references are also used to implement perfect forwarding, and recently I realized that you can’t really take full advantage of move semantics without using perfect forwarding, too, so that’s also in the talk.
Over the summer, the Standardization Committee modified draft C++0x to make move operations “special,” which means they will be automatically generated by compilers under “appropriate” conditions, and then people started asking me questions about the interaction of move operations and threading, move operations and exceptions, and the kinds of classes for which move operations make sense.
The overall landscape involving move semantics turns out to be more complex than it initially appears, and in my first session at C&B (which is currently slated to be the first session of the event), I’ll do my best to explain the lay of the land. There’s a lot of material to cover, so it’ll be a double-length session with much technical meat. Don’t worry, though: there will be a break in the middle, and once we’re done, it’ll be time for lunch :-)
My presentation will be finalized within the next few days, so if there’s some aspect of move semantics, rvalue references, or perfect forwarding you’d like to see me address, please comment on this post or send me email ([email protected]).
Scott
October 11, 2010 at 10:30 am
[…] addition to my session on Move Semantics, Rvalue References, and Perfect Forwarding, I’ll be giving a session on CPU caches and why they are important for people interested in […]
November 30, 2010 at 4:35 pm
[…] my October talk on move semantics, I explained that the status of the implicit generation of move operations was not yet settled. […]
April 25, 2011 at 10:38 am
[…] Perfecting forwarding is an important C++0x technique built atop rvalue references. It allows move semantics to be automatically applied, even when the source and the destination of a move are separated by intervening function calls. Common examples include constructors and setter functions that forward arguments they receive to the data members of the class they are initializing or setting, as well as standard library functions like make_shared, which “perfect-forwards” its arguments to the class constructor of whatever object the to-be-created shared_ptr is to point to. At last year’s C&B, I discussed perfect forwarding as the final part of my talk on move semantics and rvalue references. […]