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 thing is that all major compilers support rvalue references, so it’s very actionable material. In fact, just by upgrading to C++11 you get a free performance boost. If you attended the talk, thanks for coming. You can find a link to the slides here: http://www.tantalon.com/pete.htm. Enjoy move-enabling your game code!

This entry was posted in C++, Game Programming. Bookmark the permalink.

4 Responses to Faster C++: Move Constructors and Perfect Forwarding

  1. Jeff says:

    I enjoyed your GDC presentation, thanks.

  2. brucedawson says:

    I’ve added move constructors to some of our classes and it helped reduce memory allocation churn from copying. Usually we try to avoid the copying through other means, but move constructors are convenient.

    Once nice thing about move constructors is that they are transparent to the code that uses the objects, so we can conditionally compile them for those compilers that currently support them. It just requires having a few lines of code in the class declaration and the client code automatically uses them when available.

    The bad news is that since we don’t yet have support for move constructors in all of our compilers we can’t count on the performance improvements, so we still have to use other methods to reduce object copying overhead.

  3. Hi there, I would like to subscribe for this website to get most up-to-date
    updates, so where can i do it please help.

Leave a comment