tmp/tmp5q1livgm/{from.md → to.md}
RENAMED
|
@@ -1,59 +1,91 @@
|
|
| 1 |
#### `is_heap` <a id="is.heap">[[is.heap]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class RandomAccessIterator>
|
| 5 |
-
bool is_heap(RandomAccessIterator first, RandomAccessIterator last);
|
| 6 |
```
|
| 7 |
|
| 8 |
-
*
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
template<class ExecutionPolicy, class RandomAccessIterator>
|
| 12 |
bool is_heap(ExecutionPolicy&& exec,
|
| 13 |
RandomAccessIterator first, RandomAccessIterator last);
|
| 14 |
```
|
| 15 |
|
| 16 |
-
*
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
``` cpp
|
| 20 |
template<class RandomAccessIterator, class Compare>
|
| 21 |
-
bool is_heap(RandomAccessIterator first, RandomAccessIterator last,
|
|
|
|
| 22 |
```
|
| 23 |
|
| 24 |
-
*
|
|
|
|
| 25 |
|
| 26 |
``` cpp
|
| 27 |
template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
|
| 28 |
bool is_heap(ExecutionPolicy&& exec,
|
| 29 |
-
RandomAccessIterator first, RandomAccessIterator last,
|
|
|
|
| 30 |
```
|
| 31 |
|
| 32 |
-
*
|
| 33 |
|
| 34 |
``` cpp
|
| 35 |
-
is_heap_until(std::forward<ExecutionPolicy>(exec), first, last, comp) == last
|
| 36 |
```
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
``` cpp
|
| 39 |
template<class RandomAccessIterator>
|
| 40 |
-
|
|
|
|
| 41 |
template<class ExecutionPolicy, class RandomAccessIterator>
|
| 42 |
-
RandomAccessIterator
|
|
|
|
| 43 |
RandomAccessIterator first, RandomAccessIterator last);
|
| 44 |
|
| 45 |
template<class RandomAccessIterator, class Compare>
|
| 46 |
-
|
|
|
|
| 47 |
Compare comp);
|
| 48 |
template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
|
| 49 |
-
RandomAccessIterator
|
|
|
|
| 50 |
RandomAccessIterator first, RandomAccessIterator last,
|
| 51 |
Compare comp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
```
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
|
|
|
|
|
|
| 57 |
|
| 58 |
*Complexity:* Linear.
|
| 59 |
|
|
|
|
| 1 |
#### `is_heap` <a id="is.heap">[[is.heap]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class RandomAccessIterator>
|
| 5 |
+
constexpr bool is_heap(RandomAccessIterator first, RandomAccessIterator last);
|
| 6 |
```
|
| 7 |
|
| 8 |
+
*Effects:* Equivalent to: `return is_heap_until(first, last) == last;`
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
template<class ExecutionPolicy, class RandomAccessIterator>
|
| 12 |
bool is_heap(ExecutionPolicy&& exec,
|
| 13 |
RandomAccessIterator first, RandomAccessIterator last);
|
| 14 |
```
|
| 15 |
|
| 16 |
+
*Effects:* Equivalent to:
|
| 17 |
+
|
| 18 |
+
``` cpp
|
| 19 |
+
return is_heap_until(std::forward<ExecutionPolicy>(exec), first, last) == last;
|
| 20 |
+
```
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
template<class RandomAccessIterator, class Compare>
|
| 24 |
+
constexpr bool is_heap(RandomAccessIterator first, RandomAccessIterator last,
|
| 25 |
+
Compare comp);
|
| 26 |
```
|
| 27 |
|
| 28 |
+
*Effects:* Equivalent to:
|
| 29 |
+
`return is_heap_until(first, last, comp) == last;`
|
| 30 |
|
| 31 |
``` cpp
|
| 32 |
template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
|
| 33 |
bool is_heap(ExecutionPolicy&& exec,
|
| 34 |
+
RandomAccessIterator first, RandomAccessIterator last,
|
| 35 |
+
Compare comp);
|
| 36 |
```
|
| 37 |
|
| 38 |
+
*Effects:* Equivalent to:
|
| 39 |
|
| 40 |
``` cpp
|
| 41 |
+
return is_heap_until(std::forward<ExecutionPolicy>(exec), first, last, comp) == last;
|
| 42 |
```
|
| 43 |
|
| 44 |
+
``` cpp
|
| 45 |
+
template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
|
| 46 |
+
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
|
| 47 |
+
constexpr bool ranges::is_heap(I first, S last, Comp comp = {}, Proj proj = {});
|
| 48 |
+
template<random_access_range R, class Proj = identity,
|
| 49 |
+
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
|
| 50 |
+
constexpr bool ranges::is_heap(R&& r, Comp comp = {}, Proj proj = {});
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
*Effects:* Equivalent to:
|
| 54 |
+
`return ranges::is_heap_until(first, last, comp, proj) == last;`
|
| 55 |
+
|
| 56 |
``` cpp
|
| 57 |
template<class RandomAccessIterator>
|
| 58 |
+
constexpr RandomAccessIterator
|
| 59 |
+
is_heap_until(RandomAccessIterator first, RandomAccessIterator last);
|
| 60 |
template<class ExecutionPolicy, class RandomAccessIterator>
|
| 61 |
+
RandomAccessIterator
|
| 62 |
+
is_heap_until(ExecutionPolicy&& exec,
|
| 63 |
RandomAccessIterator first, RandomAccessIterator last);
|
| 64 |
|
| 65 |
template<class RandomAccessIterator, class Compare>
|
| 66 |
+
constexpr RandomAccessIterator
|
| 67 |
+
is_heap_until(RandomAccessIterator first, RandomAccessIterator last,
|
| 68 |
Compare comp);
|
| 69 |
template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
|
| 70 |
+
RandomAccessIterator
|
| 71 |
+
is_heap_until(ExecutionPolicy&& exec,
|
| 72 |
RandomAccessIterator first, RandomAccessIterator last,
|
| 73 |
Compare comp);
|
| 74 |
+
|
| 75 |
+
template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
|
| 76 |
+
indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
|
| 77 |
+
constexpr I ranges::is_heap_until(I first, S last, Comp comp = {}, Proj proj = {});
|
| 78 |
+
template<random_access_range R, class Proj = identity,
|
| 79 |
+
indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
|
| 80 |
+
constexpr borrowed_iterator_t<R>
|
| 81 |
+
ranges::is_heap_until(R&& r, Comp comp = {}, Proj proj = {});
|
| 82 |
```
|
| 83 |
|
| 84 |
+
Let `comp` be `less{}` and `proj` be `identity{}` for the overloads with
|
| 85 |
+
no parameters by those names.
|
| 86 |
+
|
| 87 |
+
*Returns:* The last iterator `i` in \[`first`, `last`\] for which the
|
| 88 |
+
range \[`first`, `i`) is a heap with respect to `comp` and `proj`.
|
| 89 |
|
| 90 |
*Complexity:* Linear.
|
| 91 |
|