Announcing November CTP of the C++ compiler, now with more C++11

Announcing November CTP of the C++ compiler, now with more C++11

Rate This
  • Comments 70

On February at the Going Native conference, we promised to work on implementing more parts of the C++11 standard. We also made a commitment to progressively roll out these features on a faster cadence through out-of-band releases such as CTPs (customer technology previews).

We delivered!

Today at Build 2012, Herb Sutter announced that we’re following through on our commitment by shipping the first batch of new C++11 features in the November 2012 Compiler CTP. Herb also announced that more information about the next batch of C++11 features would be coming in the first half of 2013.

The November 2012 CTP release is available immediately for download here: http://aka.ms/vc-ctp. It contains the following C++11 additions:

  • Variadic templates
  • Uniform initialization and initializer_lists
  • Delegating constructors
  • Raw string literals
  • Explicit conversion operators
  • Default template arguments for function templates

For those eager to learn how to put these cool C++11 features into practice, Stephan Lavavej took the compiler out for a spin in part 6 of his ongoing Core C++ series on Channel 9. Check it out!

Installation and Usage

After downloading and installing the program, you can launch Visual Studio 2012, load your C++ project and you can switch to the new compilers.We recommend you can create a separate project configuration from menu Build > Configuration Manager by duplicating your existing configuration and then follow the steps below:

  1. Open Project Property Pages (Alt+F7 under the Visual C++ mappings)
  2. From the ‘General’ tab, change ‘Platform toolset’ from ‘Visual Studio 2012 (v110)’ to ‘Microsoft Visual C++ Compiler Nov 2012 CTP (v120_CTP_Nov)’ and close the Property Pages
  3. Launch a full rebuild of your project

Important Notes

  • This is a Customer Technology Preview and does not come with a ‘Go Live’ license.
  • Visual Studio 2012 is required as a prerequisite for installing the package. If you don’t already have one, just download the free Desktop Express edition here.
  • This package contains only the compiler, and does not yet come with an updated standard library to use the features (such as a std::vector initializer_list constructor).
  • This version of the compiler is compatible with CRT 11.0 only and can be used as an alternative for the Visual C++ 2012 RTM compiler only.
  • While a new Platform Toolset is provided for convenience of integrating the compiler as part of the Visual Studio 2012 build environment, the VS 2012 IDE, Intellisense, debugger, static analysis, and other tools remain essentially unchanged and do not yet provide support for these new C++11 features.
  • For a list of known breaking changes introduced to support C++11, consult the documentation on the download site. It will always include the most up-to-date information.

We Want Your Feedback!

If you find any bugs (and a few likely escaped us!), please submit a report for Visual Studio via Microsoft Connect and use “[Codename Milan]” as a prefix in the bug title. You can also leave comments below and submit sugestions to Visual Studio UserVoice.

We’re very excited to have reached this milestone and hope you enjoy experimenting with this new compiler and report back. Remember, you can grab the CTP here and watch STL's Core C++ Episode 6 of n video here.

  • Thank you so much. I love you.

    Is there a define available to know what CTP I am compiling with?

    For example, can I wrote code like:

    #if CTP > 3

    #define VARIADIC_TEMPLATES_SUPPORTED

    #endif

  • How can this new version of the compiler be used from the command line?  I downloaded and installed the upgrade, but command line compilation continues to reject code using e.g., variadic templates.

  • @A Nonymous

    The command line compilation can be configured by updating the PATH and INCLUDE variables. After launching the VS2012 Developer Command Prompt, you need to:

    set PATH=[drive:][Program Files]\Microsoft Visual C++ Compiler Nov 2012 CTP\bin;%PATH%

    set INCLUDE=[drive:][Program Files]\Microsoft Visual C++ Compiler Nov 2012 CTP\include;%INCLUDE%

    Everything should work after that.

    Hope this helps,

    Marian

  • Thanks very much for you C++ commitment.

  • When it is released in its final form, will this work with the Windows XP targeting?

  • First of all: great work, you're delivering what you promised in terms of quicker incremental updates.  Thank you for that!

    Is there a known timeline (or approximate timeline) on the front end "red squiggles" support and (more importantly) library support for initialization lists on vectors etc?  Just really looking forward to full support for these features! :)

  • Chris Blume: Test _MSC_FULL_VER. It is 170050727 for VC11 RTM and 170051025 for this CTP.

  • Will the CTP, when actually released, be link and compile compatible with the original VS2012.

    Just wanted to make sure that if I build and develop using the newer compiler, including presumably, an updated C++ standard library using these features, that as long as I don't use the newer features in my header files I can hand my headers and DLLs to someone using the original VS 2012 and expect no explosions?

    Also when released in production is this going to be an optional download and install or will it be more like an SP1 on Visual Studio 2012 which you would expect everyone to install and hence "upgrade" to.

  • Does this patch work with the express editions ?

  • Uniform initialization:

     #include <vector>

     std::vector<int> a { 1, 2, 3, 4, 5}; // failed to compile (

     int a[] {1, 2, 3, 4, 5};              // compiles ok

    what am I missing?

  • @belofn:

    You missed the remark that the library has NOT been updated (it's just a compiler update currently)...

  • davidhunter22: We are going to break binary compatibility for the C++ Standard Library (as we have done between VS 2003, 2005, 2008, 2010, and 2012). We need to make significant changes which aren't compatible with preserving binary compatibility.

  • CTP appears to have problems with unnamed initializer lists in range-based for loops:

    This compiles:

    auto j = { 1, 2, 3, 4 };

    for ( auto i : j ) {

    std::cout << i << "\n";

    }

    But this doesn't...

    for ( auto i : { 1, 2, 3, 4 } ) {

    std::cout << i << "\n";

    }

    The above produces:  Error 1 error C2668: 'std::begin' : ambiguous call to overloaded function

  • I assume that this is because std::begin on an initializer list is a library feature, and as we've been told, the library hasn't been updated for initializer lists yet.

  • Too bad I don't have time to test this, this is definitely a great update.

    I have seen in one of the examples in this very blog using the defaulted/deleted functions feature ( blogs.msdn.com/.../10143956.aspx ) . This makes me think there was (almost 2 years ago!) an internal version of the compiler that knows this feature. Does this CTP has it?

    Let me extend the question: Are these listed the only changes in this CTP, or will these be the only planned changes in VC12? If not, can you tell if you plan what additional stuff are you planning? One can never have enough C++11 features :)

Page 1 of 5 (70 items) 12345