C/C++ Programmer's Guide (G06.25+)
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
E-1
E
Features and Keywords of
Version 2 NativeC++
•
Features Supported in VERSION2
•
Features Not Supported in VERSION2 on page E-4
•
Keywords Added for the D45 Product Release on page E-5
•
Defining Virtual Function Tables on page E-5
Features Supported in VERSION2
The following 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)]