/////////////////////////////////////////////////////////////// // functor.cpp - demonstrate the behavior of functor object // // // // Jim Fawcett, CSE687, 4/4/2000 // /////////////////////////////////////////////////////////////// #include #include using namespace std; // binary predicate functor equivalent to less // - Uses std::string comparison to return true if first // argument is less than second. template class increase { public: bool operator()(const T &t1, const T &t2) { return (t1 myIncrease; if(myIncrease("aaaa","zzzz") == true) cout << "\n \"aaaa\" is less than \"zzzz\""; else cout << "\n \"aaaa\" is more than \"zzzz\""; cout << "\n\n"; }