>>581
> うおー!! なんでlistにはstableなsortがないんだー!!

STL以前に基本がなってないと思われ。

#include <list>
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>

using namespace std;

struct Person {
string name_;
int age_;
Person(string name, int age) : name_(name), age_(age) {}
bool operator<(const Person &other) {
return age_ == other.age_ ? name_ < other.name_ : age_ < other.age_;}
void out() {cout << name_ << ": " << age_ << endl;}
};

int main() {
list<Person> group;
group.push_back(Person("mona3", 3));
group.push_back(Person("mona0", 3));
group.push_back(Person("mona1", 15));
group.push_back(Person("mona2", 3));
for_each(group.begin(), group.end(), mem_fun_ref(&Person::out));
group.sort();
cout << "sorted." << endl;
for_each(group.begin(), group.end(), mem_fun_ref(&Person::out));
}