ILE C/C++ Programmer's Guide
The template registry:
- Maintains a repository of all template instantiations in a program or
service program
- Tracks all references to template instantiations
- Ensures that only one definition is provided to the linker
The template registry designates a single module to contain the definition
of a template instantiation.
- If a module that formerly contained a template instantiation is
recompiled, the compiler will check to make sure that instantiation is still
present.
- If there is a dependency on the template instantiation in another
module and that definition has been removed, the compiler issues a warning
that dependent modules will need to be recompiled to regenerate the missing
instantiation. If the dependent modules are not recompiled, the link
fails with errors saying that there are missing definitions.
During initial compilation, any template definitions or instantiations that
are encountered are expanded and the template registry is updated with the
location of the expansion in the module. If a template instantiation is
required during subsequent compilations, the compiler checks the template
registry to see if an instance already exists in another module. If so,
it does not create a new instantiation, but does create a new
reference. This ensures that only one definition is provided during the
linking phase.
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.