94

A preview version of Visual Studio 2012 (the next version after VS2010) is now available.

Does anyone know what new C++11 features it supports? (I'm not in a position to try it out at the moment).

James McNellis
  • 327,682
  • 71
  • 882
  • 954
HighCommander4
  • 44,537
  • 22
  • 112
  • 180
  • 18
    And I'm left disappointed once more. Now to figure out how to use GCC/GDB more fluently... – GManNickG Sep 14 '11 at 20:11
  • 3
    GMan: I think their uptake on new features is pretty astonishing, certainly in view of where they're coming from (think VC 6.0 and shudder)... Sure, GCC's support is astonishing, but there are a lot of other places it is lacking too... – rubenvb Oct 06 '11 at 15:53
  • 5
    @rubenvn: Just out of curiosity, in what places is GCC lacking? – HighCommander4 Oct 06 '11 at 23:11
  • 5
    GCC is not lacking in support of C++ 11, it is pretty much umatched. VC11 is humorously lacking. It is not even close. – 987 S Jun 20 '12 at 12:12
  • 9
    @HighCommander4: In what places is GCC lacking? Debugging tools. – user541686 Jan 07 '13 at 19:38
  • 3
    @Mehrdad does make a very good point here. I'd love to use everything gcc has, but after years of using the VS debugging tools losing them would set me *way* further back than just missing some new interesting features. – stijn Jan 08 '13 at 13:05

7 Answers7

77

It's worth noting that Visual Studio 2010 already had quite a bit of early C++11 support. So to summarize what is already linked to in other answers, here is what is new in Visual Studio 11 that was not part of Visual Studio 2010:

In early November 2012, Microsoft announced the Visual C++ Compiler November 2012 CTP, which adds more C++11 functionality to Visual Studio 2012:

Mooing Duck
  • 56,371
  • 16
  • 89
  • 146
Joel Coehoorn
  • 362,140
  • 107
  • 528
  • 764
  • 20
    That's actually quite disappointing... I was hoping for variadic templates and uniform initialization, which GCC has been supporting for two and half and one and a half years, respectively... – HighCommander4 Sep 14 '11 at 20:18
  • @High uniform initialization isn't even on their list of features in the spec (doesn't even show up with a "No"). Is there perhaps another name for that? – Joel Coehoorn Sep 14 '11 at 20:54
  • 2
    I really love my type safe print and printf functions. I was really hoping that 2011 would finally add variadic templates. Missing variadics is also effecting `emplace_back` and `make_shared`. Is there something about cl that makes it particularly hard to implement variadics? – deft_code Sep 15 '11 at 20:14
  • 5
    Herb Sutter said in his second Build session (http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-835T) that they tried to do variadic templates ... tried and tried and they are not done in time for this version. This affected what other things they could do, as well. – Kate Gregory Sep 18 '11 at 22:24
  • Nice find! He also said in the same talk that we will not have to wait 2-3 years for a version that includes variadic templates - that's encouraging. – HighCommander4 Oct 01 '11 at 19:43
  • 2
    Here is a good comparison of different compilers on C++11. https://wiki.apache.org/stdcxx/C++0xCompilerSupport Good rule: don't use C++11 in GCC and expect it to compile in VS2012 – Chris Hill Oct 31 '12 at 22:16
25

Here is the list of feature of the new visual studio version and here is the list of what all compilers support

Drahakar
  • 5,668
  • 6
  • 39
  • 57
6

There is a list there. What strikes me the most is the features which are still missing:

  • They said they would implement variadic templates as a priority and they didn't.
  • We will still have to declare move constructors by hand for many classes, since there is no delegating constructors.
  • Inheriting constructors aren't present, and this would really be needed for some code
  • No uniform initialization, in particular no initializer lists. This sucks when you have used them with g++.
  • Still no correct thread local storage. So you're stuck with boost::thread_specific_ptr for a while.

All the other features which are yet missing are mainly stuff you can live without. What I list here is just what nags me everyday when working with VS10. It's just so irritating that they didn't work on the compiler at all.

EDIT: I shall also add that emplace_back (one great feature for the standard library containers) isn't correctly implemented.

Alexandre C.
  • 52,206
  • 8
  • 116
  • 189
  • 6
    They did make variadic templates a priority. That's why, when variadic templates didn't get done in time, the other language features didn't get done either. (Except, as it turns out, for the skunkworks range-for.) – Kate Gregory Feb 22 '12 at 21:00
  • 4
    ? I really can't live without Non-static data member initializers. – Trass3r May 24 '12 at 23:44
  • The problem with variadic templates is that the standard changed too late and they didn't have enough time to completely redo that feature. – Ark-kun Oct 01 '13 at 22:51
5

During GoingNative in Feb 2012, STL announced that range-for will be in VS11 starting with the beta, which is expected Feb 29th. A recording of the talk is available. "The Reveal" is at the one-hour 38 minute mark.

Kate Gregory
  • 18,565
  • 8
  • 53
  • 85
4

There is now a definitive list of C++11 features in VS2010 and VS2012 on MSDN.

Steve Townsend
  • 51,210
  • 8
  • 87
  • 134
2

http://blogs.msdn.com/b/vcblog/archive/2011/09/12/10209291.aspx

N_A
  • 19,387
  • 4
  • 47
  • 95
1

Try this video by Herb Sutter. This fellow dont need introduction!!!

http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-835T

Abhinav
  • 1,498
  • 1
  • 15
  • 31