From Jason Turner

[lower.bound]

Diff to HTML by rtfpessoa

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