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

B TNS C++ Implementation-Defined Behavior
HP Specific Features for OSS and Guardian Environments
The HP specific features discussed in this subsection are applicable to the Guardian environment
on all current systems and to the OSS environment on NonStop S-series systems.
Length of Identifiers
Cfront generates identifiers up to a maximum of 230 characters except for global variable names
which can be up to a maximum of 127 characters.
For identifiers longer than 230, characters 229 and 230 represent a hashing of all characters
beyond character 228. For global variable names longer than 127, characters 126 and 127
represent a hashing of all characters beyond character 125. This rule applies to identifiers and
global variable names that you provide and that are generated by Cfront as a result of name
encoding.
Length of String Literals
Cfront supports a maximum string literal size of 4096 characters, which is compatible with the
string literal size supported by the C compiler.
Data Types
HP C++ supports the standard data types supported in the HP C programming language, including
data types signed char and long long, a 64 bit-integer.
The data type signed char is an HP extension to Cfront. The data type signed char can be
used to distinguish a specific instance of an overloaded member function.
The data type long long is also an HP extension to Cfront. The data type long long is
recognized as a predefined data type. Type matching occurs for initialization, expressions, and
argument lists. Variables of type long long are allowed in all contexts that HP C allows them.
Constants of type long long are recognized when the decimal number is followed by the modifier
LL or ll. Variables and constants of type long long are allowed in classes and templates.
Type Qualifiers
HP C++ recognizes the type qualifier volatile, but ignores it. You cannot use volatile to
distinguish specific instances of overloaded member functions.
Templates (Parameterized Types)
HP C++ provides language support for templates. All templates must be instantiated at compile
time. This requires that template bodies be available at compile time. There is no support for
bind-time instantiation.
To ensure minimal change by users of future releases of C++, these organization for programs
using templates is recommended:
1. Put the declaration of template T in the header file TH.
2. Put template T function bodies in file TC.
3. Put #include "TC" as the last line of header file TH so as to include the function body file
TC.
This organization ensures that any file including TH will also include TC. If a future release of HP
C++ supports bind-time instantiation, the single line #include "TC" can be removed.
Class Libraries
The iostream class library described in The Annotated C++ Reference Manual is available for use
with C++.
418 TNS C++ Implementation-Defined Behavior