Explicit Instantiation of Class Templates Sample

Description

The explicit instantiation mechanism allows the user to control where instantiation of templates will be done. Classes, member functions, and template functions can all be explicitly instantiated on request, using a notation such as:

	template class vector<int>;
to instantiate the class vector<int> and all its members.

Whether explicit instantiation is useful in a given context depends a lot on underlying environment mechanisms for supporting templates.

Concept

The example program defines a template A, and then instantiates the classes vector<int> and A<double>, the member A<short>::f(int), and the function f(long).

Supported
Supported
Supported