Monday, March 28, 2011

C++0x ISO Final Draft is approved

C++ is already an amazing language to build with, but the enhancements that are coming will seriously improve our ability to develop more efficiently. Consider that a large portion of the existing BOOST libraries will now be part of the C++ standard. You will see things like:

- Thread support
- Initializer lists
- Ranged-based for-loop (similar to foreach loops)
- Constructors can now call other constructors of the same type for initialization
- long long int 64 bit integers
- Regular expressions
- Smart pointers

And much much more. See the wikipedia article at http://en.wikipedia.org/wiki/C%2B%2B0x

If you are a GNU GCC user, don't forget to add -std=c++0x to your compiler options to enable these features.

Note that C++0x is not an ISO just yet, to quote Herb Sutter's blog:

"The work isn’t quite done yet. The project editor now needs to update the working draft with the changes approved at this meeting, and a review committee of over a dozen volunteers will review it to help make sure those edits were made correctly. The result will be the FDIS draft. Once that happens, which we expect to take about three weeks, we will transmit the FDIS to ITTF in Geneva to kick off the final up/down international ballot which should be complete this summer.

If all goes well, and we expect it will, the International Standard will be approved and published in 2011, henceforth to be known as C++ 2011.
" - http://herbsutter.com/

I have been experimenting with the BOOST libraries for a short while and have found them to be extremely well designed. One of the features that I found the most useful was the foreach facility. When one works with large quantities of data sometimes you would like to iterate over it quickly and without necessarily having to allocate to an iterator. In principal it works almost the same way, except that writing a loop using a foreach construct is syntactically easier. The wikipedia article on foreach loops explains the C++0x syntax.

C++ is and has been one of the most influential and successful languages in programming history. This new version of the C++ ISO will ensure its success continues for a long time to come.

No comments:

Post a Comment