I have a problem I hope somebody kan help me with. I have a number of objects of type
Code
class code
{
public:
string file;
vector<string> files;
int start, size;
code(){}
~code(){}
bool operator< (const code *a) { return this->files.size() >= a->files.size(); };
};
Alles anzeigen
that I want to put in a STL-list
[FONT="]
and then I want to sort them so that the code object with the biggest vector<string> files comes first
[/FONT]
[FONT="]
But this doesn't work!? Instead I get a list sorted after int start... Can somebody see what I am doing wrong here? Or is the problem somewhere else in my program?
[/FONT]