Visual C++ in Visual Studio 2012

Visual C++ in Visual Studio 2012

Rate This
  • Comments 35

If you have read Jason Zander’s post earlier today, you know that Visual Studio 2012 has been released to the web! Check out the MSDN Subscriber Download Page  and the Visual Studio product website. This release has brought a huge amount of new value for C++ developers. Here are the highlights:

  

C++11 Standards Support

Language Support

  • Range-based for loops. You can write more robust loops that work with arrays, STL containers, and Windows Runtime collections in the form for ( for-range-declaration : expression ).
  • Stateless lambdas, which are blocks of code that begin with an empty lambda introducer [] and capture no local variables, are now implicitly convertible to function pointers as required by the C++11 Standard.
  • Scoped enumerations support. The C++ enum class enum-key is now supported. 

Standard Template Library

  •  We’ve added support for the new STL headers: <atomic>, <chrono>, <condition_variable>, <filesystem>, <future>, <mutex>, <ratio>, and <thread>.
  •  SCARY iterators. As permitted but not required by the C++11 Standard, SCARY iterators have been implemented.

Here is the detailed discussion on C++ 11 features in Visual Studio 2012, with links to the corresponding C++ 11 specs. Please also see the fun video series on STL … by STL.

  

Parallel Programming

Compiler and Linker

We’ve made major investments to help developers make the most of their target hardware. We are introducing the auto-vectorizer to take advantage of SSE2 instructions to make your loops go faster by doing 4 number operations at time, auto-parallelizer to automatically spread your work on many CPUs, and C++ AMP (C++ Accelerated Massive Parallelism) to leverage the power of GPU for data parallel algorithms. Note that C++ AMP also comes with a first-class debugging and profiling support.

Libraries (PPL)

We continue to enhance the breadth and depth of Parallel Patterns Libraries (PPL). In addition to major investments in async programming, we’ve added more to algorithms and concurrent collections. We are also working very hard in bringing most of these concepts into the next revision of the C++ standard.

Debugging

In addition to the Parallel Tasks window and Parallel Stacks window, Visual Studio 2012 offers a new Parallel Watch window so that you can examine the values of an expression across all threads and processes, and perform sorting and filtering on the results.

  

C++ for Windows 8

Note: XAML/DirectX interop :Developers targeting Windows 8 Store apps can use both XAML and DirectX in the same app, which allows developers to build flexible user interfaces like the one in FreshPaint app.


  

IDE

In addition to the general Visual Studio IDE improvements like the new Solution Explorer, Preview Tabs, new Find, Compare, and Asynchronous Solution Load etc., we’ve made several IDE enhancements that are new for C++ and help C++ developers be more productive with Visual Studio.

  • C++ Code Snippets. The IDE now adds the skeleton code for common C++ code constructs like switch, if-else, for loop, etc. automatically. Select a code snippet from the List Members drop-down list to insert it into your code and then fill in the required logic. You can also create your own custom code snippets for use in the editor.
  • Semantic Colorization. C++ code editor now conveys semantic structure of the code by colorizing types, enumerations, macros, and other C++ tokens by default. There are a number of other tokens that can be colorized differently to customize the experience.
  • IntelliSense Enhancements. The List Members drop-down list appears automatically as you type code into the code editor. Results are filtered using a fuzzy search algorithm, so that only relevant members are displayed as you type. C++ IntelliSense Quick Info tooltips now show richer XML documentation comments style information. Selecting a symbol now highlights all instances of the symbol in the current file. Press Ctrl+Shift+Up Arrow or Ctrl+Shift+Down Arrow to move among the highlighted references.

 

  • C++/CLI IntelliSense. C++/CLI now has full IntelliSense support. IntelliSense features such as Quick Info, Parameter Help, List Members, and Auto Completion now work for C++/CLI. In addition, the other IntelliSense and IDE enhancements listed in this document also work for C++/CLI.
  • Visual Studio Templates support. You can now use the Visual Studio Templates technology to author C++ project and item templates

  

Application Lifecycle Management Tools (ALM)

Code Analysis

Static code analysis helps identify runtime issues at compile time when they are much cheaper to fix. Code analysis for C++ feature in Visual Studio 2012 has been enhanced aiming to provide improved user experiences as well as analysis capabilities. In this new version, code analysis has been extended to support 64 bit apps, ship with additional concurrency rules to detect issues like race conditions, and offer the ability for creating customized rule sets. This feature is now available in all Visual Studio editions allowing every developer to make the best use of it.

Architecture Dependency Graphs

Generate dependency graphs from source code to better understand the architecture of your existing apps or code written by others. In Visual Studio 2012 you can generate dependency graphs by binaries, classes, namespaces, and include files for C++ apps. Also, use Architecture Explorer tool window to explore the assets and structure of your solution by looking at solution view or class view.

Example: Dependency Graph by Binary

Example: Dependency Graph by Include Files

Use Architecture Explorer to browse assets in the solution

 

Unit Test Framework for C++

Visual Studio 2012 ships with a new unit test framework for native C++. You can write light-weight unit tests for your C++ applications to quickly verify application behaviors. Use the new Test Explorer tool window to discover and manage your tests along with test results. This feature is now available in all Visual Studio editions.


Code Coverage

Code coverage has been updated to dynamically instrument binaries at runtime. This lowers the configuration overhead, provides better performance and enables a smoother user experience. Code coverage feature has also been integrated well with the new C++ unit test framework in Visual Studio 2012 allowing you to collect code-coverage data from unit tests for C++ app by one single click within Visual Studio IDE.


  

 

Coming Soon!

We’ve announced two things that will arrive in a few months:

 

C++ for Windows Phone 8

As soon as the Windows Phone 8 SDK is made available, C++ developers will be able to target Windows Phone. Stay Tuned!

Example: Windows 8 Marble Maze Sample targeting Windows Phone 8

 

As always, we love hearing from you. Thanks for keeping us honest and kudos to those who have influenced our product design for the better!

 

On behalf of the VC++ team,

Rahul V.Patil

Lead Program Manager, C++

 

  • Thanks to all involved for all the native code love in Visual Studio 2012. Looking forward to Microsoft's further adventures in native code... Some kick ***, on the metal, C++ libraries would be good now.

  • Awesome :)

    So, any indication when VS 2012 will hit Dreamspark?

  • Tom,

    Thanks! I take it you've read Herb's post on libraries: herbsutter.com/.../facebook-folly-oss-c-libraries

    Do you have any favorite domains of libraries that you'd love to see?

  • Dudester,

    Check out Neil Carter's response on Soma's blog post today.  blogs.msdn.com/.../visual-studio-2012-and-net-4-5-now-available.aspx

    If you have further questions on that, feel free to leave a note on Soma's blog.

    ----copy-paste-----

    Hello -

    Thank you for reaching out to us regarding DreamSpark's availability of Visual Studio 2012.  This is an incredibly exciting release for us.

    If you are a student and your school or institution has a DreamSpark Subscription, the Program Administrator for your DreamSpark Subscription will have access to Visual Studio 2012 today through MSDN Subscriber Downloads (msdn.microsoft.com/.../downloads).

    For students with accounts on DreamSpark.com, or with student accounts in their school or institution's ELMS WebStore we are working as quickly as possible to make this available and have a release target of August 24th.

    Thank you!

    Neil Carter

    DreamSpark Global Program Manager

  • Any hint of when the full c++11 support (variadic templates, initializer lists, etc) update will be released?

  • Sorry John - nothing that we can share yet.

  • Hi Rahul,

    Well on the native libraries front (and take it as read that all of these should play nicely with STL, i.e. use std::basic_string and support contains and algorithms): XML parsing, file-system, web-stack (get Casablanca into supported mode), compression would be a good start.

    Viz updates, Variadics and List Initialisation would be nice, but and I know you're sick of hearing this... Windows XP binary generation (i.e. the option to target either the Win7 or Win8 SDK) without having to bring the hammer of side-by-side installing VS2010. We have far too many clients in Financial Services who are going to stick with XP until the bitter end. Desperately need to be able to use out-of-the-box VS2012 to target Windows XP and create mixed-mode apps that combine C++ 11, C++/CLI and .NET 4.

    Kind regards,

    Tom

  • I'm really happy to be getting back onto RTM tools, despite how relatively stable the RC was. Anything particularly notable changed since the RC? I expect it's a pretty hard feature-freeze at that point.

  • Hi, Are there any improvements for Microsoft Foundation Classes in Visual Studio 2012?

  • Thanks for the details on libraries Tom.

    Re: Windows XP. We hear you:). The plan still is targeting a late-Fall release as per the previous post: blogs.msdn.com/.../10320645.aspx

  • Hi Simon,

    Almost all of the work post-RC was related to fit-and-finish, reliability and performance work - and mostly those reported by developers.  

  • Hi Unique,

    Re: MFC:

    We've fixed a large number of connect issues/suggestions around MFC. See blogs.msdn.com/.../10320171.aspx  However, no large chunk feature items this release.

  • Congratulations!  I also want to say that I'm quite impressed at how MS listened to the community regarding XP support and native C++ in the Express SKU.  

    I think the decisions to support these things maybe came a bit late, but I really thought that XP support was a dead duck, so I'm especially impressed with that turn around. Kudos.

  • Thanks MikeB!

  • Simon Buchan: My last major change was to make <atomic>'s implementation header-only between RC and RTM, for increased performance.

Page 1 of 3 (35 items) 123