编译器错误 C2908

显式专用化;已实例化“template”

主模板的专用化发生在显式专用化之前。

以下示例生成 C2908:

// C2908.cpp
// compile with: /c
template<class T> class X {};

void f() {
X<int> x;   //specialization and instantiation
            //of X<int>
}

template<> class X<int> {}  // C2908, explicit specialization