title: C++ "greater" function object definition
body: <pre><code>template &lt;class T&gt; struct greater : binary_function &lt;T, T, bool&gt; {
      bool operator() (const T&amp; x, const T&amp; y) const {
          return x &gt; y;
      }
  };
  </code></pre>
  
  <p>I found this definition of "Function object class for greater-than inequality comparison" in STL library.
  Can somebody please explain to me how this code works and compiles?</p>