2007-08-02から1日間の記事一覧

降順のソート

C++

どこかで読んだ気がするのですが こうするより #include <algorithm> #include <functional> std::sort(v.begin(), v.end(), std::greater<Type>()); こうした方がいいんじゃないかと #include <algorithm> std::sort(v.rbegin(), v.rend()); 最近は後者を好んで使用しています</algorithm></type></functional></algorithm>