I have the following code:
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);
}
Yet when running it, I get this error:
main.cpp|36|error: no matching function for call to ‘std::set<asd, std::less<asd>, std::allocator<asd> >::insert(asd*&)’|
I'm using g++ 4.4.3
Could someone please tell me where I'm going wrong? I've tried to crack this for a good while, but can't seem to find the solution. Thanks