| United States-English |
|
|
|
![]() |
HP-UX Systems: HP aC++ Release Notes > Chapter 1 HP
aC++ Release NotesNew Features in Version A.03.27 |
|
New features in HP aC++ version A.03.27 are listed below. The Rogue Wave Standard C++ Library 2.2.1 (libstd_v2) is now bundled with HP aC++. This library includes the standard iostream library and has namespace std enabled. To use the new library, you must specify the -AA command line option. Note the following:
The following example shows a common problem when using the -AA option. The result of using the new overloads of strchr (on a const char*) is now a const char*. Error 440 results if “p” is not declared as a const char*.
The following topics discuss changes when transitioning from the prior version to the new Standard C++ library: Since the new Standard C++ Library (libstd_v2) includes the new iostream library and has namespace std enabled, significant changes may be required in your source code. For example, the following program will no longer compile:
Because both cout and endl are now in namespace std, they must be referenced as std::cout and std::endl. Alternatively, using declarations or using directives can be added to your code to make them visible outside of the namespace std scope. The following is correct:
To help with code transition to the new C++ standard, an iostream_compat directory is provided. It contains some header files that are just wrappers. You can include files in the iostream_compat directory even when specifying the -AA option, to make symbols like cout visible in global scope. For example, <iostream.h> is in iostream_compat, and it includes the new <iostream> header followed by a using directive (using namespace std). So the following program will also compile, with warning 890:
To turn off the warning, specify the +W890 command line option.
As with prior compiler releases, one version of libstd_v2 is provided for use with both threaded and non-threaded code. To compile threaded applications, macro -D_RWSTD_MULTI_THREAD must be used. -D_THREAD_SAFE is no longer needed. See HP aC++ Online Programmer’s Guide for more information. In the edit-compile-link-debug development cycle, link time is a significant component. With incremental linking, any unchanged object files can be reused without being reprocessed. Incremental linking allows you to insert object code into an output file (executable or shared library) that you created earlier, without relinking any unmodified object files. Time required to relink after the initial incremental link depends on the number of modules you modify. To use incremental linking, specify the +ild option on the aCC command line. If the output file does not already exist or if it was created without the +ild option, the linker performs an initial incremental link. The output file produced is suitable for subsequent incremental links. The +ild option is valid in 64-bit mode for both executable and shared library links. The +ild option is not valid for relocatable links, options (or tools) that strip the output module, and with some optimization options. In certain situations (for example, when internal padding space is exhausted), the incremental linker must perform an initial incremental link. You can avoid such unexpected initial incremental links by periodically rebuilding the output file with the +ildrelink option. You can debug the resulting executable or shared library produced by the incremental linker using the WDB debugger with incremental-linking support. See Online Linker and Libraries User’s Guide (ld +help) and ld(1) manpage for more information. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||