I want to define a nested class iterator of the dlist class, thus I coded it as following. I know it is incorrect but I do not know what is the right way...
//template <class T> class dNode;
template <class T>
class dlist{
private:
int size;
//other things
public:
class iterator;//nested class
//other things
}
template <class T> //Problem 1:is this right, that is to say is the
//iterator class a templated class?
class dlist::iterator{
public:
iterator();
func();
}
template <class T>//Problem 2: how can I define the member function of the
//iterator?
dlist<T>::iterator<T>::iterator(){
//codes
}