Instantiation via the command line
Another way of manually controlling instantiation is via the -T
option to CC.
The suboptions you can use to do this are:
-
none - do not do any instantiation.
-
used - instantiate those template entities used in the
compilation.
This includes all static data members for which there are definitions.
-
all - instantiate all template entities declared or
referenced in the compilation unit.
For each instantiated template class, this includes all its member
functions and static data members, whether or not they are used.
Non-member function templates will be instantiated even if the only
reference was a declaration.
-
local - like used except that all the instantiated
functions are given internal linkage.
This will prevent name collisions between object files, at the expense
of possibly generating many copies of instantiated functions across a
set of source files, which may make this option unsuitable for production use.
These options to CC might typically be used with dummy source
files that include the headers that describe the templates and their
argument types and that make dummy references to the template classes
used by the rest of the application.
These source files would be compiled using the various options
mentioned above and the resulting objects linked with the application.
Next topic:
Single files
Previous topic:
Pragma interface
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004