最近twitterでid:thincaさんが、boost::shared_ptrにくるんだoperator<の定義してあるクラスをstd::setに、そのクラスのoperator<で比較した順序で格納されるようにしたいってツイートしてて、BoostのMLで丁度同じ話題が出てました。 Using boost::shared_ptr with std::set 比較関数オブジェクト作ればいいけど、Boostならもっと短くしてくれるよね?って。 そこで解答として boost/utility/compare_pointees.hpp を使う方法 type数少なめな比較関数の実装を使う方法 Boost.Lambdaを使う方法 の3つが挙げられてました。 Boost.Lambdaを使う方法は #include <iostream> #include <set> #include <boost/lamb