You can override the definition of a class template of a
particular template class by providing a class definition for the
type of class required. For example, the following class template
creates a class for each type for which it is referenced, but
that class may be inappropriate for a particular type:
template<class M> class portfolio { double capital; M arr; // ... } ;
The type for which the template class is inappropriate can be
defined by using the applicable template class name. Assuming the
inappropriately defined type is stocks, you can redefine the
class portfolio<stocks > as follows:
class portfolio<stocks> { double capital; stocks yield; // ... };
An explicit specialization of a template class can be defined before the class template is declared. In particular, a template class such as portfolio<stocks> can be defined before its class template has been defined.
Class Template Declarations and
Definitions
Nontype Template Arguments
Function Templates
Differences between Class and Function
Templates