Moving, Initializing, And Hotdogging
In an interview with C++ creator Bjarne Stroustrup, Danny Kalev asked Bjarne several questions about the major features being incorporated into the venerable C++ language via the C++0x standardization effort. Here’s one such Q+A exchange:
I know, I know. The “*” should be a “+” in the free function declaration box above. But does the typo really detract from the message being conveyed?
So, how hard is it to write a move constructor implementation? It’s as hard as this:
Notice how the lower level reference-to-a-reference (i.e. rvalue reference) feature in the Matrix move constructor enables the higher level “move” feature to be easily written. This capability to move big stuff around instead of copying the behemoth will be a great addition to the language, especially to library writers, no?
Bjarne’s examples of the new “uniform and universal initialization” C++0x feature jacked me up too:
We can use the {…} notation for every initialization and wherever we initialize an X with {v} we get the same resulting value. That’s a major improvement over C++98’s non-uniform set of alternatives using the =v, ={v}, and (v) notations:
With any new and powerful tool, there’s always the danger of “hotdoggers” conniving to show how much smarter than you they are. Here’s a typically wise and insightful, and universal quote from Bjarne on the topic:
Before we get to benefit from the simplifications offered by C++0x, we may go through a period where too many people try to show off their cleverness by enumerating language rules and digging into the most obscure corners. That can do harm.
You’re not one of “those” people are you? I’m not. Luckily, I ain’t smart enough to be a hotdogger. But if I was brilliant…….
Note: I know that the code above is really C, but it was the first googled C++ example I stumbled across.
Related Articles
- Bjarne Stroustrup Reflects On 25 Years of C++ (developers.slashdot.org)
- Bjarne Stroustrup on C++ Inception (thebitsource.com)





There’s another non-hotdog I did some time ago