title: Getting error when using comparator with upper_bound?
body: <p>When I run &quot;upper_bound&quot; with a comparator it gives me this error: error: reference to type 'const std::vector&lt;int, std::allocator&gt;' could not bind to an lvalue of type 'const int. Anyone know the issue?</p>
  <pre><code>static bool compareInterval(const vector&lt;int&gt;&amp; a, const vector&lt;int&gt;&amp; b) {
      return (a[0] &lt; b[0]);
  }
  
  vector&lt;int&gt; corpFlightBookings(vector&lt;vector&lt;int&gt;&gt;&amp; bookings, int n) {
      vector&lt;int&gt; ret(n, 0);
      sort(bookings.begin(), bookings.end(), compareInterval);
      
      for (int i = 0; i &lt; n; ++i) {
          auto low=upper_bound(bookings.begin(), bookings.end(), i, compareInterval);
      }
      return ret;
  }
  </code></pre>
  <blockquote>
  <p>In file included from prog_joined.cpp:1: In file included from
  ./precompiled/headers.h:13: In file included from
  /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/cmath:1927:
  In file included from
  /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/specfun.h:45:
  In file included from
  /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_algobase.h:71:
  /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/predefined_ops.h:215:24:
  error: reference to type 'const std::vector&lt;int, std::allocator&gt;'
  could not bind to an lvalue of type 'const int'
  { return bool(_M_comp(__val, <em>__it)); }
  ^~~~~ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_algo.h:2051:8:
  note: in instantiation of function template specialization
  '__gnu_cxx::__ops::_Val_comp_iter&lt;bool (</em>)(const std::vector&lt;int,
  std::allocator&gt; &amp;, const std::vector&lt;int, std::allocator&gt;
  &amp;)&gt;::operator()&lt;const int,
  __gnu_cxx::__normal_iterator&lt;std::vector&lt;int, std::allocator&gt; *, std::vector&lt;std::vector&lt;int, std::allocator&gt;,
  std::allocator&lt;std::vector&lt;int, std::allocator&gt;&gt;&gt;&gt;&gt;' requested
  here
  if (__comp(__val, __middle))
  ^ /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/stl_algo.h:2116:19:
  note: in instantiation of function template specialization
  'std::__upper_bound&lt;__gnu_cxx::__normal_iterator&lt;std::vector&lt;int,
  std::allocator&gt; <em>, std::vector&lt;std::vector&lt;int,
  std::allocator&gt;, std::allocator&lt;std::vector&lt;int,
  std::allocator&gt;&gt;&gt;&gt;, int, __gnu_cxx::__ops::_Val_comp_iter&lt;bool
  (</em>)(const std::vector&lt;int, std::allocator&gt; &amp;, const
  std::vector&lt;int, std::allocator&gt; &amp;)&gt;&gt;' requested here
  return std::__upper_bound(__first, __last, __val,
  ^ Line 12: Char 22: note: in instantiation of function template specialization
  'std::upper_bound&lt;__gnu_cxx::__normal_iterator&lt;std::vector&lt;int,
  std::allocator&gt; <em>, std::vector&lt;std::vector&lt;int,
  std::allocator&gt;, std::allocator&lt;std::vector&lt;int,
  std::allocator&gt;&gt;&gt;&gt;, int, bool (</em>)(const std::vector&lt;int,
  std::allocator&gt; &amp;, const std::vector&lt;int, std::allocator&gt;
  &amp;)&gt;' requested here
  auto low=upper_bound(bookings.begin(), bookings.end(), i, compareInterval);
  ^ 1 error generated.</p>
  </blockquote>