Technical data

Cray Standard C++ Template Instantiation [6]
Automatic instantiation can coexist with partial explicit control of
instantiation by the programmer through the use of #pragma directives or
the -h instantiate=mode option.
Automatic instantiation mode can be disabled by issuing the
-h noautoinstantiate command line option. If automatic instantiation is
disabled, the information about template entities that could be instantiated in a
file is not included in the object file.
6.2 Instantiation Modes
Normally, during compilation of a source file, no template entities are
instantiated (except those assigned to the file by automatic instantiation).
The overall instantiation mode can, however, be changed by issuing the
-h instantiate=mode command line option. The mode argument can be
specified as follows:
m
ode Description
none Do not automatically create instantiations of any template entities.
This is the most appropriate mode when automatic instantiation is
enabled. This is the default instantiation mode.
used Instantiate those template entities that were used in the
compilation. This includes all static data members that have
template definitions.
all Instantiate all template entities declared or referenced in the
compilation unit. For each fully instantiated template class, all of
its member functions and static data members are instantiated,
regardless of whether they were used. Nonmember template
functions are instantiated even if the only reference was a
declaration.
local Similar to used mode, except that the functions are given internal
linkage. This mode provides a simple mechanism for those who
are not familiar with templates. The compiler instantiates the
functions used in each compilation unit as local functions, and
the program links and runs correctly (barring problems due to
multiple copies of local static variables). This mode may generate
multiple copies of the instantiated functions and is not suitable
for production use. This mode cannot be used in conjunction
with automatic template instantiation. Automatic instantiation is
disabled by this mode.
S217936 113