1
是否明確的專業化語法
template <typename T>
void foo(T) {}
template <>
void foo(int) {}
明確的專業化或函數重載,並明確初始化編譯想看看下面的代碼?
template <typename T>
void foo(T) {}
template <>
void foo<int>(int) {}
我認爲標準的同時接受這些:
ISO/IEC 14882:2011
14.7.3 Explicit specialization [temp.expl.spec] 1 ... can be declared by a declaration introduced by template<>; that is: explicit-specialization: template < > declaration