Category Archives: C++

Move Construction, part IV

In my previous post, we discussed std::move(), a new function which is actually just a cast and has no performance overhead. It’s good to recall the problem we’re trying to solve. v.push_back( Texture(…) ); // copy from a temporary In … Continue reading

Posted in C++ | 3 Comments

Move Construction, part III

Last time, we discussed rvalue references. Rvalue references uniquely identify objects that can be safely moved from. In the move constructor below, rhs is an rvalue reference. It refers to an object, such as a temporary object, that will only exist for another … Continue reading

Posted in C++ | Leave a comment

Move Construction, part II

Last time, I provided an introduction to move construction, a new method of constructing objects in C++11. The move constructor looked like this: Texture( Texture&& rhs ) : // move ctor mpBits( std::move( rhs.mpBits ) ), mSize ( std::move( rhs.mSize ) ) { rhs.mpBits … Continue reading

Posted in C++ | 1 Comment

Move Construction, part I

At GDC this year, my presentation covered move construction, a new fast method of constructing objects in C++11. Here’s how it works. Up until C++11, whenever you created a new object from an existing object, you copied the object by using … Continue reading

Posted in C++ | 1 Comment

Faster C++: Move Constructors and Perfect Forwarding

Just a few hours ago I delivered my Faster C++ talk at the 2012 Game Developers Conference. This was my thirteenth GDC presentation! The large room was packed, which is awesome, so the topic seemed relevant to the game development community. The great … Continue reading

Posted in C++, Game Programming | 4 Comments

Game Developers Conference 2012

GDC is coming up fast: March 5-9 in San Francisco. I’ll be speaking on the latest C++ performance technology — move constructors, perfect forwarding and rvalue references. My session title is Faster C++, 11:30a on Friday, March 9. Microsoft is hosting our … Continue reading

Posted in C++, Game Programming, Microsoft | Leave a comment

C++11: Getting Up To Speed on the New Standard

C++11 is officially the new C++ International Standard. All those new features that people have been talking about for the last few years, such as lambdas and r-value references, are now Standardized. However, the industry still has a lot of catching up to … Continue reading

Posted in C++, Microsoft | 2 Comments