Pizer’s Weblog

programming, DSP, math

Posts Tagged ‘move semantics

C++: Exploiting Copy Elisions

with 8 comments

This article is about writing efficient code and giving the compiler opportunities for optimizations with respect to copying / “moving” objects in good old C++98. I use a simple function as an example but it should extend to other cases as well. The technique that is described here (“swaptimization”) is not entirely new and I can’t take credit for it. But it is probably little-known which is a good reason to write about it. 🙂

Read the rest of this entry »

Written by pizer

June 25, 2009 at 4:57 pm

C++0x: Rvalue references 101

leave a comment »

If found a very nice article about rvalue references and move semantics (primarily) by Dave Abrahams. It also considers return value optimizations, exception safety and in what state an object should be left in after its resources have been “stolen”. Here it is.

[Edit 2009-08-18: The link doesn’t seem to work anymore. However, Dave Abrahams has started to refine, extend, and convert it into a series of blog posts on his new site ]

– P

Written by pizer

May 27, 2009 at 2:22 pm