说我有两个模板类
template < class T >
class Foo
{
/**/
};
和
template < class T >
class Bar
{
/**/
};
我该如何用
Foo
来专门化Bar<T>
?语法是什么?
是吗
template<>
template<class T>
class Foo<Bar<T>>
{ /**/ };
要么
template<class T>
class Foo<Bar<T>>
{ /**/ };
或任何其他语法?
最佳答案
语法是最后一个:
template<class T>
class Foo<Bar<T>>
{
/* Your implementation of this partial specialization. */
};