Converting some old source code to new C++11 I was impressed discovering that the standard Visual Studio 2012 lacks many feature of the new standards (for example the Constructors Delegate).
Visual Studio 2013 claims to be more stable with that, but what about VS2012?
There is a special update here: http://www.microsoft.com/en-us/download/confirmation.aspx?id=35515 called “Visual C++ Compiler November 2012 CTP“. It’s not included through any Visual Studio update (currently I’m running VS2012 Update 3) but it introduces a limited support for some features included in the C++11 standard.
After installing the CTP update, under the project’s “Property Pages > Configuration Properties > General > Platform Toolset“, choose “Microsoft Visual C++ Compiler Nov 2012 CTP (v120_CTP_Nov2012)”, like this:
Then launch a full rebuild of your project. That’s all.
And about CMake?
cmake ... -T "Microsoft Visual C++ Compiler Nov 2012 CTP (v120_CTP_Nov2012)"
That’s all. Now you have access to the following additional C++ compiler features:
- Variadic templates
- Raw string literals
- Explicit conversion operators
- Default template arguments for function templates
- Delegating constructors
- Uniform initialization
For an explanation, read this:
http://channel9.msdn.com/Series/C9-Lectures-Stephan-T-Lavavej-Core-C-/STLCCSeries6
A more stable compiler
Disregarding the note that appears at each compilation “‘Microsoft Visual C + + Compiler November 2012 CTP’ is for testing purposes only.”, the compiler looks really more stable: in a project with more than 300 source files, compilation crashes were very frequently. With the new version, these problems seem to be reduced greatly.
Resources
The microsoft blog announcing the CTP compiler: http://blogs.msdn.com/b/vcblog/archive/2012/11/02/visual-c-c-11-and-the-future-of-c.aspx