The topic of supporting the new C ++ 0x standard by various compilers is of the greatest interest, since a final draft of the C ++ 0x -
C ++ 0x Final Committee Draft (FCD) Standardization Committee was recently published, which in turn means that the standard will be fully adopted in the next two years. And if we compare it with the previous Visual Studio 2008 (VC9), then a couple of basic chips from the new standard have already been made in it.
There are at least two sources from which one or another C ++ 0x innovation can work in VC ++ 10. The first of these sources is the official
Visual C ++ Team Blog blog. Recently, innovations from the standard in this blog have been reported by Stephan T. Lavavej, who has been developing Visual C ++ libraries at Microsoft for a couple of years. The most interesting thing in the blog is the
last message , in which the public was presented with a summary table supporting the innovations of the C ++ 0x standard in the new RC1 version of the VC10 compiler.
The notorious Scott Meyers posted another
document on the Internet, where he fully compared supported chips from the C ++ 0x standard based on several compilers at once - GCC 4.3 / GCC 4.4 / MSVC9 / MSVC10B2, however, as can be seen - using the example of not the latest version of VS Beta 2
')
The father of the new standard, Burn Stroustrup did not stand aside and wrote
what he thinks about the new standard. A very interesting and instructive document that I advise you to familiarize yourself with each other and understand the philosophy of C ++ 0x. According to a report once made by Bjorn, the new standard will be fully compatible with the current version of the language.
Consider some of the notable innovations of the language supported in VC ++ 2010.
Lambda expressionsLambda expressions are representations of nameless local functions, in fact, anonymous functors.
Lambda expressions already exist in many places - the library
boost ,
C # 3.0 ,
Python 2.5 , some semblance of lambda expressions exist in Mathematica. Now lambda expressions are fully supported in the new VS 2010. The standard lambda expressions are represented by the
Proposal N2927 sentence .
An example of using lambda expressions for printing vector elements:
for_each(vec.begin(), vec.end(), [](int _n){cout << _n << " ";});
On Habrahabr there is a small good article on lambda expressions:
C ++ 0x. Lambda expressions / C ++ | HabrahabrStephan T. Lavavej
wrote a long
review of lambda expressions, as well as about the applicability of the new keywords auto and static_assert. All this is of course supported by the new VC2010.
Rvalue linksThis innovation will allow to distinguish between temporary and non-temporary objects, thereby increasing the application's performance, getting rid of unnecessary copying operations (move semantics). Now, any return value from the function is interpreted as an rvalue.
More detailed information:
Rvalue Reference Declarator: &&Visual C ++ Team Blog: Rvalue References: C ++ 0x Features in VC10, Part 2Proposed wording for rvalue reference R3New standard C ++: C ++ 09 -> Forum on Source.RuThere is a site like Wikipedia, according to the new standard there is also an
article there , but you shouldn’t trust it much, there may be mistakes. The best document for the new standard is
C ++ 0x Final Committee Draft (FCD) .
I recall that, like the previous Beta2, Visual Studio 2010 RC1 has the status of
"Go Live" , respectively, now everyone can start developing commercial applications.
Additional materials :
New standard C ++: C ++ 09 -> Forum on Source.RuOverview of C ++ 0x [1] - Conference iXBT.comVisual C ++ Team Blog: C ++ 0x Core Language Features In VC10: The Tablevisual studio 2010 / Tags / HabrahabrThe review participates in the
contest , the author can be thanked by voting
here .