The C++ 11 Standard & Visual Studio – Introduction

March 21, 2013

 

C++ 11, formerly known as C++0x, was published as ISO/IEC 14882:2011 in September 2011. The standard document is available for a fee, however the most recent draft, before the release, was N3242 and the most recent working draft freely available is N3337, dated 26 January 2012. C++11 includes several additions to the core language and extends the C++ standard library incorporating most of C++ TR1 libraries and many other features, most of them originated from the boost library. C++ 11 is a new language and as such, you need to learn what is in there for you and how to leverage and improve your code, using the new language and library goodies.

In the following days, I will publish a short intro to the new features, starting with those that you can find in Visual Studio 2010, to those in VS 2012 and the ones that are preview in the last November CTP. I will also write a little bit about new features of C++ 11 which are not yet available in Visual Studio.

In the last MVP Summit, We discussed the reason for using C++. The main reasons were:

  1. Performance
  2. Cross-Platform
  3. Investment in old and current C/C++ code

I can say that the reasons people do not use C++ are:

  1. Productivity
  2. Libraries
  3. Tools

C++ 11 and the new versions of Visual Studio continue to keep the main reasons to use C++ while starting to improve the productivity (Lambda, auto, …), enhance libraries (threads, chrono, filesystem, Etc.), and providing new tools (VS Unit Test & Code Coverage).

When looking at the C++ 11 Committee Directives, we can see that C++ 11 preserves the old C++ spirit but handles the current challenges:

  • Maintain stability and compatibility with C++98 and possibly with C
  • Prefer introduction of new features through the standard library
    • Rather than extending the core language
  • Prefer changes that can help evolve programming technique
  • Improve C++ to facilitate systems and library design
    • Rather than introduce new features, only useful to specific applications
  • Increase type safety
  • Increase performance and the ability to work directly with hardware
  • Provide proper solutions for real-world problems
  • Implement “zero-overhead” principle (the supermarket law)
  • Make C++ easy to teach and easy to learn
    • Without removing any utility needed by expert programmers

The Microsoft C++ team was very busy in the last couple of years. They had to give their full attention to support Windows 8 and Windows Phone 8. To support new hardware platforms such as the ARM architecture, and to continue and upgrade the compiler and tools to provide high performance features such as auto vectorization, auto parallelism and GPGPU (AMP).

Their budget may be big, but it has a limit. In spite of all the tasks they had, they have succeeded to provide many of the new C++ 11 features. They have started even before the release of the C++ 11 standard, in VS 2010, and they have released new features in VS 2012:

Visual Studio 2010 C++ 11 Features:

 

Visual Studio 2012 C++ 11 Features

 

November 2012 Compiler CTP C++ 11 Features

 

C++ 11 Features not in VS (yet)

 

In the following posts I will go through the new features of C++ 11 that are implemented in VS 2010/2 and the November 2012 CTP (Probably also in VS V.Next).

Do remember that many of the TR1 features are now part of the standard, so VS 2010/2 implements all of them. I will write several posts about some of TR1 features. There are some minor or trivial features that I will not get into such as Right angle brackets & long long and other obvious features.

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

one comment

  1. Eran StillerMarch 22, 2013 ב 09:32

    Can’t wait to read your insights regarding the various features.

    Reply