Reduced compiled code size

If you define new C++ class templates in your application, or instantiate new template classes, you can speed up compilation and reduce compiled code size by defining the symbol HIDE_TEMPLATE_DEFINITIONS when you build your project. When HIDE_TEMPLATE_DEFINITIONS is defined, a class template definition is visible only to those libraries that explicitly request it.

The following sections describe the procedures to follow if you define HIDE_TEMPLATE_DEFINITIONS. If your application instantiates new template classes using existing class templates, follow the procedure in "Generating template class instantiations ," next. If you define new class templates, you must also follow the procedure described in "Defining new class templates" on page 73.

Define HIDE_TEMPLATE_DEFINITIONS by setting the ExtraCompileOptions environment variable. If you use the C shell, add this line to your .cshrc file:

    setenv ExtraCompileOptions -DHIDE_TEMPLATE_DEFINITIONS
If you use the Korn or Bourne shell, add this line to your .profile file:

    ExtraCompileOptions=-DHIDE_TEMPLATE_DEFINITIONS; export ExtraCompileOptions
NOTE These procedures are iterative and time-consuming. You should use them only when compilation speed and code size become a problem. These procedures are optional.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker