the iterator of a list class

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...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//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
}

any help would be greatly appreciated~
Topic archived. No new replies allowed.