algorithms/for-each-examples/greater-and-binary-function.cpp - Possible definitions of the type greater and its base class. | Lecture 6 - slide 23 : 40 Program 3 |
template <class Arg1, class Arg2, class Result> struct binary_function { typedef Arg1 first_argument_type; typedef Arg2 second_argument_type; typedef Result result_type; }; template <class T> struct greater : binary_function <T,T,bool> { bool operator() (const T& x, const T& y) const {return x>y;} };