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++

 

  • Congratulations on the new release. Obviously there's been a ton of work involved, and it's greatly appreciated by many.

    My company can't engage with Visual Studio 2012 until XP support is available (later this fall), but we're certainly looking forward to the enhancements.

  • I also commend you for listening to us and committing to XP-targeted binaries in the near future.  Looking forward to being able to use VS 2012 for real work at that time!

  • Waiting for XP-targeted binaries.  Also - I'll only migrate to VS2012 depending on how cleanly XP targeting is intergrated into VS2012.  (If my product requires two installers, or one installer with two sets of runtimes, that'd likley be a deal breaker for me - I'll wait for VS2015, or move to a different platform).

  • will Remote Debugging work for XP and Vista after the XP-targeting update?

  • Please hurry up with full C++ 11 compliance

  • Add one more vote for remote debugging for XP and Vista. It's pretty much a must, rather than a wish.

    http://supportxp.com

  • I am pleased to see that Visual C++ is now fully covered in the Visual Studio landscape. I was talking with Tarek M. and I suggested him to write about cool features of Visual C++. C++ is the electricity for Microsoft. We should never forget this. This is a major release that was shipped with VS2012. Good job.

  • @Christophe Pichaud I'm not really sure what are you referring to when you mention "[...]Visual C++ is now fully covered[...]"  but C++11 conformance in Very Slow (Visual Studio) is by far the worst from all major players. Just look at gcc, clang and then you see what full coverage means. Apart from that, it seems like long forgotten player comes onto C++11 arena: edn.embarcadero.com/.../42275

  • We also can't upgrade until support for XP targetting is released.  In the meantime I've been playing with the RTM.  I was disappointed to find that we still can't get code metrics for c++ apps?  I tried "ANALYZE | Calculate Code Metrics for project".  It thought for a while and eventually output that same old error about there being "no managed code".

  • Intellisense in VC 11 is not working at all. VC 10 Intellisense is working for the same solution. I didn't convert the projects to VC 11 format. The solution consists of 77 projects. I did reset all settings in VC 11 but no luck. Recreate database and rescan solution didn't fix the problem either. I'm using Windows 7 64 ultimate.

  • It seems that minimal platform version for LINK.EXE is now 5.1 and not 6.0 as in VS11 Beta, so now we just need an XP-compatible runtime..

  • Azarien/Ted

    As documented in the Visual Studio 2012 compatibility page, remote debugging will not work on Windows XP (or Vista). Sorry, there is no plan to add it back at this time.

    www.microsoft.com/.../compatibility

  • Dan S,

    That's correct. Code Metrics is not supported for C++ at this time.

  • Visual Studio 2012 has a nice UI much better then vs2011

  • @Rahul V. Patil, I don't want to sound negative, but I know I will. The main problem I see with this release of Visual Studio is that despite the hype and talk you guys tried to create around C++, you did virtually nothing for this language - please just don't metion "for based" loops or SCARY iterators which nota bene the latter weren't even required by standard. So what was the logic behind of implementing something which isn't required and not implementing something instead which is required and I believe most if not every dev would prefer? Just like someone said about herb sutter - he just talks but that's all. And here we have the best example of it. It supposed to be C++ Renaissance but instead we have yet another, hell only knows what for, realease of broken Visual Studio. And if that's true what R.J. says about intellisense - guys, it's pure disaster. You already lost METRO to german company, If the trend continues you will lost IDE to someone else.

Page 2 of 3 (35 items) 123