tmp/tmpdowimvxs/{from.md → to.md}
RENAMED
|
@@ -1,24 +1,37 @@
|
|
| 1 |
#### `upper_bound` <a id="upper.bound">[[upper.bound]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class ForwardIterator, class T>
|
| 5 |
-
ForwardIterator
|
| 6 |
upper_bound(ForwardIterator first, ForwardIterator last,
|
| 7 |
const T& value);
|
| 8 |
|
| 9 |
template<class ForwardIterator, class T, class Compare>
|
| 10 |
-
ForwardIterator
|
| 11 |
upper_bound(ForwardIterator first, ForwardIterator last,
|
| 12 |
const T& value, Compare comp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
```
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
*Returns:* The furthermost iterator `i` in the range \[`first`, `last`\]
|
| 19 |
-
such that for every iterator `j` in the range \[`first`, `i`)
|
| 20 |
-
|
| 21 |
-
`comp(value, *j) == false`.
|
| 22 |
|
| 23 |
-
*Complexity:* At most log₂(`last - first`) + 𝑂(1) comparisons
|
|
|
|
| 24 |
|
|
|
|
| 1 |
#### `upper_bound` <a id="upper.bound">[[upper.bound]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class ForwardIterator, class T>
|
| 5 |
+
constexpr ForwardIterator
|
| 6 |
upper_bound(ForwardIterator first, ForwardIterator last,
|
| 7 |
const T& value);
|
| 8 |
|
| 9 |
template<class ForwardIterator, class T, class Compare>
|
| 10 |
+
constexpr ForwardIterator
|
| 11 |
upper_bound(ForwardIterator first, ForwardIterator last,
|
| 12 |
const T& value, Compare comp);
|
| 13 |
+
|
| 14 |
+
template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
|
| 15 |
+
indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
|
| 16 |
+
constexpr I ranges::upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {});
|
| 17 |
+
template<forward_range R, class T, class Proj = identity,
|
| 18 |
+
indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
|
| 19 |
+
ranges::less>
|
| 20 |
+
constexpr borrowed_iterator_t<R>
|
| 21 |
+
ranges::upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {});
|
| 22 |
```
|
| 23 |
|
| 24 |
+
Let `comp` be `less{}` and `proj` be `identity{}` for overloads with no
|
| 25 |
+
parameters by those names.
|
| 26 |
+
|
| 27 |
+
*Preconditions:* The elements `e` of \[`first`, `last`) are partitioned
|
| 28 |
+
with respect to the expression
|
| 29 |
+
`!bool(invoke(comp, value, invoke(proj, e)))`.
|
| 30 |
|
| 31 |
*Returns:* The furthermost iterator `i` in the range \[`first`, `last`\]
|
| 32 |
+
such that for every iterator `j` in the range \[`first`, `i`),
|
| 33 |
+
`!bool(invoke(comp, value, invoke(proj, *j)))` is `true`.
|
|
|
|
| 34 |
|
| 35 |
+
*Complexity:* At most log₂(`last - first`) + 𝑂(1) comparisons and
|
| 36 |
+
projections.
|
| 37 |
|