重複の可能性:
複数のテンプレート引数エラーを伴うテンプレートの部分的な特殊化
eテンプレートクラスを機能レベルとして特化することは可能ですか?
達成したいことの例を示しますが、コンパイルエラーが発生します。
template<typename T1, typename T2>
class C
{
public:
void f();
};
template<typename T1, typename T2>
void C<T1, T2>::f()
{
}
template<typename T1, int>
void C<T1, int>::f()
{
}
エラー:
template argument list following class template name must list parameters in the order used in template parameter list
'void C<T1,T2>::f(void)' : function template has already been defined
'C<T1,T2>': template parameter 'T2' is incompatible with the declaration