title: Functors vs comparators
body: <p>I know that a functor is a function object, an overloading of () operator in a structure definition.
  Also the use of a functor in an algorithm seems pretty straight forward, just call this routine. </p>
  
  <p>However I am not able to get a sense of comparators. Why are they used in the first place in a template argument.</p>
  
  <p>Can someone please elaborate the difference between the two with a possible implementation of a template in STL like map</p>
  
  <p>Edit :</p>
  
  <p>I am looking for the answers to the following specifically</p>
  
  <ol>
  <li>Why is that there was a need of comparator instead of a function object ( also comparators are more commonly observed in containers ? )</li>
  <li>A possible implementation (non STL, i.e. in C++ code) of where a comparator is passed instead of a function object</li>
  </ol>