#include <list>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <iostream>

template<typename T>
struct Dereference : std::unary_function<T &, T *> {
T *operator () (T &t) const { return &t; }
};

template<typename T>
こういうことじゃなくて?

struct ConstReference : std::unary_function<const T *, T> {
T operator () (const T *p) const { return *p; }
};

template<typename T>
struct DereferenceLess : std::binary_function<const T *, const T *, bool> {
bool operator () (const T *p1, const T *p2) const { return *p1 < *p2; }
};

class Person {
std::string name_;
int age_;
public:
Person(std::string name, int age) : name_(name), age_(age) {}
friend bool operator<(const Person &a, const Person &b) {
return a.age_ == b.age_ ? a.name_ < b.name_ : a.age_ < b.age_;
}
friend std::ostream &operator << (std::ostream &os, const Person &p) {
return os << p.name_ << ": " << p.age_ << std::endl;
}
};

int main()
{
std::list<Person> l;
std::vector<Person *> v;

l.push_back(Person("mona3", 3));
l.push_back(Person("mona0", 5));
l.push_back(Person("mona1", 15));
l.push_back(Person("mona2", 2));

v.reserve(l.size());
std::transform(l.begin(), l.end(), std::back_inserter(v), Dereference<Person>());
std::stable_sort(v.begin(), v.end(), DereferenceLess<Person>());
std::transform(v.begin(), v.end(), std::ostream_iterator<Person>(std::cout), ConstReference<Person>());

return 0;
}