tmp/tmpzxvhliu0/{from.md → to.md}
RENAMED
|
@@ -10,40 +10,46 @@ void* bsearch(const void* key, const void* base, size_t nmemb, size_t size,
|
|
| 10 |
compare-pred* compar);
|
| 11 |
void qsort(void* base, size_t nmemb, size_t size, c-compare-pred* compar);
|
| 12 |
void qsort(void* base, size_t nmemb, size_t size, compare-pred* compar);
|
| 13 |
```
|
| 14 |
|
|
|
|
|
|
|
|
|
|
| 15 |
*Effects:* These functions have the semantics specified in the C
|
| 16 |
standard library.
|
| 17 |
|
| 18 |
-
*Preconditions:* The objects in the array pointed to by `base` are of
|
| 19 |
-
trivial type.
|
| 20 |
-
|
| 21 |
*Throws:* Any exception thrown by `compar`
|
| 22 |
[[res.on.exception.handling]].
|
| 23 |
|
| 24 |
-
ISO C 7.22.5
|
| 25 |
|
| 26 |
<!-- Link reference definitions -->
|
| 27 |
[accumulate]: #accumulate
|
| 28 |
[adjacent.difference]: #adjacent.difference
|
| 29 |
[alg.adjacent.find]: #alg.adjacent.find
|
| 30 |
[alg.all.of]: #alg.all.of
|
| 31 |
[alg.any.of]: #alg.any.of
|
| 32 |
[alg.binary.search]: #alg.binary.search
|
|
|
|
| 33 |
[alg.c.library]: #alg.c.library
|
| 34 |
[alg.clamp]: #alg.clamp
|
|
|
|
| 35 |
[alg.copy]: #alg.copy
|
| 36 |
[alg.count]: #alg.count
|
|
|
|
| 37 |
[alg.equal]: #alg.equal
|
| 38 |
[alg.fill]: #alg.fill
|
| 39 |
[alg.find]: #alg.find
|
| 40 |
[alg.find.end]: #alg.find.end
|
| 41 |
[alg.find.first.of]: #alg.find.first.of
|
|
|
|
|
|
|
| 42 |
[alg.foreach]: #alg.foreach
|
| 43 |
[alg.generate]: #alg.generate
|
| 44 |
[alg.heap.operations]: #alg.heap.operations
|
|
|
|
| 45 |
[alg.is.permutation]: #alg.is.permutation
|
| 46 |
[alg.lex.comparison]: #alg.lex.comparison
|
| 47 |
[alg.merge]: #alg.merge
|
| 48 |
[alg.min.max]: #alg.min.max
|
| 49 |
[alg.modifying.operations]: #alg.modifying.operations
|
|
@@ -59,13 +65,16 @@ ISO C 7.22.5.
|
|
| 59 |
[alg.replace]: #alg.replace
|
| 60 |
[alg.reverse]: #alg.reverse
|
| 61 |
[alg.rotate]: #alg.rotate
|
| 62 |
[alg.search]: #alg.search
|
| 63 |
[alg.set.operations]: #alg.set.operations
|
|
|
|
| 64 |
[alg.shift]: #alg.shift
|
| 65 |
[alg.sort]: #alg.sort
|
| 66 |
[alg.sorting]: #alg.sorting
|
|
|
|
|
|
|
| 67 |
[alg.swap]: #alg.swap
|
| 68 |
[alg.three.way]: #alg.three.way
|
| 69 |
[alg.transform]: #alg.transform
|
| 70 |
[alg.unique]: #alg.unique
|
| 71 |
[algorithm.stable]: library.md#algorithm.stable
|
|
@@ -85,12 +94,12 @@ ISO C 7.22.5.
|
|
| 85 |
[basic.lookup.argdep]: basic.md#basic.lookup.argdep
|
| 86 |
[basic.lookup.unqual]: basic.md#basic.lookup.unqual
|
| 87 |
[bidirectional.iterators]: iterators.md#bidirectional.iterators
|
| 88 |
[binary.search]: #binary.search
|
| 89 |
[class.conv]: class.md#class.conv
|
|
|
|
| 90 |
[containers]: containers.md#containers
|
| 91 |
-
[conv]: expr.md#conv
|
| 92 |
[conv.integral]: expr.md#conv.integral
|
| 93 |
[cpp17.copyassignable]: #cpp17.copyassignable
|
| 94 |
[cpp17.copyconstructible]: #cpp17.copyconstructible
|
| 95 |
[cpp17.lessthancomparable]: #cpp17.lessthancomparable
|
| 96 |
[cpp17.moveassignable]: #cpp17.moveassignable
|
|
@@ -105,16 +114,17 @@ ISO C 7.22.5.
|
|
| 105 |
[includes]: #includes
|
| 106 |
[inclusive.scan]: #inclusive.scan
|
| 107 |
[inner.product]: #inner.product
|
| 108 |
[input.iterators]: iterators.md#input.iterators
|
| 109 |
[intro.execution]: basic.md#intro.execution
|
| 110 |
-
[intro.object]: basic.md#intro.object
|
| 111 |
[intro.progress]: basic.md#intro.progress
|
| 112 |
[is.heap]: #is.heap
|
| 113 |
[is.sorted]: #is.sorted
|
|
|
|
| 114 |
[iterator.concept.forward]: iterators.md#iterator.concept.forward
|
| 115 |
[iterator.concept.input]: iterators.md#iterator.concept.input
|
|
|
|
| 116 |
[iterator.concept.sentinel]: iterators.md#iterator.concept.sentinel
|
| 117 |
[iterator.concept.sizedsentinel]: iterators.md#iterator.concept.sizedsentinel
|
| 118 |
[iterator.requirements]: iterators.md#iterator.requirements
|
| 119 |
[iterator.requirements.general]: iterators.md#iterator.requirements.general
|
| 120 |
[lower.bound]: #lower.bound
|
|
@@ -122,10 +132,11 @@ ISO C 7.22.5.
|
|
| 122 |
[mismatch]: #mismatch
|
| 123 |
[multiset]: containers.md#multiset
|
| 124 |
[numeric.iota]: #numeric.iota
|
| 125 |
[numeric.ops]: #numeric.ops
|
| 126 |
[numeric.ops.gcd]: #numeric.ops.gcd
|
|
|
|
| 127 |
[numeric.ops.lcm]: #numeric.ops.lcm
|
| 128 |
[numeric.ops.midpoint]: #numeric.ops.midpoint
|
| 129 |
[numeric.ops.overview]: #numeric.ops.overview
|
| 130 |
[numerics.defns]: #numerics.defns
|
| 131 |
[output.iterators]: iterators.md#output.iterators
|
|
@@ -146,15 +157,17 @@ ISO C 7.22.5.
|
|
| 146 |
[set.union]: #set.union
|
| 147 |
[sort]: #sort
|
| 148 |
[sort.heap]: #sort.heap
|
| 149 |
[special.mem.concepts]: #special.mem.concepts
|
| 150 |
[specialized.algorithms]: #specialized.algorithms
|
|
|
|
| 151 |
[specialized.construct]: #specialized.construct
|
| 152 |
[specialized.destroy]: #specialized.destroy
|
| 153 |
[stable.sort]: #stable.sort
|
| 154 |
[swappable.requirements]: library.md#swappable.requirements
|
| 155 |
[temp.func.order]: temp.md#temp.func.order
|
|
|
|
| 156 |
[thread.jthread.class]: thread.md#thread.jthread.class
|
| 157 |
[thread.thread.class]: thread.md#thread.thread.class
|
| 158 |
[transform.exclusive.scan]: #transform.exclusive.scan
|
| 159 |
[transform.inclusive.scan]: #transform.inclusive.scan
|
| 160 |
[transform.reduce]: #transform.reduce
|
|
@@ -167,17 +180,17 @@ ISO C 7.22.5.
|
|
| 167 |
|
| 168 |
[^1]: The decision whether to include a copying version was usually
|
| 169 |
based on complexity considerations. When the cost of doing the
|
| 170 |
operation dominates the cost of copy, the copying version is not
|
| 171 |
included. For example, `sort_copy` is not included because the cost
|
| 172 |
-
of sorting is much more significant, and users
|
| 173 |
-
|
| 174 |
|
| 175 |
-
[^2]: `copy_backward`
|
| 176 |
the range \[`result - `N, `result`).
|
| 177 |
|
| 178 |
-
[^3]: `move_backward`
|
| 179 |
the range \[`result - `N, `result`).
|
| 180 |
|
| 181 |
[^4]: The use of fully closed ranges is intentional.
|
| 182 |
|
| 183 |
[^5]: This behavior intentionally differs from `max_element`.
|
|
|
|
| 10 |
compare-pred* compar);
|
| 11 |
void qsort(void* base, size_t nmemb, size_t size, c-compare-pred* compar);
|
| 12 |
void qsort(void* base, size_t nmemb, size_t size, compare-pred* compar);
|
| 13 |
```
|
| 14 |
|
| 15 |
+
*Preconditions:* For `qsort`, the objects in the array pointed to by
|
| 16 |
+
`base` are of trivially copyable type.
|
| 17 |
+
|
| 18 |
*Effects:* These functions have the semantics specified in the C
|
| 19 |
standard library.
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
*Throws:* Any exception thrown by `compar`
|
| 22 |
[[res.on.exception.handling]].
|
| 23 |
|
| 24 |
+
See also: ISO C 7.22.5
|
| 25 |
|
| 26 |
<!-- Link reference definitions -->
|
| 27 |
[accumulate]: #accumulate
|
| 28 |
[adjacent.difference]: #adjacent.difference
|
| 29 |
[alg.adjacent.find]: #alg.adjacent.find
|
| 30 |
[alg.all.of]: #alg.all.of
|
| 31 |
[alg.any.of]: #alg.any.of
|
| 32 |
[alg.binary.search]: #alg.binary.search
|
| 33 |
+
[alg.binary.search.general]: #alg.binary.search.general
|
| 34 |
[alg.c.library]: #alg.c.library
|
| 35 |
[alg.clamp]: #alg.clamp
|
| 36 |
+
[alg.contains]: #alg.contains
|
| 37 |
[alg.copy]: #alg.copy
|
| 38 |
[alg.count]: #alg.count
|
| 39 |
+
[alg.ends.with]: #alg.ends.with
|
| 40 |
[alg.equal]: #alg.equal
|
| 41 |
[alg.fill]: #alg.fill
|
| 42 |
[alg.find]: #alg.find
|
| 43 |
[alg.find.end]: #alg.find.end
|
| 44 |
[alg.find.first.of]: #alg.find.first.of
|
| 45 |
+
[alg.find.last]: #alg.find.last
|
| 46 |
+
[alg.fold]: #alg.fold
|
| 47 |
[alg.foreach]: #alg.foreach
|
| 48 |
[alg.generate]: #alg.generate
|
| 49 |
[alg.heap.operations]: #alg.heap.operations
|
| 50 |
+
[alg.heap.operations.general]: #alg.heap.operations.general
|
| 51 |
[alg.is.permutation]: #alg.is.permutation
|
| 52 |
[alg.lex.comparison]: #alg.lex.comparison
|
| 53 |
[alg.merge]: #alg.merge
|
| 54 |
[alg.min.max]: #alg.min.max
|
| 55 |
[alg.modifying.operations]: #alg.modifying.operations
|
|
|
|
| 65 |
[alg.replace]: #alg.replace
|
| 66 |
[alg.reverse]: #alg.reverse
|
| 67 |
[alg.rotate]: #alg.rotate
|
| 68 |
[alg.search]: #alg.search
|
| 69 |
[alg.set.operations]: #alg.set.operations
|
| 70 |
+
[alg.set.operations.general]: #alg.set.operations.general
|
| 71 |
[alg.shift]: #alg.shift
|
| 72 |
[alg.sort]: #alg.sort
|
| 73 |
[alg.sorting]: #alg.sorting
|
| 74 |
+
[alg.sorting.general]: #alg.sorting.general
|
| 75 |
+
[alg.starts.with]: #alg.starts.with
|
| 76 |
[alg.swap]: #alg.swap
|
| 77 |
[alg.three.way]: #alg.three.way
|
| 78 |
[alg.transform]: #alg.transform
|
| 79 |
[alg.unique]: #alg.unique
|
| 80 |
[algorithm.stable]: library.md#algorithm.stable
|
|
|
|
| 94 |
[basic.lookup.argdep]: basic.md#basic.lookup.argdep
|
| 95 |
[basic.lookup.unqual]: basic.md#basic.lookup.unqual
|
| 96 |
[bidirectional.iterators]: iterators.md#bidirectional.iterators
|
| 97 |
[binary.search]: #binary.search
|
| 98 |
[class.conv]: class.md#class.conv
|
| 99 |
+
[concept.booleantestable]: concepts.md#concept.booleantestable
|
| 100 |
[containers]: containers.md#containers
|
|
|
|
| 101 |
[conv.integral]: expr.md#conv.integral
|
| 102 |
[cpp17.copyassignable]: #cpp17.copyassignable
|
| 103 |
[cpp17.copyconstructible]: #cpp17.copyconstructible
|
| 104 |
[cpp17.lessthancomparable]: #cpp17.lessthancomparable
|
| 105 |
[cpp17.moveassignable]: #cpp17.moveassignable
|
|
|
|
| 114 |
[includes]: #includes
|
| 115 |
[inclusive.scan]: #inclusive.scan
|
| 116 |
[inner.product]: #inner.product
|
| 117 |
[input.iterators]: iterators.md#input.iterators
|
| 118 |
[intro.execution]: basic.md#intro.execution
|
|
|
|
| 119 |
[intro.progress]: basic.md#intro.progress
|
| 120 |
[is.heap]: #is.heap
|
| 121 |
[is.sorted]: #is.sorted
|
| 122 |
+
[iterator.concept.bidir]: iterators.md#iterator.concept.bidir
|
| 123 |
[iterator.concept.forward]: iterators.md#iterator.concept.forward
|
| 124 |
[iterator.concept.input]: iterators.md#iterator.concept.input
|
| 125 |
+
[iterator.concept.random.access]: iterators.md#iterator.concept.random.access
|
| 126 |
[iterator.concept.sentinel]: iterators.md#iterator.concept.sentinel
|
| 127 |
[iterator.concept.sizedsentinel]: iterators.md#iterator.concept.sizedsentinel
|
| 128 |
[iterator.requirements]: iterators.md#iterator.requirements
|
| 129 |
[iterator.requirements.general]: iterators.md#iterator.requirements.general
|
| 130 |
[lower.bound]: #lower.bound
|
|
|
|
| 132 |
[mismatch]: #mismatch
|
| 133 |
[multiset]: containers.md#multiset
|
| 134 |
[numeric.iota]: #numeric.iota
|
| 135 |
[numeric.ops]: #numeric.ops
|
| 136 |
[numeric.ops.gcd]: #numeric.ops.gcd
|
| 137 |
+
[numeric.ops.general]: #numeric.ops.general
|
| 138 |
[numeric.ops.lcm]: #numeric.ops.lcm
|
| 139 |
[numeric.ops.midpoint]: #numeric.ops.midpoint
|
| 140 |
[numeric.ops.overview]: #numeric.ops.overview
|
| 141 |
[numerics.defns]: #numerics.defns
|
| 142 |
[output.iterators]: iterators.md#output.iterators
|
|
|
|
| 157 |
[set.union]: #set.union
|
| 158 |
[sort]: #sort
|
| 159 |
[sort.heap]: #sort.heap
|
| 160 |
[special.mem.concepts]: #special.mem.concepts
|
| 161 |
[specialized.algorithms]: #specialized.algorithms
|
| 162 |
+
[specialized.algorithms.general]: #specialized.algorithms.general
|
| 163 |
[specialized.construct]: #specialized.construct
|
| 164 |
[specialized.destroy]: #specialized.destroy
|
| 165 |
[stable.sort]: #stable.sort
|
| 166 |
[swappable.requirements]: library.md#swappable.requirements
|
| 167 |
[temp.func.order]: temp.md#temp.func.order
|
| 168 |
+
[term.unevaluated.operand]: expr.md#term.unevaluated.operand
|
| 169 |
[thread.jthread.class]: thread.md#thread.jthread.class
|
| 170 |
[thread.thread.class]: thread.md#thread.thread.class
|
| 171 |
[transform.exclusive.scan]: #transform.exclusive.scan
|
| 172 |
[transform.inclusive.scan]: #transform.inclusive.scan
|
| 173 |
[transform.reduce]: #transform.reduce
|
|
|
|
| 180 |
|
| 181 |
[^1]: The decision whether to include a copying version was usually
|
| 182 |
based on complexity considerations. When the cost of doing the
|
| 183 |
operation dominates the cost of copy, the copying version is not
|
| 184 |
included. For example, `sort_copy` is not included because the cost
|
| 185 |
+
of sorting is much more significant, and users can invoke `copy`
|
| 186 |
+
followed by `sort`.
|
| 187 |
|
| 188 |
+
[^2]: `copy_backward` can be used instead of `copy` when `last` is in
|
| 189 |
the range \[`result - `N, `result`).
|
| 190 |
|
| 191 |
+
[^3]: `move_backward` can be used instead of `move` when `last` is in
|
| 192 |
the range \[`result - `N, `result`).
|
| 193 |
|
| 194 |
[^4]: The use of fully closed ranges is intentional.
|
| 195 |
|
| 196 |
[^5]: This behavior intentionally differs from `max_element`.
|