From Jason Turner

[binary.search]

Diff to HTML by rtfpessoa

tmp/tmpg1060afu/{from.md → to.md} RENAMED
@@ -1,23 +1,26 @@
1
  #### `binary_search` <a id="binary.search">[[binary.search]]</a>
2
 
3
  ``` cpp
4
- template<class ForwardIterator, class T>
5
  constexpr bool
6
  binary_search(ForwardIterator first, ForwardIterator last,
7
  const T& value);
8
 
9
- template<class ForwardIterator, class T, class Compare>
 
10
  constexpr bool
11
  binary_search(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 bool ranges::binary_search(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 bool ranges::binary_search(R&& r, const T& value, Comp comp = {},
22
  Proj proj = {});
23
  ```
@@ -27,11 +30,11 @@ parameters by those names.
27
 
28
  *Preconditions:* The elements `e` of \[`first`, `last`) are partitioned
29
  with respect to the expressions
30
  `bool(invoke(comp, invoke(proj, e), value))` and
31
  `!bool(invoke(comp, value, invoke(proj, e)))`. Also, for all elements
32
- `e` of `[first, last)`, `bool(comp(e, value))` implies
33
  `!bool(comp(value, e))` for the overloads in namespace `std`.
34
 
35
  *Returns:* `true` if and only if for some iterator `i` in the range
36
  \[`first`, `last`),
37
  `!bool(invoke(comp, invoke(proj, *i), value)) && !bool(invoke(comp, value, invoke(proj, *i)))`
 
1
  #### `binary_search` <a id="binary.search">[[binary.search]]</a>
2
 
3
  ``` cpp
4
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type>
5
  constexpr bool
6
  binary_search(ForwardIterator first, ForwardIterator last,
7
  const T& value);
8
 
9
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type,
10
+ class Compare>
11
  constexpr bool
12
  binary_search(ForwardIterator first, ForwardIterator last,
13
  const T& value, Compare comp);
14
 
15
+ template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
16
+ class T = projected_value_t<I, Proj>,
17
  indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
18
  constexpr bool ranges::binary_search(I first, S last, const T& value, Comp comp = {},
19
  Proj proj = {});
20
+ template<forward_range R, class Proj = identity,
21
+ class T = projected_value_t<iterator_t<R>, Proj>,
22
  indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
23
  ranges::less>
24
  constexpr bool ranges::binary_search(R&& r, const T& value, Comp comp = {},
25
  Proj proj = {});
26
  ```
 
30
 
31
  *Preconditions:* The elements `e` of \[`first`, `last`) are partitioned
32
  with respect to the expressions
33
  `bool(invoke(comp, invoke(proj, e), value))` and
34
  `!bool(invoke(comp, value, invoke(proj, e)))`. Also, for all elements
35
+ `e` of \[`first`, `last`), `bool(comp(e, value))` implies
36
  `!bool(comp(value, e))` for the overloads in namespace `std`.
37
 
38
  *Returns:* `true` if and only if for some iterator `i` in the range
39
  \[`first`, `last`),
40
  `!bool(invoke(comp, invoke(proj, *i), value)) && !bool(invoke(comp, value, invoke(proj, *i)))`