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
  • consider the following code:

    --------------------------------

    template<class T> struct always_void { typedef void type; };

    template<class T, class EnableIfType = void>  

    struct has_f : public std::false_type {};

    template<class T>

    struct has_f<T, typename always_void<decltype(&T::f)>::type>

    : public std::true_type {};

    -----------------------------------

    I expect has_f<T>::value to be true when T::f is well-formed and false otherwise, but ir's always false.

    Am I wrong or is it a bug?

    Thx

  • Istvan Kispal: Looks like a bug, though I can't say for sure. GCC 4.5.0 agrees with you. I've filed internal bug number Dev10#890865 to track this. Thanks!

    Stephan T. Lavavej, Visual C++ Libraries Developer

  • I think you mean "wasn't enough time" in the following sentence "It was recently voted into the C++0x Working Paper, and there was enough time for us to implement it in VC10."

  • What I said was correct. (I could have said "there was barely enough time" to avoid confusion.) We implemented rvalue references v2 between Beta 1 and Beta 2.

  • What about have a public table and let use see the status of C++0x like http://gcc.gnu.org/gcc-4.6/cxx0x_status.html GCC does.

  • This table is a very useful resource for Microsoft customers.  Unfortunately, a recent web page redesign means we can't actually see the relevant columns for VC2010 any more - even if we resize the page on a large screen, the viewable width is fixed!

  • @Stephan:  Just a heads-up:  with the new MSDN Blogs layout, the table gets cut off on the right and the Visual C++ 2010 column can't be seen.

  • With the new and uniform layout for MSDN Blogs your table get cut by the SideBar, please try add the table inside a div with scrolling.

    Thank you.

  • The table width has still not been fixed.

    I liked the older blog design better.

  • Use the text only version to view the page. It shows the complete table.

    Here is the link I used : webcache.googleusercontent.com/search

Page 3 of 3 (40 items) 123