April 6th, 2010

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

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.)

vc10-1 1.pptx

Category
C++

0 comments

Discussion are closed.