C++0x Core Language Features In VC10: The Table

C++0x Core Language Features In VC10: The Table

Rate This
  • Comments 40

When we announced that the Visual Studio 2010 Release Candidate Is Now Available For Download, a reader, Igor, asked us to provide a table summarizing which C++0x Core Language features are implemented in VC10.  So, here it is!  It's derived from, but slightly modified from, GCC's tables.  For example, I added "Rvalue references v2".

 

C++0x Core Language Features

VC9

VC10

Rvalue references

No

v2

    Rvalue references v2

No

v2

    Rvalue references for *this

No

No

    Initialization of class objects by rvalues

Yes

Yes

static_assert

No

Yes

auto

No

Yes

    Multi-declarator auto

No

Yes

    Removing old auto

No

Yes

    Trailing return types

No

Yes

Lambdas

No

v1.0

decltype

No

Yes

Right angle brackets

Yes

Yes

Extern templates

Yes

Yes

nullptr

No

Yes

Strongly typed enums

Partial

Partial

Forward declared enums

No

No

Extended friend declarations

Partial

Partial

Local and unnamed types as template arguments

Yes

Yes

C++0x Core Language Features: Concurrency

exception_ptr

No

Yes

Thread-local storage

Partial

Partial

C++0x Core Language Features: C99

__func__

Partial

Partial

C99 preprocessor

Partial

Partial

long long

Yes

Yes

 

While I can't explain all of these features here, I can link to my posts about lambdas v1.0, auto, and static_assert, rvalue references v1, and decltype, and I can decode some of the more mysterious cells in this table.

 

The difference between what I call "rvalue references v1" and "rvalue references v2" is that v1 allowed rvalue references to bind to lvalues, while v2 forbids this.  N2844 "Fixing a Safety Problem with Rvalue References" describes the reasons for this change.  It was recently voted into the C++0x Working Paper, and there was enough time for us to implement it in VC10.  (Importantly, rvalue references v2 doesn't affect the move semantics or perfect forwarding patterns, but it does affect the implementation of std::move() and std::forward<T>(), and experts need to know about this change.)

 

The difference between what I call "lambdas v1.0" and "lambdas v1.1" is much less significant.  After lambdas were voted into the Working Paper and implemented in VC10, N2927 "New wording for C++0x Lambdas" was additionally voted into the Working Paper, clarifying subtleties like what happens with nested lambdas.  Common uses of lambdas aren't really affected, but unusual uses may be.

 

The "Partial" entries indicate that VC's support is either incomplete (as in the case of the C99 preprocessor, where variadic macros are implemented but mixed narrow/wide string literal concatenation isn't), or in a non-Standard form (as in the case of __func__, where __FUNCTION__ is implemented).

 

I don't have a similar table for the C++0x Standard Library features implemented in VC10 (preparing one based on N2870 would take a while), but slides 28 and beyond of my BoostCon 2009 presentation (attached below) contain a useful summary.

 

Stephan T. Lavavej

Visual C++ Libraries Developer

(July 13, 2010 update: reformatted table, corrected "Forward declared enums" row.)

Attachment: vc10-1 1.pptx
Thanks for sharing your comment! If your comment doesn't appear right away, please be patient as it may take a few minutes to publish or may require moderation.
  • I'm enjoying the C++0x and intellisense in VC10 and am finding it really hard to step back into VC9 when work sometimes demands it!

    I ran into scoping problems with the lambdas and filed a bug (537366) on it -- it seems like you already know this (dubbing the fixed implementation "1.1"), so I'm very glad to see you're on top of things!

  • Thank you for this table and the BoostCon presentation - and for those previous articles, which go a long way to helping me understand some of the more important and complex areas of VC2010 (and C++0x).

  • Oh wow, nice list. Thanks. :)

    Regarding the difference between lambdas 1.0 and 1.1, is that what causes the the problems described here: http://blackninjagames.com/?p=38 ?

    I'm curious if the problem is an actual compiler bug or just that you've implemented an earlier and outdated specification. (Also of course, hoping it'll be fixed ASAP, in a service pack or similar)

    A similar list of library features would be nice too, if you can find the time to make it. :)

    Looking forward to the VC10 release. You guys have done an impressive job (not least having had to tackle so many other issues simultaneously, like the transition to MSBuild, and I imagine the switch to WCF for VS as a whole has affected you too).

    I hope we won't have to wait 2-3 years for VC11 to see more language features added though.

    I know you've said that "10 is the new 6" before, but let's remember the downsides to VC6: so many features were implemented according to pre-standard specs, and weren't fixed until VC7 or later, causing quite a few compatibility issues. Waiting 3 years for a correct lambda implementation would seem to repeat that mistake. I hope you can get that one fixed before too much code is written relying on the old incorrect implementation.

  • C++0x?? Get to work on C99 support first.

  • Great job! VC10 has made huge strides. Any plans for Variadic templates (N2242)?

  • Off-topic but interesting Unfortunate thing.

    >> Windows Phone 7 will not run native C++ applications.  You might consider porting your application to Silverlight and XNA.

    http://blogs.msdn.com/somasegar/archive/2010/03/15/introducing-windows-phone-7-development-tools.aspx#9991321

  • Thank you for the table. It and the links within it are really useful for understanding which new features we get to play with soon.

  • Thanks for the table. With impatience I wait "constexpr".

  • yes, constexpr PLEASE. also noexcept

  • >> C++0x?? Get to work on C99 support first.

    I'd rather hope for C1x (2012 possibly?) support.

  • @RJ Ryan: why?

    C++ is more widely used than C, especially in the Windows world.

    And it's been my experience that a lot of C developers don't really care much about new revisions of the language. C99 is pretty much the red-headed stepchild of C. We don't really talk about it much. ;)

    On the other hand, in C++-land, practically everyone is itching for C++0x support.

    Why not add the most popular features first?

    And hey, C++0x even includes a number of C99 features, so to some extent, you get what you're asking for in any case.

  • I've actually found a number of things that are being written for C99 -- it's a shame I can't use VC++ to write them.  I suspect real C99 support could be finished pretty quickly.  It's not nearly as huge a leap forward as C++0x is.

    Then again, maybe someone will finally get some GCC files made to integrate with MSBUILD.

  • If you want to believe this

    http://developers.slashdot.org/story/10/04/06/2354221/C-Programming-Language-Back-At-Number-1

    then C is most widely used programming language for 2009 and beyond.  C++ runs about half the count.  What count is, I dunno.

  • There are a few features not on this list.  What are the statuses of Variadic Templates and template aliases?

  • Also note that in MS lingo (Microspeak), "Yes" actually means "Partial" for some of the features.

    There are some cases in https://connect.microsoft.com/VisualStudio which are noted "Won't Fix", "Postponed" or "By Design".

Page 1 of 3 (40 items) 123