tmp/tmp4bj04zad/{from.md → to.md}
RENAMED
|
@@ -1,19 +1,37 @@
|
|
| 1 |
#### `make_heap` <a id="make.heap">[[make.heap]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class RandomAccessIterator>
|
| 5 |
-
void make_heap(RandomAccessIterator first, RandomAccessIterator last);
|
| 6 |
|
| 7 |
template<class RandomAccessIterator, class Compare>
|
| 8 |
-
void make_heap(RandomAccessIterator first, RandomAccessIterator last,
|
| 9 |
Compare comp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
```
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
requirements (Table [[tab:moveassignable]]).
|
| 15 |
|
| 16 |
-
*
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
|
|
|
| 1 |
#### `make_heap` <a id="make.heap">[[make.heap]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class RandomAccessIterator>
|
| 5 |
+
constexpr void make_heap(RandomAccessIterator first, RandomAccessIterator last);
|
| 6 |
|
| 7 |
template<class RandomAccessIterator, class Compare>
|
| 8 |
+
constexpr void make_heap(RandomAccessIterator first, RandomAccessIterator last,
|
| 9 |
Compare comp);
|
| 10 |
+
|
| 11 |
+
template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
|
| 12 |
+
class Proj = identity>
|
| 13 |
+
requires sortable<I, Comp, Proj>
|
| 14 |
+
constexpr I
|
| 15 |
+
ranges::make_heap(I first, S last, Comp comp = {}, Proj proj = {});
|
| 16 |
+
template<random_access_range R, class Comp = ranges::less, class Proj = identity>
|
| 17 |
+
requires sortable<iterator_t<R>, Comp, Proj>
|
| 18 |
+
constexpr borrowed_iterator_t<R>
|
| 19 |
+
ranges::make_heap(R&& r, Comp comp = {}, Proj proj = {});
|
| 20 |
```
|
| 21 |
|
| 22 |
+
Let `comp` be `less{}` and `proj` be `identity{}` for the overloads with
|
| 23 |
+
no parameters by those names.
|
|
|
|
| 24 |
|
| 25 |
+
*Preconditions:* For the overloads in namespace `std`, the type of
|
| 26 |
+
`*first` meets the *Cpp17MoveConstructible*
|
| 27 |
+
([[cpp17.moveconstructible]]) and *Cpp17MoveAssignable*
|
| 28 |
+
([[cpp17.moveassignable]]) requirements.
|
| 29 |
|
| 30 |
+
*Effects:* Constructs a heap with respect to `comp` and `proj` out of
|
| 31 |
+
the range \[`first`, `last`).
|
| 32 |
+
|
| 33 |
+
*Returns:* `last` for the overloads in namespace `ranges`.
|
| 34 |
+
|
| 35 |
+
*Complexity:* At most 3(`last - first`) comparisons and twice as many
|
| 36 |
+
projections.
|
| 37 |
|