00001 #ifndef CPM_FUNCTIONAL_HPP_
00002 #define CPM_FUNCTIONAL_HPP_
00003
00004 #include <functional>
00005 #include <utility>
00006
00007 namespace CPM {
00008 using namespace std;
00009
00011 struct second_less: public binary_function<pair<int, double>, pair<int, double>, bool> {
00012 bool operator()(const pair<int, double>& x, const pair<int, double>& y) const {
00013 return x.second < y.second;
00014 }
00015 };
00016
00018 struct second_greater: public binary_function<pair<int, double>, pair<int, double>, bool> {
00019 bool operator()(const pair<int, double>& x, const pair<int, double>& y) const {
00020 return x.second > y.second;
00021 }
00022 };
00023 }
00024
00025 #endif