What will day to day C++ development be like in a few years? What C++0x features will change C++ development the most?
In what order should I concentrate learning these new features?
What will day to day C++ development be like in a few years? What C++0x features will change C++ development the most?
In what order should I concentrate learning these new features?
Lambdas, because they finally introduce reasonable means of harnessing the benefits of functional programming.
Range-based for-loops.
for (int x: numbers) std::cout << x << " ";
Yay!
Regular expressions as a standard library - you know you need them.
this is a great article about new features Explicating the new C++ standard (C++0x), and its implementation in VC10
The auto keyword For automatic data-type deduction (at compile time), depending on initialization.
The decltype keyword For deducing data-type from expression, or an auto variable
The nullptr keyword Null pointer is now promoted, and is been awarded a keyword!
The static_assert keyword For compile time assertions. Useful for templates, and validations that cannot be done using #ifdef.
Lambda Expressions Locally defined functions. Inherits features from function-pointers and class objects (functors).
Trailing Return types Mainly useful when templated function's return type cannot be expressed.
R-value references Move semantics - resource utilization before temporary object gets destroyed.
there are also described new features of Microsoft's new compiler
what day to day C++ development will be like in a few years
I wonder how much day-to-day C++ development will still be happening in 5 years. It'll still be around of course but on niche platforms of course, compiler support for the new standard could take years to arrive. And as for legacy projects, updating them might never happen. In 5 years, how many new projects on mainstream platforms will be using C++?
Edit: I see the C++ fanboys are out in force. I like C++. But the fact is it's mainly used on legacy projects, or new projects using legacy code-bases, or niche platforms. None of those mean a totally clean upgrade path to a new standard.
Unicode support. No more cobbles and hacks to get correct handling of unicode characters -- now the entire unicode standard is natively supported by the language.
I personaly think that move semantics (and rvalue references in general) are the most important change, on par with threads/locks/atomics. Everything else is, more or less, simplification of syntax or standardization of common third-party solutions -- we can write functors when we need lambdas and we have numerous regex libraries. Even for the lack of atomic operations there were some solutions, but there were NO move constructors/move assignment operators.
Being able to move objects changes the whole perception of the language to me. Even though we had RVO and the swap-to-temporary trick to emulate some of it already, it's hard to imagine how the life changes when this is part of everyday life. It's not just ofstream("log.txt") << "Hi!";
, or the so much faster STL algorithms, it's a whole new way of passing data between functions.
We switched to 2010 about a month ago. The two most common things we've used are auto and lambda. Rvalue references have allowed me to do many things that were not possible before, but in day-to-day use they are not AS used as lambda and auto.
Concepts. At last, we'll be able to type-check templates before instantiating them, and when we instantiate them incorrectly, we'll get sensible error messages. Whoops! The C++0X committee couldn't agree and eventually tossed them out. Ah well, wait for C++1X...
auto in the for loops, and lambdas for the algorithm, I'll start a massive using of for_each.