私は次のコードを持っています:
class asd {
public:
int b;
asd() { b = rand() % 10; }
bool operator<(asd &other) { return b < other.b; }
};
int main() {
asd * c; c = new asd();
set <asd> uaua;
uaua.insert(c);
}
しかし、それを実行すると、次のエラーが発生します。
main.cpp|36|error: no matching function for call to ‘std::set<asd, std::less<asd>, std::allocator<asd> >::insert(asd*&)’|
g++4.4.3を使用しています
誰かが私がどこで間違っているのか教えてもらえますか?私はしばらくの間これをクラックしようとしましたが、解決策を見つけることができないようです。ありがとう