thanks for answering. I was guessing it had something to do with this...
but what if I want to use a list of pointers, is there no way to sort the list then?
Beiträge von phyllis
-
-
I have a problem I hope somebody kan help me with. I have a number of objects of type
Code
Alles anzeigenclass code { public: string file; vector<string> files; int start, size; code(){} ~code(){} bool operator< (const code *a) { return this->files.size() >= a->files.size(); }; };
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]