Thanks 7stud
I understood everything but how about if I have a friend iterator class in my template class, I mean when I convert my class to a template class, do I have to change my iterator friend function?
for example; if I have my own stack class and It has a friend iterator class and I want to convert it to a template class, do I need to change iterator class too?
Code:
template <typename T>
class Stack{
friend class iterator;
private:
.....
......
public:
//************************begin class iterator**************************
class iterator {
friend class Stack;
private:
.....
.....
public:
.....
.....
};
//************************end class iterator**************************
private:
.....
.....
public:
....
.....
};