For example:
private:
Node* curr;
public:
Node*& Iterator::getCurr() {
return curr;
}
bool Iterator::operator==(const Iterator& other) {
return curr == other.getCurr();
}
I'm getting error in this code:
passing ‘const Iterator’ as ‘this’ argument of ‘Node*& Iterator::getCurr()’ discards qualifiers [-fpermissive]
How should I fix it?