1. Dashboard
  2. Forum
    1. Unerledigte Themen
  3. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team-Mitglieder
    4. Trophäen
    5. Mitgliedersuche
  4. Tutorial Bereich
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Seiten
  • Forum
  • Lexikon
  • Erweiterte Suche
  1. Informatik Forum
  2. Mitglieder
  3. phyllis

Beiträge von phyllis

  • sorting linked list of objects

    • phyllis
    • 10. April 2006 um 17:15

    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?

  • sorting linked list of objects

    • phyllis
    • 10. April 2006 um 15:01

    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

    Code
    list<code *> tmp_list;

    [FONT=&quot]

    and then I want to sort them so that the code object with the biggest vector<string> files comes first

    [/FONT]

    Code
    tmp_list.sort();

    [FONT=&quot]

    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]

Rechtliches

Impressum

Datenschutzerklärung