寻找这种模板特化的正式名称和链接类型,我们特化一个模板只是为了特化类模板中单个方法的实现。
template <class T>
class Foo
{
public:
void f()
{
// default method implementation
}
};
// What is the default linkage of this function (I'm guessing
// external based on basic function template specializations),
// and what am I doing called? (method specialization of a class
// template?)
template <>
void Foo<int>::f()
{
// method implementation for Foo<int>
}