title: different compare signature for std::upper_bound and std::lower_bound
body: <p>Here is a sample example for both <code>std::lower_bound</code> &amp; <code>std::upper_bound</code>, notice the signature of Compare lambda being passed to them -</p>
  
  <pre><code>const auto lower_x = std::lower_bound(
            points.begin(), points.end(), rec.min_corner.x,
  
            [](const RankedPoint &amp;rp, const double x) { return rp.point.x &lt; x; });
  
  const auto upper_x = std::upper_bound(
            points.begin(), points.end(), rec.max_corner.x,
  
            [](const double x, const RankedPoint &amp;rp) { return x &lt; rp.point.x; });
  </code></pre>
  
  <p>What is the possible reasoning behind keeping the signature exact opposite of each other? I wasn't aware of this and gcc compiled (clang didn't) it when I used <code>auto</code> instead of definite types with wrong signatures. Costed me 10 minutes of frustration.</p>