VS2010 で次のコードを実行しました。
#include <iostream>
template<class T> // (a) a base template 
void f( T )
{    std::cout << "(a)" << std::endll;}
template<class T> // (b) a second base template, overloads (a) 
void f( T* )     //     (function templates can't be partially 
{    std::cout << "(b)" << std::endll;}
template<>        // (c) explicit specialization of (b) 
void f<>(int*)
{    std::cout << "(c)" << std::endll;}
int main(int argc, char* argv[])
{
    int *p = new int(10); 
    f( p ); // '(c)'
    return 0;
}
/////////////////
#include <iostream>
template<class T> // (a) same old base template as before 
void f( T )
{    std::cout << "(a)" << std::endll;}
template<>        // (c) explicit specialization, this time of (a)
void f<>(int*)
{    std::cout << "(c)" << std::endll;}
template<class T> // (b) a second base template, overloads (a) 
void f( T* )
{    std::cout << "(b)" << std::endll;}
int main(int argc, char* argv[])
{
    int *p = new int(10); 
    f( p ); // '(b)'
    return 0;
}
出力結果は(c)です。ただし、(c) コードのブロックを (b) の前に移動すると、出力結果は になり(b)ます。関連記事http://www.gotw.ca/publications/mill17.htmを読みました。それでも混乱する。
この場合、コードの順序が重要なのはなぜですか?