Saturday, December 4, 2010

Template typename

The following are functionally equivalent:
    template <typename T> T f(T &a);
    template <class T> T f(T &a);

'typename' was added to the standard to make the declarations less confusing. 'typename' is the preferred keyword to use.

No comments:

Post a Comment