C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)
VERSION2
The VERSION2 pragma is a command-line directive for native mode C++ that instructs the C++
compiler to compile using the dialect or features available beginning with the D45 version of the
HP C++ language. This pragma is not accepted by the TNS compilers.
VERSION2
The pragma default settings are:
SYSTYPE OSSSYSTYPE GUARDIAN
N.A.N.A.TNS C compiler
N.A.N.A.G-series TNS c89 utility
VERSION3 for C++, N.A. for CVERSION3 for C++, N.A. for CTNS/R native C and C++ compilers
VERSION3 for C++, N.A. for CVERSION3 for C++, N.A. for CNative c89 utility
N.A.N.A.c99 utility
VERSION3 for C++, N.A. for CVERSION3 for C++, N.A. for CTNS/E native C and C++ compilers
Usage Guidelines
• You can enter the VERSION2 directive on the compiler RUN command line when specifying
NMCPLUS or CPPCOMP on Guardian environment, or using the -Wversion2 flag of the
c89 utility. You cannot enter the VERSION2 directive in the source file.
• VERSION2 supports DLLs (Dynamic-Link Libraries) and Position-Independent Code (PIC).
• Using the VERSION2 directive enables you to use these language features of the native C++
compiler:
◦ Exception handling
◦ Namespaces
◦ The bool type
◦ The wchar_t type
◦ Array new and delete
◦ Run-time type identification (RTTI)
◦ New-style casts (static_cast, reinterpret_cast, and const_cast)
◦ Explicit instantiation of templates
◦ Support of partial specialization of templates
◦ Support of extern inline functions
◦ enum types are considered to be nonintegral types
These language features are part of the proposed C++ standard introduced by the
Working Paper for Draft Proposed International Standard for Information Systems –
Programming Language C++, 2 December 1996, X3J6/96-0225 WG21/N1043.
If you want to use any of these VERSION2 features in an application originally compiled
with any pre-D45 RVU of the TNS/R native C++ compiler, you must recompile and relink
all modules of the program using the VERSION2 directive.
254 Compiler Pragmas