Visual C++ Compiler and Linker
auto Keyword
The auto keyword has a new purpose. Use the default meaning of the auto keyword to declare a variable whose type is deduced from the initialization expression in the variable's declaration. The /Zc:auto compiler option invokes either the new or previous meaning of the auto keyword.
decltype Operator
The decltype operator returns the type of a specified expression. Use the decltype operator in combination with the auto keyword to declare a type that is either complex or known only to the compiler. For example, use the combination to declare a template function whose return type depends on the types of its template arguments. Or, declare a template function that calls another function, and then returns the return type of the called function.
Lambda Expressions
Lambda functions have a function body but no name. Lambda functions combine the best characteristics of function pointers and function objects.
Use lambda functions by themselves, as a template function parameter instead of a function object, or together with the auto keyword to declare a variable whose type is a lambda.
Rvalue Reference
The rvalue reference declarator (&&) declares a reference to an rvalue. An rvalue reference enables you to use move semantics and perfect forwarding to code more efficient constructors, functions, and templates.
static_assert Declaration
A static_assert declaration tests a software assertion at compile time, unlike other assertion mechanisms that test at run time. If the assertion fails, the compilation fails and a specified error message is issued.
nullptr and __nullptr Keywords
The Visual C++ 2010 compiler enables you to use the nullptr keyword with native code in addition to managed code. The nullptr keyword indicates that an object handle, interior pointer, or native pointer type does not point to an object. The compiler interprets nullptr to be managed code when you use the /clr compiler option, and native code when you do not use the /clr option.
The Microsoft-specific __nullptr keyword has the same meaning as nullptr, but applies to only native code. If you compile native C/C++ code with the /clr compiler option, the compiler cannot determine whether the nullptr keyword is a native or managed term. To make your intention clear to the compiler, use the nullptr keyword to specify the managed term, or __nullptr to specify the native term.
/Zc:trigraphs Compiler Option
By default, support for trigraphs is disabled in Visual C++ 2010 . Use the /Zc:trigraphs compiler option to enable trigraphs support.
A trigraph consists of two consecutive question marks ("??") followed by a unique third character. The compiler replaces a trigraph with a corresponding punctuation character. For example, the compiler replaces the "??=" trigraph with the '#' character. Use trigraphs in C source files that use a character set that does not contain convenient graphic representations for some punctuation characters.
New Profile-Guided Optimization option
PogoSafeMode is a new option for profile-guided optimization that enables you to specify whether to use safe mode or fast mode when you optimize your application. Safe mode is thread safe but slower than fast mode. Fast mode is the default behavior.