I have code very similiar to this:
LINT_rep::Iterator::difference_type LINT_rep::Iterator::operator+(const Iterator& right)const
{
return (this + &right);//IN THIS PLACE I'M GETTING AN ERROR
}
LINT_rep::Iterator::difference_type LINT_rep::Iterator::operator-(const Iterator& right)const
{//substracts one iterator from another
return (this - &right);//HERE EVERYTHING IS FINE
}
err msg: Error 1 error C2110: '+' : cannot add two pointers
Why I'm getting an error only in one place and not in both?
See Question&Answers more detail:os