【发布时间】:2014-09-15 01:53:39
【问题描述】:
将模板参数作为参数的函数的正确语法是什么,即
void myFunction (const Foo::Bar<T>& x)
是吗
template<typename T>
void myFunction (const typename Foo::Bar<T>& x)
另外,我应该使用
template<typename T>
或者
template<class T>
谢谢。
【问题讨论】:
-
见stackoverflow.com/questions/610245/…和stackoverflow.com/questions/213121/…(注意这两个都在右边的相关链接中)