// A partial specialization of (a) for pointer types template<typename T> classX<T*> { /*...*/ };
// A full specialization of (a) for int template<> classX<int> { /*...*/ };
// A separate base template that overloads (b) and (c) // -- NOT a partial specialization of (b), because // there's no such thing as a partial specialization // of a function template! template<typename T> voidf( T* ); // (d)
// A full specialization of (b) for int template<> void f<int>( int ); // (e)
// A plain old function that happens to overload with // (b), (c), and (d) -- but not (e), which we'll // discuss in a moment voidf( double ); // (f)
f( b ); // calls (b) with T = bool f( i, 42, d ); // calls (c) with T = int f( &i ); // calls (d) with T = int f( i ); // calls (e) f( d ); // calls (f)
template<classT>// (a) a base template voidf( T );
template<classT>// (b) a second base template, overloads (a) voidf( T* ); // (function templates can't be partially // specialized; they overload instead)
template<> // (c) explicit specialization of (b) void f<>(int*);