c++函数对象
程序代码:
#include <iostream> using namespace std; #include <map> #include <string> template <typename T> class MyGreater { public: bool operator()(T& left,T& right) { return left > right; } }; int main(int argc, char *argv[]) { map<int, string, MyGreater<int> > maptest; maptest.insert(pair<int,string>(1,"aaa")); return 0; }
问一下那个函数对象怎么使用不了呢?