如何重载如下模板类?
template <class T>
const_iterator& List<T>::const_iterator::operator++()
{
current = current->next;
return *this;
}
template <class T>
const_iterator List<T>::const_iterator::operator++(int)
{
const_iterator old = *this;
++( *this );
return old;
}
我收到如下错误:
List.cpp:17: error: expected constructor, destructor, or type conversion before ‘&’ token
List.cpp:23: error: expected constructor, destructor, or type conversion before ‘List’
List.cpp:30: error: expected constructor, destructor, or type conversion before ‘&’ token
List.cpp:35: error: expected constructor, destructor, or type conversion before ‘List’