title: Why are there two implementations of std::sort (with and without a comparator) rather than one implementation with a default template parameter?
body: <p>In my code I'm adopting a design strategy which is similar to some standard library algorithms in that the exact behavior can be customized by a function object. The simplest example is std::sort, where a function object can control how the comparison is made between objects.</p>
  
  <p>I notice that the Visual C++ provides two implementations of std::sort, which naturally involves code duplication. I would have imagined that it was instead possible to have only one implementation, and provide a default comparator (using operator&lt; ) as a default template parameter.</p>
  
  <p>What is the rational behind two separate versions? Would my suggestion make the interface more complex in some way? Or result in confusing error messages when the object does not provide operator&lt; ? Or maybe it just doesn't work?</p>
  
  <p>Thanks,</p>
  
  <p>David</p>