[Solved] Sorting list. What is wrong with my sorting method? [closed]


Your operator is likely wrong.

Try this:

bool Man::operator < (const Man & next){
    if(adress < next.adress) return true;
    if(adress == next.adress) {
       if(name < next.name) return true;
    }
    return false;
}

1

solved Sorting list. What is wrong with my sorting method? [closed]