注册 登录
编程论坛 C++教室

模板函数的使用问题?

ichenq 发布于 2008-10-28 15:21, 690 次点击
template <typename T>
class List
{
public:
    class const_iterator;
    class iterator;
   
    iterator  insert(iterator, T);
   
    //
    //and other members
    //
};
//这个外部定义的函数错在哪里?
template <typename T>
List<T>::iterator   List<T>::insert(iterator itr, T item)
{
    //
    //function body
    //
}

问题如上
1 回复
#2
中学者2008-10-28 15:58
template <typename T>
List<T>::iterator   List<T>::insert(List<T>::iterator itr, T item)
{
    //
    //function body
    //
}
1