Saturday, December 4, 2010

Explicit Specialization

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

In this case, you are saying how you want the function to behave when T is int.

No comments:

Post a Comment