What's New for Visual C++ in Visual Studio 2013

This document introduces new and enhanced features in Visual C++ in Visual Studio 2013.

For information about other additions in Visual Studio 2013, see What's New in Visual Studio 2013.

Improved ISO C/C++ Standards Support

Compiler

  • Supports these ISO C++11 language features:

  • Supports these ISO C99 language features:

    • _Bool

    • Compound literals.

    • Designated initializers.

    • Mixing declarations with code.

  • String literal conversion to modifiable values can be disallowed by using the new compiler option /Zc:strictStrings. In C++98, conversion from string literals to char * (and wide string literals to wchar_t *) was deprecated. In C++11, the conversion was removed entirely. Although the compiler could strictly conform to the standard, instead it provides the /Zc:strictStrings option so that you can control conversion. By default, the option is off. Note that when you are using this option in debug mode, the STL will not compile.

  • rvalue/lvalue Reference Casts. With rvalue references, C++11 can clearly distinguish between lvalues and rvalues. Previously, the Visual C++ compiler did not provide this in specific casting scenarios. A new compiler option, /Zc:rvalueCast, has been added to make the compiler conformant with the C++ Language Working Paper(see section 5.4, [expr.cast]/1).

    The default behavior when this option is not specified is the same as in Visual Studio 2012.

Note

* For defaulted functions, using =default to request memberwise move constructors and move assignment operators is not supported.

C99 Libraries

Declarations and implementations are added for missing functions in these headers: math.h, ctype.h, wctype.h, stdio.h, stdlib.h, and wchar.h. Also added are the new headers complex.h, stdbool.h, fenv.h, and inttypes.h, and implementations for all the functions declared in them. There are new C++ wrapper headers (ccomplex, cfenv, cinttypes, ctgmath) and a number of others are updated (ccomplex, cctype, clocale, cmath, cstdint, cstdio, cstring, cwchar, and cwctype). For more information, see C99 library support in Visual Studio 2013.

Standard Template Library

  • Support for the C++11 explicit conversion operators, initializer lists, scoped enums, and variadic templates.

  • All containers now support the C++11 fine-grained element requirements.

  • Support for these C++14 features:

    • "Transparent operator functors" less<>, greater<>, plus<>, multiplies<>, and so on.

    • make_unique<T>(args...) and make_unique<T[]>(n)

    • cbegin()/cend(), rbegin()/rend(), and crbegin()/crend() non-member functions.

  • <atomic> received numerous performance enhancements.

  • <type_traits> received major stabilization and code fixes.

Breaking Changes

This improved support for ISO C/C++ standards may require changes to existing code so that it conforms to C++11 and compiles correctly in Visual C++ in Visual Studio 2013. For more information, see Breaking Changes in Visual C++.

For more information about the new C++11/14 Language and STL features, see Support For C++11 Features (Modern C++) and C++11/14 STL Features, Fixes, And Breaking Changes In Visual Studio 2013

Visual C++ Library Enhancements

  • C++ REST SDK is added. It has a modern C++ implementation of REST services. For more information, see C++ REST SDK.

  • C++ AMP Texture support is enhanced. It now includes support for mipmaps and new sampling modes.

  • PPL tasks support multiple scheduling technologies and asynchronous debugging. New APIs enable the creation of PPL tasks for both normal results and exception conditions.

C++ Application Performance

  • Auto-Vectorizer now recognizes and optimizes more C++ patterns to make your code run faster.

  • ARM platform and Atom micro-architecture code quality improvements.

  • __vectorcall calling convention is added. Pass vector type arguments by using the __vectorcall calling convention to use vector registers.

  • New Linker Options. The /Gw (compiler) and /Gy (assembler) switches enable linker optimizations to produce leaner binaries.

  • C++ AMP shared memory support to reduce or eliminate data copying between CPU and GPU.

  • Profile Guided Optimization (PGO) enhancements:

    • Performance improvements from a reduction in the working set of apps that are optimized by using PGO.

    • New PGO for Windows Store app development.

Windows Store App Development Support

  • Support For Boxed Types In Value structs. You can now define value types by using fields that can be null—for example, IBox<int>^ as opposed to int. This means that the fields can either have a value, or be equal to nullptr.

  • Richer Exception Information. C++/CX supports the new Windows error model that enables the capture and propagation of rich exception information across the application binary interface (ABI); this includes call stacks and custom message strings.

  • Object::ToString() Is Now Virtual. You can now override ToString in user-defined Windows Runtime ref types.

  • Support For Deprecated APIs. Public Windows Runtime APIs can now be marked as deprecated and given a custom message that appears as a build warning and can provide migration guidance.

  • Debugger Improvements. Support for native/JavaScript interop debugging, Windows Runtime exception diagnosis, and async code debugging (both Windows Runtime and PPL).

Note

In addition to the C++-specific features and enhancements that are described in this section, other enhancements in Visual Studio also can help you write better Windows Store apps. For details about these features, see Windows 8.1 Feature Guide. For more information about new app templates, see C#, VB, and C++ project templates for Windows Store apps. For a list of new platform capabilities, see Windows 8.1 Preview: New APIs and features.

Diagnostics Enhancements

  • Debugger Improvements. Support for async debugging and Just My Code debugging.

  • Code Analysis Categories. You can now view categorized output from the Code Analyzer to help you find and fix code defects.

  • XAML Diagnostics. You can now diagnose UI-responsiveness and battery-usage issues in your XAML.

  • Graphics and GPU Debugging Improvements.

    • Remote capture and playback on real devices.

    • Simultaneous C++ AMP and CPU debugging.

    • Improved C++ AMP runtime diagnostics.

    • HLSL Compute shader trace debugging.

3-D Graphics Enhancements

  • Image Content Pipeline support for pre-multiplied alpha DDS format.

  • Image Editor uses internally pre-multiplied alpha for rendering, and thereby avoids rendering artifacts such as dark halos.

  • Image and Model Editors. User-defined filter creation is now supported in Shader Designer in Image Editor and Model Editor.

IDE and Productivity

The Visual Studio IDE has significant improvements to help you be more productive when you code in C++.

  • Improved Code Formatting. You can apply more formatting settings to your C++ code. By using these settings, you can control new-line placement of braces and keywords, indentation, spacing, and line wrapping. Code is automatically formatted when you complete statements and blocks, and when you paste code into a file. To modify formatting settings, on the menu bar in Visual Studio, choose Tools, Options, expand the Text Editor, C/C++, and Formatting nodes, and then make your changes. You can also use the Quick Launch box to access these options.

  • Brace Completion. C++ code now auto-completes the closing characters that correspond to these opening characters:

    • { (curly brace)

    • [ (square bracket)

    • ( (parentheses)

    • ' (single quote)

    • " (double quote)

  • Additional C++ Auto-completion Features.

    • Adds semicolon for class types.

    • Completes parentheses for raw string literals.

    • Completes multi-line comments (/* */)

  • Find All References now automatically resolves and filters references in the background after it displays the list of textual matches. To disable reference resolution, on the menu bar in Visual Studio, choose Tools, Options, expand the Text Editor, C/C++, and Advanced nodes, and change the Disable Resolving setting under References.

To modify the brace-completion settings, on the menu bar in Visual Studio, choose Tools, Options, expand the Text Editor, C/C++, and General nodes, and then make your changes. You can also change the settings for all Visual Studio languages by expanding the Text Editor, All Languages, and General nodes.

To modify specific C++ settings, on the menu bar, choose Tools, Options, expand the Text Editor, C/C++, and Advanced nodes, and then make your changes.

  • Context-Based Member List Filtering. Inaccessible members are filtered out of the IntelliSense member lists. For example, private members are not displayed in the member list unless you are modifying the code that implements the type. While the member list is open, you can press Ctrl+J to remove one level of filtering (applies only to the current member list window). You can press Ctrl+J again to remove the textual filtering and show every member.

  • Parameter Help Scrolling. The displayed function signature in the parameter-help tooltip now changes based on the number of parameters you've actually typed, rather than just showing an arbitrary signature and not updating it based on the current context. Parameter help also functions correctly when it's displayed on nested functions.

  • Toggle Header/Code File. You can now toggle between a header and its corresponding code file by using a command on the shortcut menu, or a keyboard shortcut.

  • Resizable C++ Project Properties Window.

  • Auto-generation of Event Handler Code in C++/CX and C++/CLI. When you are typing code to add an event handler in a C++/CX or C++/CLI code file, the editor can automatically generate the delegate instance and event-handler definition. A tooltip window appears when event-handler code can be auto-generated.

  • DPI Awareness Enhancement. The DPI Awareness setting for application manifest files now supports the "Per Monitor High DPI Aware" setting.

  • Faster Configuration Switching. For large applications, switching configurations—especially subsequent switching operations—execute much more quickly.

  • Build Time Efficiency.

    • Faster Builds. Numerous optimizations and multi-core utilization make builds faster, especially for large projects. Incremental builds for C++ applications that have references to C++ WinMD are also much faster.
  • For information about other additions and enhancements in the IDE, see What's New in Visual Studio 2013 and the other articles that it refers to.

See Also

Concepts

What's New in Visual Studio 2013

Other Resources

Visual C++ Team Blog