H-Series Application Migration Guide (H06.03+)

Native C and C++ Migration Tasks
H-Series Application Migration Guide429855-006
5-9
Migrating to the C++ Standard Library VERSION2
Migrating to the C++ Standard Library VERSION2
Migrating from C++ VERSON1 to C++ VERSION2 should require few or no source
code changes. In most cases, simply specify the VERSION2 directive (or the
-Wversion2 flag) when you compile the program. If you are linking the program as a
separate step (rather than allowing the C++ driver to perform the link), you must also
specify the ZCPPCDLL and ZCPP2DLL DLLs on the eld command.
If you are also using Tools.h++ version 6, then you must also migrate to Tools.h++
version 7. Version 7 and version 6.1 of Tools.h++ are significantly different. For
example, the collection class templates were redesigned in version 7 to make the
templates compatible with the Standard C++ Library VERSION2. There are other
significant differences as well. Migrating from Tools.h++ version 6 to Tools.h++ version
7 migration requires extensive source code changes. See the Tools.h++ 7.0 User’s
Guide for details.
Migrating to the C++ Standard Library VERSION3
Regardless of whether you are currently using C++ VERSION1 or VERSION2,
migrating to VERSION3 is recommended. (See the C/C++ Programmer’s Guide for
details on the new features of VERSION3.) However, it is a somewhat more difficult
migration, entailing two steps:
Migrate the C++ library portion of your program to VERSION3 from VERSION1 or
VERSION2.
Change your program so that is does not use Tools.h++.
Migrating from VERSION1 to VERSION3 is relatively simple since VERSION1 is a
subset of VERSION3. The two versions are source-code compatible. The only
differences are in the names of header files. See the C/C++ Programmer’s Guide for
details.
Migrating from VERSION2 to VERSION3 requires more effort, due mainly to changed
definitions of certain class names. You can use the MIGRATION_CHECK pragma as
an aid to migrating from VERSION2 to VERSION3. See the C/C++ Programmer’s
Guide for details.
When migrating to VERSION3 from either VERSION1 or VERSION2, you can omit the
VERSIONn directive (or the -Wversionn flag) when you compile the program because
VERSION3 is the default version. If you are linking the program as a separate step
(rather than allowing the C++ driver to perform the link), you must also specify the
ZCPPCDLL and ZCPP3DLL DLLs on the eld command.
Changing your program so that it does not use Tools.h++ requires additional source
code changes. The changes might be extensive and require a detailed knowledge of
the program. Documentation for these changes is not currently available, but you can
consult the resources described in Section 10, Where to Go for Assistance if you
require assistance.