#include <iostream>
#include <set>
using namespace std;
class StudentT {
public:
    int id;
    string name;
public:
    StudentT(int _id, string _name) : id(_id), name(_name) {
    }
    int getId() {
        return id;
    }
    string getName() {
        return name;
    }
};
inline bool operator< (StudentT s1, StudentT s2) {
    return  s1.getId() < s2.getId();
}
int main() {
    set<StudentT> st;
    StudentT s1(0, "Tom");
    StudentT s2(1, "Tim");
    st.insert(s1);
    st.insert(s2);
    set<StudentT> :: iterator itr;
    for (itr = st.begin(); itr != st.end(); itr++) {
        cout << itr->getId() << " " << itr->getName() << endl;
    }
    return 0;
}列をなして:
cout << itr->getId() << " " << itr->getName() << endl;次のエラーが発生します。
../main.cpp:35:エラー:「const StudentT」を「int StudentT :: getId()」の「this」引数として渡すと、修飾子が破棄されます
../main.cpp:35:エラー: 'std :: string StudentT :: getName()'の 'this'引数として 'const StudentT'を渡すと修飾子が破棄されます
このコードの何が問題になっていますか?ありがとうございました!
volatile
                