Saturday, December 4, 2010

Explicit Instantiation

The following is an example of 'Explicit Instantiation':
    template <typename T> T f(T &a);
    template <> f<int>(int &a);

The second declaration creates an instance of the function with 'int' as the template parameter.

No comments:

Post a Comment