Print

C11/C++11: Building blocks for the future



Larry O Brien
Email
August 27, 2012 —  (Page 4 of 4)

In addition to the previously mentioned headline changes, there are a number of medium-impact features. At the border of the two are “move semantics,” which allow ownership of a structure to be changed rather than copied and then deleted; a potentially big performance win with large structures, but one from which you can only benefit by writing new code.

Consistent initialization using braces (int x{5}; int y[]{1, 2}) is another “easier to learn” feature, even if the semantics are slightly different for “aggregates” (arrays and structs) than they are for non-aggregates, and one is allowed to use fewer brace-initializers than needed, triggering value-construction (and, I think, making for pretty confusing code).

The new nullptr keyword is probably self-explanatory: It replaces 0 or NULL with a constant of type nullptr_t that can only be converted to a pointer or a Boolean (never, ever, to an int. Hooray!).

There are additional changes that I think of as minor fixes, such as the previously mentioned “right brackets close properly” fix.

In addition to the library-based threading and futures discussed previously, the new standard library includes hash tables, improved pseudo-random number functions, and regular expressions (regex adherence is said to be to “modified ECMAScript,” which, according to Scott Meyers’ “An Overview of the New C++” presentation materials, is “essentially a standardized version of Perl RE syntax”).

Still a work in progress
While the new C and C++ language standards are extensive and impressive, it’s fair to point out that C and C++ remain languages in which programmers can perform “dangerous” memory and thread operations: high-performance, low-level systems engineering requires that access. The hope, though, is that the new features will go a long way to avoiding the “slip of the mind” defects that, regrettably, we all introduce.

A major feature—some would say the major feature—of this version of C++ was a feature for templates called “Concepts.” It was pulled from the standard in 2009 because a majority of committee members felt that it was still untried and risky. Although a great deal of work has been done on Concepts over the years, it seems at this point that the feature may never make it into the standard or, if it does, only after a massive reworking.

Work has already begun on the next version of the standard. Aside from Concepts, major features will certainly include further steps toward a standard garbage collection model and some form of runtime reflection.

The improved memory model, reference-counting, and more concise code enabled by type inference and lambdas make the language more attractive and modern. Systems-level and performance-oriented programmers will certainly gain from enabling the latest language extensions in their compilers. The page seems a pretty actively maintained reference for compiler support.

Books on C/C++11 are mostly still in the development pipeline. An important exception is Anthony Williams’ excellent “C++ Concurrency in Action,” which goes into the memory model and related areas in great depth. The best general overview may be the course notes of Scott Meyers, author of the “Effective C++” series.

If C and C++ are undergoing a renaissance, it can only continue if the languages trigger enthusiasm in both new and old developers. The committees have done their work, now it’s time for the market to render judgment.


Related Search Term(s): C, C++

Pages 1 2 3 4 


Share this link: http://sdt.bz/36891
 
Most Read  Latest News  Resources

close
NEXT ARTICLE
News Briefs: November 15, 2008
Metaforic comes out with a new security product for monitoring networks, ICEsoft and ILOG announce that they are merging their technologies for later releases, and Urbancode adds pre-flight builds for testers to AnthillPro Read More...
 
 
 




News on Monday  more>>
Android Developer News  more>>
SharePoint Tech Report  more>>
Big Data TechReport  more>>

   
 
 

 


Download Current Issue
MAY 2013 PDF ISSUE

Need Back Issues?
DOWNLOAD HERE

Want to subscribe?