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

Table Of Contents
TNS C++ Implementation-Defined Behavior
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
B-2
Length of String Literals
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.