Exploring C 11 Features in Visual Studio 2012
With the anticipation building up around Visual Studio 2012, the successor to VS2010, developers are eager to know what C 11 features it brings to the table.
New C 11 Features in Visual Studio 2012
While Visual Studio 2010 provided preliminary support for C 11, Visual Studio 2012 surpasses it by implementing additional C 11 features, including:
-
Enhanced Rvalue References: Upgrades rvalue references to version 2.1.
-
Advanced Lambdas: Extends lambda expression support to version 1.1.
-
Decltype Improvements: Enhances decltype to version 1.1. (However, it's not yet available in the developer preview.)
-
Refined Alignment: Introduces improved alignment support, though it's still incomplete.
-
Complete Strongly-Typed Enums: Provides fully-fledged support for strongly-typed enums.
-
Forward Declared Enums: Enables forward declaration of enums.
-
Standard Layout and Trivial Types: Facilitates the identification and usage of standard layout and trivial types.
-
Atomics: Includes support for atomic operations.
-
Enhanced Comparison and Exchange: Enhances compare and exchange operations.
-
Bi-Directional Fences: Introduces bi-directional fences for memory synchronization.
-
Data-Dependency Ordering: Allows for data dependency ordering in multithreaded applications.
-
Range-Based For Loop: Provides syntactic sugar for iterating over containers.
Additional C 11 Functionality in Visual C Compiler November 2012 CTP
Microsoft's November 2012 CTP release for the Visual C Compiler further expands C 11 capabilities in Visual Studio 2012:
-
Uniform Initialization: Enables simplified and consistent variable initialization.
-
Initializer Lists: Facilitates the initialization of multiple members with a single expression.
-
Variadic Templates: Supports templates that can accept a variable number of arguments.
-
Function Template Default Arguments: Allows default argument values to be specified for function templates.
-
Delegating Constructors: Introduces delegating constructors for improved code organization.
-
Explicit Conversion Operators: Enables programmers to define and control explicit conversion behaviors.
-
Raw Strings: Supports strings with exemption from escape sequences.
The above is the detailed content of What C 11 Features Does Visual Studio 2012 Offer?. For more information, please follow other related articles on the PHP Chinese website!