Note: IBM supports selected features of
C++11, known as C++0x before its ratification. IBM will continue to develop and
implement the features of this standard. The implementation of the
language level is based on IBM's interpretation of the standard. Until
IBM's implementation of all the C++11 features is complete, including
the support of a new C++11 standard library, the implementation may
change from release to release. IBM makes no attempt to maintain compatibility,
in source, binary, or listings and other compiler interfaces, with
earlier releases of IBM's implementation of the new C++11 features.
Syntactically, an explicit instantiation declaration is
an explicit instantiation definition preceded by the extern keyword,
see Explicit instantiation (C++ only).
Consider the following points when you use the explicit instantiation
declarations feature:
-
An explicit instantiation declaration of a class template
specialization does not cause implicit instantiation of said specialization.
In a translation unit, if a user-defined inline
function is subject to an explicit instantiation declaration and not
subject to an explicit instantiation definition, no out-of-line copy
of the function is generated in that translation unit no matter whether
the compiler option -qkeepinlines is specified
or not.Note: This rule does not limit the behavior for functions that
are implicitly generated by the compiler. Implicitly declared special
members such as the default constructor, copy constructor, destructor
and copy assignment operator are inline and the compiler might instantiate
them. In particular, out-of-line copies might be generated.

- A degradation of the amount of inlining achieved on functions
that are not inline and are subject to explicit instantiation declarations
might occur.
- When a non-pure virtual member function is subject to an explicit
instantiation declaration, either directly or through its class, the
virtual member function must be subject to an explicit instantiation
definition somewhere in the entire program. Otherwise, an unresolved
symbol error might result at link time.
- When implicit instantiation of a class template specialization
is allowed, the user program must be written as if the implicit instantiation
of all virtual member functions of that class specialization occurs.
Otherwise, an unresolved symbol error for a virtual member function
might result at link time.
- When implicit instantiation of a class template specialization
is allowed and the specialization is subject to an explicit instantiation
declaration, the class template specialization must be subject to
an explicit instantiation definition somewhere in the user program.
Otherwise, an unresolved symbol error might result at link time.