Class Library Reference Manual
The C++ Class Library is a set of headers and other files implementing a
collection of basic C++ classes. In the library, these classes are
arranged in functionally related groups called
The C++ Class Library makes use of other run-time libraries. To ensure
that all necessary libraries are linked into the executable image,
certain switches need to be provided to the linker through the
command. For detailed information on the switches to use, see
Using Compaq C++ for Tru64 UNIX.
Identifiers beginning with
are reserved for the C++ Class Library and should not be used by
customer programs except as specified in this manual.
1.1 Thread Safe Programming
Developers of multithreaded applications should note the following:
- Internal class library data is thread safe; multiple threads can
access the C++ Class Library simultaneously without compromising the
integrity of the internal data.
- The predefined stream objects,
are thread safe. However, you need to provide synchronization around
sequences of operations on these objects. For more information on
synchronizing access to the predefined stream objects, see Chapter 4.
- User-defined objects are not thread safe; users must provide
synchronization for such objects if they are shared between threads.
For more information on synchronizing access to user-defined objects,
see Chapter 6.
class member function
is not thread safe; if your application calls this function, the call
must come before any threads use the predefined stream objects:
- Generation of error messages within the vector package is not
thread safe; the package uses static data members to handle the current
error message and there is no synchronization between threads. HP
recommends that you define a single Mutex object to synchronize all use
of the vector package.
- The task package is not thread safe; only one task can execute at a
1.2 Using RMS Attributes with iostreams
The Class Library class
member function do not support different RMS attributes, for example,
creating a stream-lf file.
To work around this restriction, use the C library
call, which returns a file descriptor, and then use the
constructor, which accepts a file descriptor as its argument. For
// use either creat or open
//if ( !(fp= creat("output_file.test", 0, "rfm=stmlf")) )
if ( !(fp= open("output_file.test", O_WRONLY | O_CREAT | O_TRUNC , 0,
ofstream output_file(fp); // use special constructor which takes
// a file descriptor as argument
1.3 Class Library Restrictions
The following are restrictions in the C++ Class Library:
- No Class Library support for 128-bit long doubles
Library does not include support for 128-bit long doubles.
- Conflict with redefinition of
If your program includes both
, HP C++ might fail to compile your program because
is defined by both header files. In
is defined as a macro whereas in
is defined as a member function.
If your program
does not use either
or uses the <curses.h>
, include the
header first, followed by
If your program uses the
function, undefine the
macro directly after the