【发布时间】:2012-07-02 10:49:04
【问题描述】:
可能重复:
Where and why do I have to put the “template” and “typename” keywords?
我写过:
template<class T>
typename list<T>::iterator partition(list<T> &, list<T>::iterator, list<T>::iterator);
但是我的编译器发现了一个错误:
错误:'std::list::iterator' 不是类型
这个函数有什么问题?
【问题讨论】:
-
非常感谢,Xeo!现在我知道了 - 我刚刚忘记了参数中“list...”之前的“typename”字样。
标签: c++ list templates stl iterator