C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)

E Features and Keywords of Version 2 Native C++
Features Supported in VERSION2
These features are accepted in the VERSION2 dialect of native C++. These features are not in the
The Annotated C++ Reference Manual (Ellis and Stroustrup) but are in the X3J16/WG21 Working
Paper [The relevant sections of the WP are cited inside brackets]:
The dependent statement of an if, while, do-while, or for is considered to be a scope,
and the restriction on having such a dependent statement be a declaration is removed. [6.4
Selection statements]
The expression tested in an if, while, do-while, or for, as the first operand of a “?” operator,
or as an operand of the “&&, “||, or “!” operators can have a pointer-to-member type or
a class type that can be converted to a pointer-to-member type in addition to the scalar cases
permitted by the ARM. [6.4 Selection statements; 4.12 Boolean conversions; 6.4.1 The if
statement; 6.4.2 The switch statement; 6.5 The iteration statement; 5.14 Logical and
operator; 5.15 Logical or operator; 5.16 Conditional operator; 5.3.1 (7) Unary operators]
Qualified names are allowed in elaborated type specifiers. [3.4.4 Elaborated type specifier]
A global-scope qualifier is allowed in member references of the form x.::A::B and
p->::A::B. [5.1 Primary expressions; 5.2.5 Class member access]
The precedence of the third operand of the “?” operator is changed. [5.16 Conditional
operator]
If control reaches the end of the main() routine, and main() has an integral return type,
it is treated as if a return 0; statement were executed. [3.6.1 (5) Main function]
A functional-notation cast of the form A() can be used even if A is a class without a (nontrivial)
constructor. The temporary object created gets the same default initialization to zero as a
static object of the class type. [5.2.3 Explicit type conversion (function notation)]
A cast can be used to select one out of a set of overloaded functions when taking the address
of a function. [13.4 Address of overloaded functions]
Type template parameters are permitted to have default arguments. [14.1 Template parameters]
Function templates may have nontype template parameters. [14.1 Template parameters]
A reference to const volatile cannot be bound to an rvalue. [8.5.3 References]
Qualification conversions such as conversion from T** to T const * const * are allowed.
[4.4 Qualification conversion]
Digraphs are recognized. [2.5 Alternative tokens]
Operator keywords (and, bitand, and so on) are recognized. [2.5 Alternative tokens]
Static data member declarations can be used to declare member constants. [9.4.2 (4) Static
data members]
wchar_t is recognized as a keyword and a distinct type. [3.9.1(7) Fundamental types]
bool is recognized. [3.9.1(8) Fundamental types]
RTTI (run-time type identification), including dynamic_cast and typeid operator, is
implemented. [5.2.8 Type identification]
Declarations in tested conditions (in if, switch, for, and while statements) are supported.
[6.4(3) Selection statements]
Array new and delete are implemented. [5.3.4 New; 5.3.5 Delete; 18.4.1.2 Array forms]
New-style casts (static_cast, reinterpret_cast, and const_cast) are implemented.
[5.2.6 Dynamic cast; 5.2.8 Static cast; 5.2.9 Reinterpret cast; 5.2.10 Const cast]
Definition of a nested class outside its enclosing class is allowed. [9.7(3) Nested class
declarations]
434 Features and Keywords of Version 2 Native C++