3

例えば:

private:
    Node* curr;
public:
    Node*& Iterator::getCurr() {
        return curr;
    }

    bool Iterator::operator==(const Iterator& other) {
        return curr == other.getCurr();
    }

このコードでエラーが発生します:

「Node*& Iterator::getCurr()」の「this」引数として「const Iterator」を渡すと、修飾子が破棄されます [-fpermissive]

どうすれば直せますか?

4

3 に答える 3