#include #include #include //for strcmp using namespace std; template class greater { public: bool operator()(const T& a, const T& b) const {return a > b;} }; template <> class greater { public: bool operator()(const char *a, const char *b) const { return strcmp(a, b) > 0; } }; template <> class greater { public: bool operator()(const char *a, const char *b) const { return strcmp(a, b) > 0; } }; int main() { greater g1; //cout << g1.operator()(10, 20) << "\n"; cout << g1(10, 20) << "\n"; greater g2; //cout << g2.operator()("hello", "goodbye") << "\n"; cout << g2("hello", "goodbye") << "\n"; greater g3; //cout << g3.operator()("hello", "goodbye") << "\n"; cout << g3("hello", "goodbye") << "\n"; return EXIT_SUCCESS; }