I\'m trying to create an iterator class as a member-class for a list class, and am trying to overload the indirection operator (*) to access the list it\'s pointing to:
You overloaded the multiply operator. Take the parameter out to make it an indirection operator.
template
T list::iterator::operator*()
{
return ((this->lstptr)->current)->data;
}
You should also have it return a reference if you want code like *IT = 3;
to compile.
template
T& list::iterator::operator*()
{
return ((this->lstptr)->current)->data;
}