ILE C/C++ Programmer's Guide
If you do not want to use either of the ILE C++ automatic instantiation
methods of generating template definitions, you can structure your program in
such a way that you define templates directly in your compilation
units. The advantage of this approach is that modules are smaller and
compile times are shorter than they are when you include template definitions
everywhere.
When you structure your code manually for template instantiation, you avoid
the potential problems that are associated with automatic
instantiation. See Table 30 for a list of potential problems.
Use either or both of the following methods to structure code for single
instantiations:
- Use explicit instantiations to force the compiler to generate the
necessary definitions for all template classes used in other compilation
units. See Explicit Instantiations.
- Use explicit specializations of non-member function templates to force the
compiler to generate them. See WebSphere
Development Studio: ILE C/C++ Language Reference. In the
index, look up "templates", "explicit specializations".
- Note:
- When you use these methods, you must specify the TEMPLATE(*NONE) compiler
option to suppress automatic creation of IFS tempinc directories (or Data
Management TEMPINC files). For more information about ILE
C/C++ compiler options, see WebSphere Development
Studio: ILE C/C++ Compiler Reference.
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.