Beginning with version 5.5 of Sun’s C++ compiler, instances go into special address sections, and the linker recognizes and discards duplicates. You can instruct the compiler to use one of five instance placement and linkage methods: external, static, global, explicit, and semi-explicit.
External instances are suitable for most program development and perform best when the following is true:
The set of instances in the program is small, but each compilation unit references a large subset of the instances.
There are few instances referenced in more than one or two compilation units.
Global instances, the default, are suitable for all development, and perform best when objects reference a variety of instances.
Explicit instances are suitable for some carefully controlled application compilation environments.
Semi-explicit instances require slightly less controlled compilation environments but produce larger object files and have restricted uses.
This section discusses the five instance placement and linkage methods. Additional information about generating instances can be found in 6.3 Template Instantiation.