From Jason Turner

[pop.heap]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmptlc74pb3/{from.md → to.md} +27 -10
tmp/tmptlc74pb3/{from.md → to.md} RENAMED
@@ -1,23 +1,40 @@
1
  #### `pop_heap` <a id="pop.heap">[[pop.heap]]</a>
2
 
3
  ``` cpp
4
  template<class RandomAccessIterator>
5
- void pop_heap(RandomAccessIterator first, RandomAccessIterator last);
6
 
7
  template<class RandomAccessIterator, class Compare>
8
- void pop_heap(RandomAccessIterator first, RandomAccessIterator last,
9
  Compare comp);
 
 
 
 
 
 
 
 
 
 
10
  ```
11
 
12
- *Requires:* The range \[`first`, `last`) shall be a valid non-empty
13
- heap. `RandomAccessIterator` shall satisfy the requirements of
14
- `ValueSwappable` ([[swappable.requirements]]). The type of `*first`
15
- shall satisfy the requirements of `MoveConstructible`
16
- (Table  [[tab:moveconstructible]]) and of `MoveAssignable`
17
- (Table  [[tab:moveassignable]]).
 
 
 
18
 
19
  *Effects:* Swaps the value in the location `first` with the value in the
20
- location `last - 1` and makes \[`first`, `last - 1`) into a heap.
 
21
 
22
- *Complexity:* At most 2 log(`last - first`) comparisons.
 
 
 
23
 
 
1
  #### `pop_heap` <a id="pop.heap">[[pop.heap]]</a>
2
 
3
  ``` cpp
4
  template<class RandomAccessIterator>
5
+ constexpr void pop_heap(RandomAccessIterator first, RandomAccessIterator last);
6
 
7
  template<class RandomAccessIterator, class Compare>
8
+ constexpr void pop_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::pop_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::pop_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:* The range \[`first`, `last`) is a valid non-empty heap
26
+ with respect to `comp` and `proj`. For the overloads in namespace `std`,
27
+ `RandomAccessIterator` meets the *Cpp17ValueSwappable*
28
+ requirements [[swappable.requirements]] and the type of `*first` meets
29
+ the *Cpp17MoveConstructible* ([[cpp17.moveconstructible]]) and
30
+ *Cpp17MoveAssignable* ([[cpp17.moveassignable]]) requirements.
31
 
32
  *Effects:* Swaps the value in the location `first` with the value in the
33
+ location `last - 1` and makes \[`first`, `last - 1`) into a heap with
34
+ respect to `comp` and `proj`.
35
 
36
+ *Returns:* `last` for the overloads in namespace `ranges`.
37
+
38
+ *Complexity:* At most 2 log(`last - first`) comparisons and twice as
39
+ many projections.
40