From Jason Turner

[algorithm.syn]

Large diff (178.6 KB) - rendering may be slow on some devices

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp_z3sm6am/{from.md → to.md} +1158 -195
tmp/tmp_z3sm6am/{from.md → to.md} RENAMED
@@ -1,8 +1,9 @@
1
  ## Header `<algorithm>` synopsis <a id="algorithm.syn">[[algorithm.syn]]</a>
2
 
3
  ``` cpp
 
4
  #include <initializer_list> // see [initializer.list.syn]
5
 
6
  namespace std {
7
  namespace ranges {
8
  // [algorithms.results], algorithm result types
@@ -37,64 +38,98 @@ namespace std {
37
  // [alg.nonmodifying], non-modifying sequence operations
38
  // [alg.all.of], all of
39
  template<class InputIterator, class Predicate>
40
  constexpr bool all_of(InputIterator first, InputIterator last, Predicate pred);
41
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
42
- bool all_of(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
43
  ForwardIterator first, ForwardIterator last, Predicate pred);
44
 
45
  namespace ranges {
46
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
47
  indirect_unary_predicate<projected<I, Proj>> Pred>
48
  constexpr bool all_of(I first, S last, Pred pred, Proj proj = {});
49
  template<input_range R, class Proj = identity,
50
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
51
  constexpr bool all_of(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
52
  }
53
 
54
  // [alg.any.of], any of
55
  template<class InputIterator, class Predicate>
56
  constexpr bool any_of(InputIterator first, InputIterator last, Predicate pred);
57
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
58
- bool any_of(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
59
  ForwardIterator first, ForwardIterator last, Predicate pred);
60
 
61
  namespace ranges {
62
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
63
  indirect_unary_predicate<projected<I, Proj>> Pred>
64
  constexpr bool any_of(I first, S last, Pred pred, Proj proj = {});
65
  template<input_range R, class Proj = identity,
66
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
67
  constexpr bool any_of(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
68
  }
69
 
70
  // [alg.none.of], none of
71
  template<class InputIterator, class Predicate>
72
  constexpr bool none_of(InputIterator first, InputIterator last, Predicate pred);
73
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
74
- bool none_of(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
75
  ForwardIterator first, ForwardIterator last, Predicate pred);
76
 
77
  namespace ranges {
78
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
79
  indirect_unary_predicate<projected<I, Proj>> Pred>
80
  constexpr bool none_of(I first, S last, Pred pred, Proj proj = {});
81
  template<input_range R, class Proj = identity,
82
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
83
  constexpr bool none_of(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
84
  }
85
 
86
  // [alg.contains], contains
87
  namespace ranges {
88
- template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
 
89
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
90
  constexpr bool contains(I first, S last, const T& value, Proj proj = {});
91
- template<input_range R, class T, class Proj = identity>
 
92
  requires
93
  indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
94
  constexpr bool contains(R&& r, const T& value, Proj proj = {});
95
 
 
 
 
 
 
 
 
 
 
 
 
96
  template<forward_iterator I1, sentinel_for<I1> S1,
97
  forward_iterator I2, sentinel_for<I2> S2,
98
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
99
  requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
100
  constexpr bool contains_subrange(I1 first1, S1 last1, I2 first2, S2 last2,
@@ -102,17 +137,29 @@ namespace std {
102
  template<forward_range R1, forward_range R2,
103
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
104
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
105
  constexpr bool contains_subrange(R1&& r1, R2&& r2,
106
  Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
107
  }
108
 
109
  // [alg.foreach], for each
110
  template<class InputIterator, class Function>
111
  constexpr Function for_each(InputIterator first, InputIterator last, Function f);
112
  template<class ExecutionPolicy, class ForwardIterator, class Function>
113
- void for_each(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
114
  ForwardIterator first, ForwardIterator last, Function f);
115
 
116
  namespace ranges {
117
  template<class I, class F>
118
  using for_each_result = in_fun_result<I, F>;
@@ -123,97 +170,182 @@ namespace std {
123
  for_each(I first, S last, Fun f, Proj proj = {});
124
  template<input_range R, class Proj = identity,
125
  indirectly_unary_invocable<projected<iterator_t<R>, Proj>> Fun>
126
  constexpr for_each_result<borrowed_iterator_t<R>, Fun>
127
  for_each(R&& r, Fun f, Proj proj = {});
 
 
 
 
 
 
 
 
 
128
  }
129
 
130
  template<class InputIterator, class Size, class Function>
131
  constexpr InputIterator for_each_n(InputIterator first, Size n, Function f);
132
  template<class ExecutionPolicy, class ForwardIterator, class Size, class Function>
133
- ForwardIterator for_each_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
134
  ForwardIterator first, Size n, Function f);
135
 
136
  namespace ranges {
137
  template<class I, class F>
138
  using for_each_n_result = in_fun_result<I, F>;
139
 
140
  template<input_iterator I, class Proj = identity,
141
  indirectly_unary_invocable<projected<I, Proj>> Fun>
142
  constexpr for_each_n_result<I, Fun>
143
  for_each_n(I first, iter_difference_t<I> n, Fun f, Proj proj = {});
 
 
 
 
 
144
  }
145
 
146
  // [alg.find], find
147
- template<class InputIterator, class T>
148
  constexpr InputIterator find(InputIterator first, InputIterator last,
149
  const T& value);
150
- template<class ExecutionPolicy, class ForwardIterator, class T>
151
- ForwardIterator find(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
 
152
  ForwardIterator first, ForwardIterator last,
153
  const T& value);
154
  template<class InputIterator, class Predicate>
155
  constexpr InputIterator find_if(InputIterator first, InputIterator last,
156
  Predicate pred);
157
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
158
- ForwardIterator find_if(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
159
  ForwardIterator first, ForwardIterator last,
160
  Predicate pred);
161
  template<class InputIterator, class Predicate>
162
  constexpr InputIterator find_if_not(InputIterator first, InputIterator last,
163
  Predicate pred);
164
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
165
- ForwardIterator find_if_not(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
166
  ForwardIterator first, ForwardIterator last,
167
  Predicate pred);
168
 
169
  namespace ranges {
170
- template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
 
171
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
172
  constexpr I find(I first, S last, const T& value, Proj proj = {});
173
- template<input_range R, class T, class Proj = identity>
 
174
  requires indirect_binary_predicate<ranges::equal_to,
175
  projected<iterator_t<R>, Proj>, const T*>
176
  constexpr borrowed_iterator_t<R>
177
  find(R&& r, const T& value, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
178
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
179
  indirect_unary_predicate<projected<I, Proj>> Pred>
180
  constexpr I find_if(I first, S last, Pred pred, Proj proj = {});
181
  template<input_range R, class Proj = identity,
182
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
183
  constexpr borrowed_iterator_t<R>
184
  find_if(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
185
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
186
  indirect_unary_predicate<projected<I, Proj>> Pred>
187
  constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {});
188
  template<input_range R, class Proj = identity,
189
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
190
  constexpr borrowed_iterator_t<R>
191
  find_if_not(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
192
  }
193
 
194
  // [alg.find.last], find last
195
  namespace ranges {
196
- template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity>
 
197
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
198
  constexpr subrange<I> find_last(I first, S last, const T& value, Proj proj = {});
199
- template<forward_range R, class T, class Proj = identity>
 
200
  requires
201
  indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
202
  constexpr borrowed_subrange_t<R> find_last(R&& r, const T& value, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
204
  indirect_unary_predicate<projected<I, Proj>> Pred>
205
  constexpr subrange<I> find_last_if(I first, S last, Pred pred, Proj proj = {});
206
  template<forward_range R, class Proj = identity,
207
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
208
  constexpr borrowed_subrange_t<R> find_last_if(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
209
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
210
  indirect_unary_predicate<projected<I, Proj>> Pred>
211
  constexpr subrange<I> find_last_if_not(I first, S last, Pred pred, Proj proj = {});
212
  template<forward_range R, class Proj = identity,
213
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
214
  constexpr borrowed_subrange_t<R> find_last_if_not(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
215
  }
216
 
217
  // [alg.find.end], find end
218
  template<class ForwardIterator1, class ForwardIterator2>
219
  constexpr ForwardIterator1
@@ -224,17 +356,17 @@ namespace std {
224
  find_end(ForwardIterator1 first1, ForwardIterator1 last1,
225
  ForwardIterator2 first2, ForwardIterator2 last2,
226
  BinaryPredicate pred);
227
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
228
  ForwardIterator1
229
- find_end(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
230
  ForwardIterator1 first1, ForwardIterator1 last1,
231
  ForwardIterator2 first2, ForwardIterator2 last2);
232
  template<class ExecutionPolicy, class ForwardIterator1,
233
  class ForwardIterator2, class BinaryPredicate>
234
  ForwardIterator1
235
- find_end(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
236
  ForwardIterator1 first1, ForwardIterator1 last1,
237
  ForwardIterator2 first2, ForwardIterator2 last2,
238
  BinaryPredicate pred);
239
 
240
  namespace ranges {
@@ -248,13 +380,27 @@ namespace std {
248
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
249
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
250
  constexpr borrowed_subrange_t<R1>
251
  find_end(R1&& r1, R2&& r2, Pred pred = {},
252
  Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
253
  }
254
 
255
- // [alg.find.first.of], find first
256
  template<class InputIterator, class ForwardIterator>
257
  constexpr InputIterator
258
  find_first_of(InputIterator first1, InputIterator last1,
259
  ForwardIterator first2, ForwardIterator last2);
260
  template<class InputIterator, class ForwardIterator, class BinaryPredicate>
@@ -262,17 +408,17 @@ namespace std {
262
  find_first_of(InputIterator first1, InputIterator last1,
263
  ForwardIterator first2, ForwardIterator last2,
264
  BinaryPredicate pred);
265
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
266
  ForwardIterator1
267
- find_first_of(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
268
  ForwardIterator1 first1, ForwardIterator1 last1,
269
  ForwardIterator2 first2, ForwardIterator2 last2);
270
  template<class ExecutionPolicy, class ForwardIterator1,
271
  class ForwardIterator2, class BinaryPredicate>
272
  ForwardIterator1
273
- find_first_of(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
274
  ForwardIterator1 first1, ForwardIterator1 last1,
275
  ForwardIterator2 first2, ForwardIterator2 last2,
276
  BinaryPredicate pred);
277
 
278
  namespace ranges {
@@ -285,10 +431,23 @@ namespace std {
285
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
286
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
287
  constexpr borrowed_iterator_t<R1>
288
  find_first_of(R1&& r1, R2&& r2, Pred pred = {},
289
  Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  }
291
 
292
  // [alg.adjacent.find], adjacent find
293
  template<class ForwardIterator>
294
  constexpr ForwardIterator
@@ -297,15 +456,15 @@ namespace std {
297
  constexpr ForwardIterator
298
  adjacent_find(ForwardIterator first, ForwardIterator last,
299
  BinaryPredicate pred);
300
  template<class ExecutionPolicy, class ForwardIterator>
301
  ForwardIterator
302
- adjacent_find(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
303
  ForwardIterator first, ForwardIterator last);
304
  template<class ExecutionPolicy, class ForwardIterator, class BinaryPredicate>
305
  ForwardIterator
306
- adjacent_find(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
307
  ForwardIterator first, ForwardIterator last,
308
  BinaryPredicate pred);
309
 
310
  namespace ranges {
311
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
@@ -316,49 +475,86 @@ namespace std {
316
  template<forward_range R, class Proj = identity,
317
  indirect_binary_predicate<projected<iterator_t<R>, Proj>,
318
  projected<iterator_t<R>, Proj>> Pred = ranges::equal_to>
319
  constexpr borrowed_iterator_t<R>
320
  adjacent_find(R&& r, Pred pred = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
321
  }
322
 
323
  // [alg.count], count
324
- template<class InputIterator, class T>
325
  constexpr typename iterator_traits<InputIterator>::difference_type
326
  count(InputIterator first, InputIterator last, const T& value);
327
- template<class ExecutionPolicy, class ForwardIterator, class T>
 
328
  typename iterator_traits<ForwardIterator>::difference_type
329
- count(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
330
  ForwardIterator first, ForwardIterator last, const T& value);
331
  template<class InputIterator, class Predicate>
332
  constexpr typename iterator_traits<InputIterator>::difference_type
333
  count_if(InputIterator first, InputIterator last, Predicate pred);
334
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
335
  typename iterator_traits<ForwardIterator>::difference_type
336
- count_if(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
337
  ForwardIterator first, ForwardIterator last, Predicate pred);
338
 
339
  namespace ranges {
340
- template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity>
 
341
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
342
  constexpr iter_difference_t<I>
343
  count(I first, S last, const T& value, Proj proj = {});
344
- template<input_range R, class T, class Proj = identity>
 
345
  requires indirect_binary_predicate<ranges::equal_to,
346
  projected<iterator_t<R>, Proj>, const T*>
347
  constexpr range_difference_t<R>
348
  count(R&& r, const T& value, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
350
  indirect_unary_predicate<projected<I, Proj>> Pred>
351
  constexpr iter_difference_t<I>
352
  count_if(I first, S last, Pred pred, Proj proj = {});
353
  template<input_range R, class Proj = identity,
354
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
355
  constexpr range_difference_t<R>
356
  count_if(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
357
  }
358
 
359
- // [mismatch], mismatch
360
  template<class InputIterator1, class InputIterator2>
361
  constexpr pair<InputIterator1, InputIterator2>
362
  mismatch(InputIterator1 first1, InputIterator1 last1,
363
  InputIterator2 first2);
364
  template<class InputIterator1, class InputIterator2, class BinaryPredicate>
@@ -374,28 +570,28 @@ namespace std {
374
  mismatch(InputIterator1 first1, InputIterator1 last1,
375
  InputIterator2 first2, InputIterator2 last2,
376
  BinaryPredicate pred);
377
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
378
  pair<ForwardIterator1, ForwardIterator2>
379
- mismatch(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
380
  ForwardIterator1 first1, ForwardIterator1 last1,
381
  ForwardIterator2 first2);
382
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
383
  class BinaryPredicate>
384
  pair<ForwardIterator1, ForwardIterator2>
385
- mismatch(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
386
  ForwardIterator1 first1, ForwardIterator1 last1,
387
  ForwardIterator2 first2, BinaryPredicate pred);
388
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
389
  pair<ForwardIterator1, ForwardIterator2>
390
- mismatch(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
391
  ForwardIterator1 first1, ForwardIterator1 last1,
392
  ForwardIterator2 first2, ForwardIterator2 last2);
393
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
394
  class BinaryPredicate>
395
  pair<ForwardIterator1, ForwardIterator2>
396
- mismatch(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
397
  ForwardIterator1 first1, ForwardIterator1 last1,
398
  ForwardIterator2 first2, ForwardIterator2 last2,
399
  BinaryPredicate pred);
400
 
401
  namespace ranges {
@@ -412,10 +608,24 @@ namespace std {
412
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
413
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
414
  constexpr mismatch_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
415
  mismatch(R1&& r1, R2&& r2, Pred pred = {},
416
  Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
  }
418
 
419
  // [alg.equal], equal
420
  template<class InputIterator1, class InputIterator2>
421
  constexpr bool equal(InputIterator1 first1, InputIterator1 last1,
@@ -429,25 +639,25 @@ namespace std {
429
  template<class InputIterator1, class InputIterator2, class BinaryPredicate>
430
  constexpr bool equal(InputIterator1 first1, InputIterator1 last1,
431
  InputIterator2 first2, InputIterator2 last2,
432
  BinaryPredicate pred);
433
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
434
- bool equal(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
435
  ForwardIterator1 first1, ForwardIterator1 last1,
436
  ForwardIterator2 first2);
437
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
438
  class BinaryPredicate>
439
- bool equal(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
440
  ForwardIterator1 first1, ForwardIterator1 last1,
441
  ForwardIterator2 first2, BinaryPredicate pred);
442
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
443
- bool equal(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
444
  ForwardIterator1 first1, ForwardIterator1 last1,
445
  ForwardIterator2 first2, ForwardIterator2 last2);
446
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
447
  class BinaryPredicate>
448
- bool equal(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
449
  ForwardIterator1 first1, ForwardIterator1 last1,
450
  ForwardIterator2 first2, ForwardIterator2 last2,
451
  BinaryPredicate pred);
452
 
453
  namespace ranges {
@@ -460,10 +670,22 @@ namespace std {
460
  template<input_range R1, input_range R2, class Pred = ranges::equal_to,
461
  class Proj1 = identity, class Proj2 = identity>
462
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
463
  constexpr bool equal(R1&& r1, R2&& r2, Pred pred = {},
464
  Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
465
  }
466
 
467
  // [alg.is.permutation], is permutation
468
  template<class ForwardIterator1, class ForwardIterator2>
469
  constexpr bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
@@ -506,17 +728,17 @@ namespace std {
506
  search(ForwardIterator1 first1, ForwardIterator1 last1,
507
  ForwardIterator2 first2, ForwardIterator2 last2,
508
  BinaryPredicate pred);
509
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
510
  ForwardIterator1
511
- search(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
512
  ForwardIterator1 first1, ForwardIterator1 last1,
513
  ForwardIterator2 first2, ForwardIterator2 last2);
514
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
515
  class BinaryPredicate>
516
  ForwardIterator1
517
- search(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
518
  ForwardIterator1 first1, ForwardIterator1 last1,
519
  ForwardIterator2 first2, ForwardIterator2 last2,
520
  BinaryPredicate pred);
521
 
522
  namespace ranges {
@@ -531,46 +753,78 @@ namespace std {
531
  class Proj1 = identity, class Proj2 = identity>
532
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
533
  constexpr borrowed_subrange_t<R1>
534
  search(R1&& r1, R2&& r2, Pred pred = {},
535
  Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
536
  }
537
 
538
- template<class ForwardIterator, class Size, class T>
 
539
  constexpr ForwardIterator
540
  search_n(ForwardIterator first, ForwardIterator last,
541
  Size count, const T& value);
542
- template<class ForwardIterator, class Size, class T, class BinaryPredicate>
 
543
  constexpr ForwardIterator
544
  search_n(ForwardIterator first, ForwardIterator last,
545
  Size count, const T& value, BinaryPredicate pred);
546
- template<class ExecutionPolicy, class ForwardIterator, class Size, class T>
 
547
  ForwardIterator
548
- search_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
549
  ForwardIterator first, ForwardIterator last,
550
  Size count, const T& value);
551
- template<class ExecutionPolicy, class ForwardIterator, class Size, class T,
552
- class BinaryPredicate>
553
  ForwardIterator
554
- search_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
555
  ForwardIterator first, ForwardIterator last,
556
  Size count, const T& value,
557
  BinaryPredicate pred);
558
 
559
  namespace ranges {
560
- template<forward_iterator I, sentinel_for<I> S, class T,
561
- class Pred = ranges::equal_to, class Proj = identity>
 
562
  requires indirectly_comparable<I, const T*, Pred, Proj>
563
  constexpr subrange<I>
564
  search_n(I first, S last, iter_difference_t<I> count,
565
  const T& value, Pred pred = {}, Proj proj = {});
566
- template<forward_range R, class T, class Pred = ranges::equal_to,
567
- class Proj = identity>
568
  requires indirectly_comparable<iterator_t<R>, const T*, Pred, Proj>
569
  constexpr borrowed_subrange_t<R>
570
  search_n(R&& r, range_difference_t<R> count,
571
  const T& value, Pred pred = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
572
  }
573
 
574
  template<class ForwardIterator, class Searcher>
575
  constexpr ForwardIterator
576
  search(ForwardIterator first, ForwardIterator last, const Searcher& searcher);
@@ -586,10 +840,23 @@ namespace std {
586
  class Proj1 = identity, class Proj2 = identity>
587
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
588
  constexpr bool starts_with(R1&& r1, R2&& r2, Pred pred = {},
589
  Proj1 proj1 = {}, Proj2 proj2 = {});
590
 
 
 
 
 
 
 
 
 
 
 
 
 
 
591
  // [alg.ends.with], ends with
592
  template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
593
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
594
  requires (forward_iterator<I1> || sized_sentinel_for<S1, I1>) &&
595
  (forward_iterator<I2> || sized_sentinel_for<S2, I2>) &&
@@ -602,10 +869,23 @@ namespace std {
602
  (forward_range<R2> || sized_range<R2>) &&
603
  indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
604
  constexpr bool ends_with(R1&& r1, R2&& r2, Pred pred = {},
605
  Proj1 proj1 = {}, Proj2 proj2 = {});
606
 
 
 
 
 
 
 
 
 
 
 
 
 
 
607
  // [alg.fold], fold
608
  template<class F>
609
  class flipped { // exposition only
610
  F f; // exposition only
611
 
@@ -631,15 +911,16 @@ namespace std {
631
 
632
  template<class F, class T, class I>
633
  concept indirectly-binary-right-foldable = // exposition only
634
  indirectly-binary-left-foldable<flipped<F>, T, I>;
635
 
636
- template<input_iterator I, sentinel_for<I> S, class T,
637
  indirectly-binary-left-foldable<T, I> F>
638
  constexpr auto fold_left(I first, S last, T init, F f);
639
 
640
- template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F>
 
641
  constexpr auto fold_left(R&& r, T init, F f);
642
 
643
  template<input_iterator I, sentinel_for<I> S,
644
  indirectly-binary-left-foldable<iter_value_t<I>, I> F>
645
  requires constructible_from<iter_value_t<I>, iter_reference_t<I>>
@@ -647,15 +928,15 @@ namespace std {
647
 
648
  template<input_range R, indirectly-binary-left-foldable<range_value_t<R>, iterator_t<R>> F>
649
  requires constructible_from<range_value_t<R>, range_reference_t<R>>
650
  constexpr auto fold_left_first(R&& r, F f);
651
 
652
- template<bidirectional_iterator I, sentinel_for<I> S, class T,
653
  indirectly-binary-right-foldable<T, I> F>
654
  constexpr auto fold_right(I first, S last, T init, F f);
655
 
656
- template<bidirectional_range R, class T,
657
  indirectly-binary-right-foldable<T, iterator_t<R>> F>
658
  constexpr auto fold_right(R&& r, T init, F f);
659
 
660
  template<bidirectional_iterator I, sentinel_for<I> S,
661
  indirectly-binary-right-foldable<iter_value_t<I>, I> F>
@@ -670,15 +951,16 @@ namespace std {
670
  template<class I, class T>
671
  using fold_left_with_iter_result = in_value_result<I, T>;
672
  template<class I, class T>
673
  using fold_left_first_with_iter_result = in_value_result<I, T>;
674
 
675
- template<input_iterator I, sentinel_for<I> S, class T,
676
  indirectly-binary-left-foldable<T, I> F>
677
  constexpr see below fold_left_with_iter(I first, S last, T init, F f);
678
 
679
- template<input_range R, class T, indirectly-binary-left-foldable<T, iterator_t<R>> F>
 
680
  constexpr see below fold_left_with_iter(R&& r, T init, F f);
681
 
682
  template<input_iterator I, sentinel_for<I> S,
683
  indirectly-binary-left-foldable<iter_value_t<I>, I> F>
684
  requires constructible_from<iter_value_t<I>, iter_reference_t<I>>
@@ -694,11 +976,11 @@ namespace std {
694
  // [alg.copy], copy
695
  template<class InputIterator, class OutputIterator>
696
  constexpr OutputIterator copy(InputIterator first, InputIterator last,
697
  OutputIterator result);
698
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
699
- ForwardIterator2 copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
700
  ForwardIterator1 first, ForwardIterator1 last,
701
  ForwardIterator2 result);
702
 
703
  namespace ranges {
704
  template<class I, class O>
@@ -710,18 +992,28 @@ namespace std {
710
  copy(I first, S last, O result);
711
  template<input_range R, weakly_incrementable O>
712
  requires indirectly_copyable<iterator_t<R>, O>
713
  constexpr copy_result<borrowed_iterator_t<R>, O>
714
  copy(R&& r, O result);
 
 
 
 
 
 
 
 
 
 
715
  }
716
 
717
  template<class InputIterator, class Size, class OutputIterator>
718
  constexpr OutputIterator copy_n(InputIterator first, Size n,
719
  OutputIterator result);
720
  template<class ExecutionPolicy, class ForwardIterator1, class Size,
721
  class ForwardIterator2>
722
- ForwardIterator2 copy_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
723
  ForwardIterator1 first, Size n,
724
  ForwardIterator2 result);
725
 
726
  namespace ranges {
727
  template<class I, class O>
@@ -729,18 +1021,25 @@ namespace std {
729
 
730
  template<input_iterator I, weakly_incrementable O>
731
  requires indirectly_copyable<I, O>
732
  constexpr copy_n_result<I, O>
733
  copy_n(I first, iter_difference_t<I> n, O result);
 
 
 
 
 
 
 
734
  }
735
 
736
  template<class InputIterator, class OutputIterator, class Predicate>
737
  constexpr OutputIterator copy_if(InputIterator first, InputIterator last,
738
  OutputIterator result, Predicate pred);
739
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
740
  class Predicate>
741
- ForwardIterator2 copy_if(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
742
  ForwardIterator1 first, ForwardIterator1 last,
743
  ForwardIterator2 result, Predicate pred);
744
 
745
  namespace ranges {
746
  template<class I, class O>
@@ -754,10 +1053,25 @@ namespace std {
754
  template<input_range R, weakly_incrementable O, class Proj = identity,
755
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
756
  requires indirectly_copyable<iterator_t<R>, O>
757
  constexpr copy_if_result<borrowed_iterator_t<R>, O>
758
  copy_if(R&& r, O result, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
759
  }
760
 
761
  template<class BidirectionalIterator1, class BidirectionalIterator2>
762
  constexpr BidirectionalIterator2
763
  copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last,
@@ -781,11 +1095,11 @@ namespace std {
781
  template<class InputIterator, class OutputIterator>
782
  constexpr OutputIterator move(InputIterator first, InputIterator last,
783
  OutputIterator result);
784
  template<class ExecutionPolicy, class ForwardIterator1,
785
  class ForwardIterator2>
786
- ForwardIterator2 move(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
787
  ForwardIterator1 first, ForwardIterator1 last,
788
  ForwardIterator2 result);
789
 
790
  namespace ranges {
791
  template<class I, class O>
@@ -797,10 +1111,20 @@ namespace std {
797
  move(I first, S last, O result);
798
  template<input_range R, weakly_incrementable O>
799
  requires indirectly_movable<iterator_t<R>, O>
800
  constexpr move_result<borrowed_iterator_t<R>, O>
801
  move(R&& r, O result);
 
 
 
 
 
 
 
 
 
 
802
  }
803
 
804
  template<class BidirectionalIterator1, class BidirectionalIterator2>
805
  constexpr BidirectionalIterator2
806
  move_backward(BidirectionalIterator1 first, BidirectionalIterator1 last,
@@ -823,11 +1147,11 @@ namespace std {
823
  // [alg.swap], swap
824
  template<class ForwardIterator1, class ForwardIterator2>
825
  constexpr ForwardIterator2 swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1,
826
  ForwardIterator2 first2);
827
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
828
- ForwardIterator2 swap_ranges(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
829
  ForwardIterator1 first1, ForwardIterator1 last1,
830
  ForwardIterator2 first2);
831
 
832
  namespace ranges {
833
  template<class I1, class I2>
@@ -839,10 +1163,20 @@ namespace std {
839
  swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2);
840
  template<input_range R1, input_range R2>
841
  requires indirectly_swappable<iterator_t<R1>, iterator_t<R2>>
842
  constexpr swap_ranges_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
843
  swap_ranges(R1&& r1, R2&& r2);
 
 
 
 
 
 
 
 
 
 
844
  }
845
 
846
  template<class ForwardIterator1, class ForwardIterator2>
847
  constexpr void iter_swap(ForwardIterator1 a, ForwardIterator2 b);
848
 
@@ -858,17 +1192,17 @@ namespace std {
858
  InputIterator2 first2, OutputIterator result,
859
  BinaryOperation binary_op);
860
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
861
  class UnaryOperation>
862
  ForwardIterator2
863
- transform(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
864
  ForwardIterator1 first1, ForwardIterator1 last1,
865
  ForwardIterator2 result, UnaryOperation op);
866
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
867
  class ForwardIterator, class BinaryOperation>
868
  ForwardIterator
869
- transform(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
870
  ForwardIterator1 first1, ForwardIterator1 last1,
871
  ForwardIterator2 first2, ForwardIterator result,
872
  BinaryOperation binary_op);
873
 
874
  namespace ranges {
@@ -884,10 +1218,24 @@ namespace std {
884
  class Proj = identity>
885
  requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R>, Proj>>>
886
  constexpr unary_transform_result<borrowed_iterator_t<R>, O>
887
  transform(R&& r, O result, F op, Proj proj = {});
888
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
889
  template<class I1, class I2, class O>
890
  using binary_transform_result = in_in_out_result<I1, I2, O>;
891
 
892
  template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
893
  weakly_incrementable O, copy_constructible F, class Proj1 = identity,
@@ -902,142 +1250,256 @@ namespace std {
902
  requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R1>, Proj1>,
903
  projected<iterator_t<R2>, Proj2>>>
904
  constexpr binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
905
  transform(R1&& r1, R2&& r2, O result,
906
  F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
907
  }
908
 
909
  // [alg.replace], replace
910
  template<class ForwardIterator, class T>
911
  constexpr void replace(ForwardIterator first, ForwardIterator last,
912
  const T& old_value, const T& new_value);
913
- template<class ExecutionPolicy, class ForwardIterator, class T>
914
- void replace(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
 
915
  ForwardIterator first, ForwardIterator last,
916
  const T& old_value, const T& new_value);
917
- template<class ForwardIterator, class Predicate, class T>
 
918
  constexpr void replace_if(ForwardIterator first, ForwardIterator last,
919
  Predicate pred, const T& new_value);
920
- template<class ExecutionPolicy, class ForwardIterator, class Predicate, class T>
921
- void replace_if(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
 
922
  ForwardIterator first, ForwardIterator last,
923
  Predicate pred, const T& new_value);
924
 
925
  namespace ranges {
926
- template<input_iterator I, sentinel_for<I> S, class T1, class T2, class Proj = identity>
 
927
  requires indirectly_writable<I, const T2&> &&
928
  indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*>
929
  constexpr I
930
  replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {});
931
- template<input_range R, class T1, class T2, class Proj = identity>
 
932
  requires indirectly_writable<iterator_t<R>, const T2&> &&
933
  indirect_binary_predicate<ranges::equal_to,
934
  projected<iterator_t<R>, Proj>, const T1*>
935
  constexpr borrowed_iterator_t<R>
936
  replace(R&& r, const T1& old_value, const T2& new_value, Proj proj = {});
937
- template<input_iterator I, sentinel_for<I> S, class T, class Proj = identity,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
938
  indirect_unary_predicate<projected<I, Proj>> Pred>
939
  requires indirectly_writable<I, const T&>
940
  constexpr I replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = {});
941
- template<input_range R, class T, class Proj = identity,
942
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
943
  requires indirectly_writable<iterator_t<R>, const T&>
944
  constexpr borrowed_iterator_t<R>
945
  replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
946
  }
947
 
948
  template<class InputIterator, class OutputIterator, class T>
949
  constexpr OutputIterator replace_copy(InputIterator first, InputIterator last,
950
  OutputIterator result,
951
  const T& old_value, const T& new_value);
952
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T>
953
- ForwardIterator2 replace_copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
954
  ForwardIterator1 first, ForwardIterator1 last,
955
  ForwardIterator2 result,
956
  const T& old_value, const T& new_value);
957
- template<class InputIterator, class OutputIterator, class Predicate, class T>
 
958
  constexpr OutputIterator replace_copy_if(InputIterator first, InputIterator last,
959
  OutputIterator result,
960
  Predicate pred, const T& new_value);
961
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
962
- class Predicate, class T>
963
- ForwardIterator2 replace_copy_if(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
964
  ForwardIterator1 first, ForwardIterator1 last,
965
  ForwardIterator2 result,
966
  Predicate pred, const T& new_value);
967
 
968
  namespace ranges {
969
  template<class I, class O>
970
  using replace_copy_result = in_out_result<I, O>;
971
 
972
- template<input_iterator I, sentinel_for<I> S, class T1, class T2,
973
- output_iterator<const T2&> O, class Proj = identity>
 
974
  requires indirectly_copyable<I, O> &&
975
- indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*>
 
976
  constexpr replace_copy_result<I, O>
977
  replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value,
978
  Proj proj = {});
979
- template<input_range R, class T1, class T2, output_iterator<const T2&> O,
980
- class Proj = identity>
981
  requires indirectly_copyable<iterator_t<R>, O> &&
982
  indirect_binary_predicate<ranges::equal_to,
983
- projected<iterator_t<R>, Proj>, const T1*>
 
984
  constexpr replace_copy_result<borrowed_iterator_t<R>, O>
985
  replace_copy(R&& r, O result, const T1& old_value, const T2& new_value,
986
  Proj proj = {});
987
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
988
  template<class I, class O>
989
  using replace_copy_if_result = in_out_result<I, O>;
990
 
991
- template<input_iterator I, sentinel_for<I> S, class T, output_iterator<const T&> O,
992
  class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
993
- requires indirectly_copyable<I, O>
994
  constexpr replace_copy_if_result<I, O>
995
  replace_copy_if(I first, S last, O result, Pred pred, const T& new_value,
996
  Proj proj = {});
997
- template<input_range R, class T, output_iterator<const T&> O, class Proj = identity,
998
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
999
- requires indirectly_copyable<iterator_t<R>, O>
1000
  constexpr replace_copy_if_result<borrowed_iterator_t<R>, O>
1001
  replace_copy_if(R&& r, O result, Pred pred, const T& new_value,
1002
  Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1003
  }
1004
 
1005
  // [alg.fill], fill
1006
- template<class ForwardIterator, class T>
1007
  constexpr void fill(ForwardIterator first, ForwardIterator last, const T& value);
1008
- template<class ExecutionPolicy, class ForwardIterator, class T>
1009
- void fill(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
 
1010
  ForwardIterator first, ForwardIterator last, const T& value);
1011
- template<class OutputIterator, class Size, class T>
1012
- constexpr OutputIterator fill_n(OutputIterator first, Size n, const T& value);
 
1013
  template<class ExecutionPolicy, class ForwardIterator,
1014
- class Size, class T>
1015
- ForwardIterator fill_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1016
  ForwardIterator first, Size n, const T& value);
1017
 
1018
  namespace ranges {
1019
- template<class T, output_iterator<const T&> O, sentinel_for<O> S>
 
1020
  constexpr O fill(O first, S last, const T& value);
1021
- template<class T, output_range<const T&> R>
 
1022
  constexpr borrowed_iterator_t<R> fill(R&& r, const T& value);
1023
- template<class T, output_iterator<const T&> O>
 
1024
  constexpr O fill_n(O first, iter_difference_t<O> n, const T& value);
 
 
 
 
 
 
 
 
 
 
 
1025
  }
1026
 
1027
  // [alg.generate], generate
1028
  template<class ForwardIterator, class Generator>
1029
  constexpr void generate(ForwardIterator first, ForwardIterator last,
1030
  Generator gen);
1031
  template<class ExecutionPolicy, class ForwardIterator, class Generator>
1032
- void generate(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1033
  ForwardIterator first, ForwardIterator last,
1034
  Generator gen);
1035
  template<class OutputIterator, class Size, class Generator>
1036
  constexpr OutputIterator generate_n(OutputIterator first, Size n, Generator gen);
1037
  template<class ExecutionPolicy, class ForwardIterator, class Size, class Generator>
1038
- ForwardIterator generate_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1039
  ForwardIterator first, Size n, Generator gen);
1040
 
1041
  namespace ranges {
1042
  template<input_or_output_iterator O, sentinel_for<O> S, copy_constructible F>
1043
  requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
@@ -1046,86 +1508,142 @@ namespace std {
1046
  requires invocable<F&> && output_range<R, invoke_result_t<F&>>
1047
  constexpr borrowed_iterator_t<R> generate(R&& r, F gen);
1048
  template<input_or_output_iterator O, copy_constructible F>
1049
  requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
1050
  constexpr O generate_n(O first, iter_difference_t<O> n, F gen);
 
 
 
 
 
 
 
 
 
 
1051
  }
1052
 
1053
  // [alg.remove], remove
1054
- template<class ForwardIterator, class T>
1055
  constexpr ForwardIterator remove(ForwardIterator first, ForwardIterator last,
1056
  const T& value);
1057
- template<class ExecutionPolicy, class ForwardIterator, class T>
1058
- ForwardIterator remove(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
 
1059
  ForwardIterator first, ForwardIterator last,
1060
  const T& value);
1061
  template<class ForwardIterator, class Predicate>
1062
  constexpr ForwardIterator remove_if(ForwardIterator first, ForwardIterator last,
1063
  Predicate pred);
1064
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
1065
- ForwardIterator remove_if(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1066
  ForwardIterator first, ForwardIterator last,
1067
  Predicate pred);
1068
 
1069
  namespace ranges {
1070
- template<permutable I, sentinel_for<I> S, class T, class Proj = identity>
 
1071
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
1072
  constexpr subrange<I> remove(I first, S last, const T& value, Proj proj = {});
1073
- template<forward_range R, class T, class Proj = identity>
 
1074
  requires permutable<iterator_t<R>> &&
1075
  indirect_binary_predicate<ranges::equal_to,
1076
  projected<iterator_t<R>, Proj>, const T*>
1077
  constexpr borrowed_subrange_t<R>
1078
  remove(R&& r, const T& value, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1079
  template<permutable I, sentinel_for<I> S, class Proj = identity,
1080
  indirect_unary_predicate<projected<I, Proj>> Pred>
1081
  constexpr subrange<I> remove_if(I first, S last, Pred pred, Proj proj = {});
1082
  template<forward_range R, class Proj = identity,
1083
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1084
  requires permutable<iterator_t<R>>
1085
  constexpr borrowed_subrange_t<R>
1086
  remove_if(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
1087
  }
1088
 
1089
- template<class InputIterator, class OutputIterator, class T>
 
1090
  constexpr OutputIterator
1091
  remove_copy(InputIterator first, InputIterator last,
1092
  OutputIterator result, const T& value);
1093
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1094
- class T>
1095
  ForwardIterator2
1096
- remove_copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1097
  ForwardIterator1 first, ForwardIterator1 last,
1098
  ForwardIterator2 result, const T& value);
1099
  template<class InputIterator, class OutputIterator, class Predicate>
1100
  constexpr OutputIterator
1101
  remove_copy_if(InputIterator first, InputIterator last,
1102
  OutputIterator result, Predicate pred);
1103
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1104
  class Predicate>
1105
  ForwardIterator2
1106
- remove_copy_if(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1107
  ForwardIterator1 first, ForwardIterator1 last,
1108
  ForwardIterator2 result, Predicate pred);
1109
 
1110
  namespace ranges {
1111
  template<class I, class O>
1112
  using remove_copy_result = in_out_result<I, O>;
1113
 
1114
- template<input_iterator I, sentinel_for<I> S, weakly_incrementable O, class T,
1115
- class Proj = identity>
1116
  requires indirectly_copyable<I, O> &&
1117
  indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
1118
  constexpr remove_copy_result<I, O>
1119
  remove_copy(I first, S last, O result, const T& value, Proj proj = {});
1120
- template<input_range R, weakly_incrementable O, class T, class Proj = identity>
 
1121
  requires indirectly_copyable<iterator_t<R>, O> &&
1122
  indirect_binary_predicate<ranges::equal_to,
1123
  projected<iterator_t<R>, Proj>, const T*>
1124
  constexpr remove_copy_result<borrowed_iterator_t<R>, O>
1125
  remove_copy(R&& r, O result, const T& value, Proj proj = {});
1126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1127
  template<class I, class O>
1128
  using remove_copy_if_result = in_out_result<I, O>;
1129
 
1130
  template<input_iterator I, sentinel_for<I> S, weakly_incrementable O,
1131
  class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
@@ -1135,23 +1653,38 @@ namespace std {
1135
  template<input_range R, weakly_incrementable O, class Proj = identity,
1136
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1137
  requires indirectly_copyable<iterator_t<R>, O>
1138
  constexpr remove_copy_if_result<borrowed_iterator_t<R>, O>
1139
  remove_copy_if(R&& r, O result, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1140
  }
1141
 
1142
  // [alg.unique], unique
1143
  template<class ForwardIterator>
1144
  constexpr ForwardIterator unique(ForwardIterator first, ForwardIterator last);
1145
  template<class ForwardIterator, class BinaryPredicate>
1146
  constexpr ForwardIterator unique(ForwardIterator first, ForwardIterator last,
1147
  BinaryPredicate pred);
1148
  template<class ExecutionPolicy, class ForwardIterator>
1149
- ForwardIterator unique(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1150
  ForwardIterator first, ForwardIterator last);
1151
  template<class ExecutionPolicy, class ForwardIterator, class BinaryPredicate>
1152
- ForwardIterator unique(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1153
  ForwardIterator first, ForwardIterator last,
1154
  BinaryPredicate pred);
1155
 
1156
  namespace ranges {
1157
  template<permutable I, sentinel_for<I> S, class Proj = identity,
@@ -1160,10 +1693,22 @@ namespace std {
1160
  template<forward_range R, class Proj = identity,
1161
  indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
1162
  requires permutable<iterator_t<R>>
1163
  constexpr borrowed_subrange_t<R>
1164
  unique(R&& r, C comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
1165
  }
1166
 
1167
  template<class InputIterator, class OutputIterator>
1168
  constexpr OutputIterator
1169
  unique_copy(InputIterator first, InputIterator last,
@@ -1172,17 +1717,17 @@ namespace std {
1172
  constexpr OutputIterator
1173
  unique_copy(InputIterator first, InputIterator last,
1174
  OutputIterator result, BinaryPredicate pred);
1175
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
1176
  ForwardIterator2
1177
- unique_copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1178
  ForwardIterator1 first, ForwardIterator1 last,
1179
  ForwardIterator2 result);
1180
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1181
  class BinaryPredicate>
1182
  ForwardIterator2
1183
- unique_copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1184
  ForwardIterator1 first, ForwardIterator1 last,
1185
  ForwardIterator2 result, BinaryPredicate pred);
1186
 
1187
  namespace ranges {
1188
  template<class I, class O>
@@ -1202,93 +1747,151 @@ namespace std {
1202
  (forward_iterator<iterator_t<R>> ||
1203
  (input_iterator<O> && same_as<range_value_t<R>, iter_value_t<O>>) ||
1204
  indirectly_copyable_storable<iterator_t<R>, O>)
1205
  constexpr unique_copy_result<borrowed_iterator_t<R>, O>
1206
  unique_copy(R&& r, O result, C comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1207
  }
1208
 
1209
  // [alg.reverse], reverse
1210
  template<class BidirectionalIterator>
1211
  constexpr void reverse(BidirectionalIterator first, BidirectionalIterator last);
1212
  template<class ExecutionPolicy, class BidirectionalIterator>
1213
- void reverse(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1214
  BidirectionalIterator first, BidirectionalIterator last);
1215
 
1216
  namespace ranges {
1217
  template<bidirectional_iterator I, sentinel_for<I> S>
1218
  requires permutable<I>
1219
  constexpr I reverse(I first, S last);
1220
  template<bidirectional_range R>
1221
  requires permutable<iterator_t<R>>
1222
  constexpr borrowed_iterator_t<R> reverse(R&& r);
 
 
 
 
 
 
 
1223
  }
1224
 
1225
  template<class BidirectionalIterator, class OutputIterator>
1226
  constexpr OutputIterator
1227
  reverse_copy(BidirectionalIterator first, BidirectionalIterator last,
1228
  OutputIterator result);
1229
  template<class ExecutionPolicy, class BidirectionalIterator, class ForwardIterator>
1230
  ForwardIterator
1231
- reverse_copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1232
  BidirectionalIterator first, BidirectionalIterator last,
1233
  ForwardIterator result);
1234
 
1235
  namespace ranges {
1236
  template<class I, class O>
1237
  using reverse_copy_result = in_out_result<I, O>;
 
 
1238
 
1239
  template<bidirectional_iterator I, sentinel_for<I> S, weakly_incrementable O>
1240
  requires indirectly_copyable<I, O>
1241
  constexpr reverse_copy_result<I, O>
1242
  reverse_copy(I first, S last, O result);
1243
  template<bidirectional_range R, weakly_incrementable O>
1244
  requires indirectly_copyable<iterator_t<R>, O>
1245
  constexpr reverse_copy_result<borrowed_iterator_t<R>, O>
1246
  reverse_copy(R&& r, O result);
 
 
 
 
 
 
 
 
 
 
 
1247
  }
1248
 
1249
  // [alg.rotate], rotate
1250
  template<class ForwardIterator>
1251
  constexpr ForwardIterator rotate(ForwardIterator first,
1252
  ForwardIterator middle,
1253
  ForwardIterator last);
1254
  template<class ExecutionPolicy, class ForwardIterator>
1255
- ForwardIterator rotate(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1256
  ForwardIterator first,
1257
  ForwardIterator middle,
1258
  ForwardIterator last);
1259
 
1260
  namespace ranges {
1261
  template<permutable I, sentinel_for<I> S>
1262
  constexpr subrange<I> rotate(I first, I middle, S last);
1263
  template<forward_range R>
1264
  requires permutable<iterator_t<R>>
1265
  constexpr borrowed_subrange_t<R> rotate(R&& r, iterator_t<R> middle);
 
 
 
 
 
 
 
 
 
1266
  }
1267
 
1268
  template<class ForwardIterator, class OutputIterator>
1269
  constexpr OutputIterator
1270
  rotate_copy(ForwardIterator first, ForwardIterator middle,
1271
  ForwardIterator last, OutputIterator result);
1272
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
1273
  ForwardIterator2
1274
- rotate_copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1275
  ForwardIterator1 first, ForwardIterator1 middle,
1276
  ForwardIterator1 last, ForwardIterator2 result);
1277
 
1278
  namespace ranges {
1279
  template<class I, class O>
1280
  using rotate_copy_result = in_out_result<I, O>;
 
 
1281
 
1282
  template<forward_iterator I, sentinel_for<I> S, weakly_incrementable O>
1283
  requires indirectly_copyable<I, O>
1284
  constexpr rotate_copy_result<I, O>
1285
  rotate_copy(I first, I middle, S last, O result);
1286
  template<forward_range R, weakly_incrementable O>
1287
  requires indirectly_copyable<iterator_t<R>, O>
1288
  constexpr rotate_copy_result<borrowed_iterator_t<R>, O>
1289
  rotate_copy(R&& r, iterator_t<R> middle, O result);
 
 
 
 
 
 
 
 
 
 
 
 
1290
  }
1291
 
1292
  // [alg.random.sample], sample
1293
  template<class PopulationIterator, class SampleIterator,
1294
  class Distance, class UniformRandomBitGenerator>
@@ -1332,52 +1935,70 @@ namespace std {
1332
  constexpr ForwardIterator
1333
  shift_left(ForwardIterator first, ForwardIterator last,
1334
  typename iterator_traits<ForwardIterator>::difference_type n);
1335
  template<class ExecutionPolicy, class ForwardIterator>
1336
  ForwardIterator
1337
- shift_left(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1338
  ForwardIterator first, ForwardIterator last,
1339
  typename iterator_traits<ForwardIterator>::difference_type n);
1340
 
1341
  namespace ranges {
1342
  template<permutable I, sentinel_for<I> S>
1343
  constexpr subrange<I> shift_left(I first, S last, iter_difference_t<I> n);
1344
  template<forward_range R>
1345
  requires permutable<iterator_t<R>>
1346
  constexpr borrowed_subrange_t<R> shift_left(R&& r, range_difference_t<R> n);
 
 
 
 
 
 
 
 
 
1347
  }
1348
 
1349
  template<class ForwardIterator>
1350
  constexpr ForwardIterator
1351
  shift_right(ForwardIterator first, ForwardIterator last,
1352
  typename iterator_traits<ForwardIterator>::difference_type n);
1353
  template<class ExecutionPolicy, class ForwardIterator>
1354
  ForwardIterator
1355
- shift_right(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1356
  ForwardIterator first, ForwardIterator last,
1357
  typename iterator_traits<ForwardIterator>::difference_type n);
1358
 
1359
  namespace ranges {
1360
  template<permutable I, sentinel_for<I> S>
1361
  constexpr subrange<I> shift_right(I first, S last, iter_difference_t<I> n);
1362
  template<forward_range R>
1363
  requires permutable<iterator_t<R>>
1364
  constexpr borrowed_subrange_t<R> shift_right(R&& r, range_difference_t<R> n);
 
 
 
 
 
 
 
 
 
1365
  }
1366
 
1367
  // [alg.sorting], sorting and related operations
1368
  // [alg.sort], sorting
1369
  template<class RandomAccessIterator>
1370
  constexpr void sort(RandomAccessIterator first, RandomAccessIterator last);
1371
  template<class RandomAccessIterator, class Compare>
1372
  constexpr void sort(RandomAccessIterator first, RandomAccessIterator last,
1373
  Compare comp);
1374
  template<class ExecutionPolicy, class RandomAccessIterator>
1375
- void sort(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1376
  RandomAccessIterator first, RandomAccessIterator last);
1377
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
1378
- void sort(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1379
  RandomAccessIterator first, RandomAccessIterator last,
1380
  Compare comp);
1381
 
1382
  namespace ranges {
1383
  template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
@@ -1387,48 +2008,69 @@ namespace std {
1387
  sort(I first, S last, Comp comp = {}, Proj proj = {});
1388
  template<random_access_range R, class Comp = ranges::less, class Proj = identity>
1389
  requires sortable<iterator_t<R>, Comp, Proj>
1390
  constexpr borrowed_iterator_t<R>
1391
  sort(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
1392
  }
1393
 
1394
  template<class RandomAccessIterator>
1395
- void stable_sort(RandomAccessIterator first, RandomAccessIterator last);
1396
  template<class RandomAccessIterator, class Compare>
1397
- void stable_sort(RandomAccessIterator first, RandomAccessIterator last,
1398
  Compare comp);
1399
  template<class ExecutionPolicy, class RandomAccessIterator>
1400
- void stable_sort(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1401
  RandomAccessIterator first, RandomAccessIterator last);
1402
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
1403
- void stable_sort(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1404
  RandomAccessIterator first, RandomAccessIterator last,
1405
  Compare comp);
1406
 
1407
  namespace ranges {
1408
  template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
1409
  class Proj = identity>
1410
  requires sortable<I, Comp, Proj>
1411
- I stable_sort(I first, S last, Comp comp = {}, Proj proj = {});
1412
  template<random_access_range R, class Comp = ranges::less, class Proj = identity>
1413
  requires sortable<iterator_t<R>, Comp, Proj>
 
 
 
 
 
 
 
 
 
 
 
1414
  borrowed_iterator_t<R>
1415
- stable_sort(R&& r, Comp comp = {}, Proj proj = {});
1416
  }
1417
 
1418
  template<class RandomAccessIterator>
1419
  constexpr void partial_sort(RandomAccessIterator first, RandomAccessIterator middle,
1420
  RandomAccessIterator last);
1421
  template<class RandomAccessIterator, class Compare>
1422
  constexpr void partial_sort(RandomAccessIterator first, RandomAccessIterator middle,
1423
  RandomAccessIterator last, Compare comp);
1424
  template<class ExecutionPolicy, class RandomAccessIterator>
1425
- void partial_sort(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1426
  RandomAccessIterator first, RandomAccessIterator middle,
1427
  RandomAccessIterator last);
1428
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
1429
- void partial_sort(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1430
  RandomAccessIterator first, RandomAccessIterator middle,
1431
  RandomAccessIterator last, Compare comp);
1432
 
1433
  namespace ranges {
1434
  template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
@@ -1439,10 +2081,22 @@ namespace std {
1439
  template<random_access_range R, class Comp = ranges::less, class Proj = identity>
1440
  requires sortable<iterator_t<R>, Comp, Proj>
1441
  constexpr borrowed_iterator_t<R>
1442
  partial_sort(R&& r, iterator_t<R> middle, Comp comp = {},
1443
  Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
1444
  }
1445
 
1446
  template<class InputIterator, class RandomAccessIterator>
1447
  constexpr RandomAccessIterator
1448
  partial_sort_copy(InputIterator first, InputIterator last,
@@ -1454,18 +2108,18 @@ namespace std {
1454
  RandomAccessIterator result_first,
1455
  RandomAccessIterator result_last,
1456
  Compare comp);
1457
  template<class ExecutionPolicy, class ForwardIterator, class RandomAccessIterator>
1458
  RandomAccessIterator
1459
- partial_sort_copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1460
  ForwardIterator first, ForwardIterator last,
1461
  RandomAccessIterator result_first,
1462
  RandomAccessIterator result_last);
1463
  template<class ExecutionPolicy, class ForwardIterator, class RandomAccessIterator,
1464
  class Compare>
1465
  RandomAccessIterator
1466
- partial_sort_copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1467
  ForwardIterator first, ForwardIterator last,
1468
  RandomAccessIterator result_first,
1469
  RandomAccessIterator result_last,
1470
  Compare comp);
1471
 
@@ -1488,32 +2142,60 @@ namespace std {
1488
  indirect_strict_weak_order<Comp, projected<iterator_t<R1>, Proj1>,
1489
  projected<iterator_t<R2>, Proj2>>
1490
  constexpr partial_sort_copy_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
1491
  partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {},
1492
  Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1493
  }
1494
 
1495
  template<class ForwardIterator>
1496
  constexpr bool is_sorted(ForwardIterator first, ForwardIterator last);
1497
  template<class ForwardIterator, class Compare>
1498
  constexpr bool is_sorted(ForwardIterator first, ForwardIterator last,
1499
  Compare comp);
1500
  template<class ExecutionPolicy, class ForwardIterator>
1501
- bool is_sorted(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1502
  ForwardIterator first, ForwardIterator last);
1503
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
1504
- bool is_sorted(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1505
  ForwardIterator first, ForwardIterator last,
1506
  Compare comp);
1507
 
1508
  namespace ranges {
1509
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
1510
  indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
1511
  constexpr bool is_sorted(I first, S last, Comp comp = {}, Proj proj = {});
1512
  template<forward_range R, class Proj = identity,
1513
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
1514
  constexpr bool is_sorted(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
1515
  }
1516
 
1517
  template<class ForwardIterator>
1518
  constexpr ForwardIterator
1519
  is_sorted_until(ForwardIterator first, ForwardIterator last);
@@ -1521,15 +2203,15 @@ namespace std {
1521
  constexpr ForwardIterator
1522
  is_sorted_until(ForwardIterator first, ForwardIterator last,
1523
  Compare comp);
1524
  template<class ExecutionPolicy, class ForwardIterator>
1525
  ForwardIterator
1526
- is_sorted_until(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1527
  ForwardIterator first, ForwardIterator last);
1528
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
1529
  ForwardIterator
1530
- is_sorted_until(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1531
  ForwardIterator first, ForwardIterator last,
1532
  Compare comp);
1533
 
1534
  namespace ranges {
1535
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
@@ -1537,25 +2219,35 @@ namespace std {
1537
  constexpr I is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {});
1538
  template<forward_range R, class Proj = identity,
1539
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
1540
  constexpr borrowed_iterator_t<R>
1541
  is_sorted_until(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
1542
  }
1543
 
1544
  // [alg.nth.element], Nth element
1545
  template<class RandomAccessIterator>
1546
  constexpr void nth_element(RandomAccessIterator first, RandomAccessIterator nth,
1547
  RandomAccessIterator last);
1548
  template<class RandomAccessIterator, class Compare>
1549
  constexpr void nth_element(RandomAccessIterator first, RandomAccessIterator nth,
1550
  RandomAccessIterator last, Compare comp);
1551
  template<class ExecutionPolicy, class RandomAccessIterator>
1552
- void nth_element(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1553
  RandomAccessIterator first, RandomAccessIterator nth,
1554
  RandomAccessIterator last);
1555
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
1556
- void nth_element(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1557
  RandomAccessIterator first, RandomAccessIterator nth,
1558
  RandomAccessIterator last, Compare comp);
1559
 
1560
  namespace ranges {
1561
  template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
@@ -1565,118 +2257,150 @@ namespace std {
1565
  nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {});
1566
  template<random_access_range R, class Comp = ranges::less, class Proj = identity>
1567
  requires sortable<iterator_t<R>, Comp, Proj>
1568
  constexpr borrowed_iterator_t<R>
1569
  nth_element(R&& r, iterator_t<R> nth, Comp comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
1570
  }
1571
 
1572
  // [alg.binary.search], binary search
1573
- template<class ForwardIterator, class T>
1574
  constexpr ForwardIterator
1575
  lower_bound(ForwardIterator first, ForwardIterator last,
1576
  const T& value);
1577
- template<class ForwardIterator, class T, class Compare>
 
1578
  constexpr ForwardIterator
1579
  lower_bound(ForwardIterator first, ForwardIterator last,
1580
  const T& value, Compare comp);
1581
 
1582
  namespace ranges {
1583
- template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
 
1584
  indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
1585
  constexpr I lower_bound(I first, S last, const T& value, Comp comp = {},
1586
  Proj proj = {});
1587
- template<forward_range R, class T, class Proj = identity,
 
1588
  indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
1589
  ranges::less>
1590
  constexpr borrowed_iterator_t<R>
1591
  lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {});
1592
  }
1593
 
1594
- template<class ForwardIterator, class T>
1595
  constexpr ForwardIterator
1596
  upper_bound(ForwardIterator first, ForwardIterator last,
1597
  const T& value);
1598
- template<class ForwardIterator, class T, class Compare>
 
1599
  constexpr ForwardIterator
1600
  upper_bound(ForwardIterator first, ForwardIterator last,
1601
  const T& value, Compare comp);
1602
 
1603
  namespace ranges {
1604
- template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
 
1605
  indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
1606
  constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {});
1607
- template<forward_range R, class T, class Proj = identity,
 
1608
  indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
1609
  ranges::less>
1610
  constexpr borrowed_iterator_t<R>
1611
  upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {});
1612
  }
1613
 
1614
- template<class ForwardIterator, class T>
1615
  constexpr pair<ForwardIterator, ForwardIterator>
1616
  equal_range(ForwardIterator first, ForwardIterator last,
1617
  const T& value);
1618
- template<class ForwardIterator, class T, class Compare>
 
1619
  constexpr pair<ForwardIterator, ForwardIterator>
1620
  equal_range(ForwardIterator first, ForwardIterator last,
1621
  const T& value, Compare comp);
1622
 
1623
  namespace ranges {
1624
- template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
 
1625
  indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
1626
  constexpr subrange<I>
1627
  equal_range(I first, S last, const T& value, Comp comp = {}, Proj proj = {});
1628
- template<forward_range R, class T, class Proj = identity,
 
1629
  indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
1630
  ranges::less>
1631
  constexpr borrowed_subrange_t<R>
1632
  equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {});
1633
  }
1634
 
1635
- template<class ForwardIterator, class T>
1636
  constexpr bool
1637
  binary_search(ForwardIterator first, ForwardIterator last,
1638
  const T& value);
1639
- template<class ForwardIterator, class T, class Compare>
 
1640
  constexpr bool
1641
  binary_search(ForwardIterator first, ForwardIterator last,
1642
  const T& value, Compare comp);
1643
 
1644
  namespace ranges {
1645
- template<forward_iterator I, sentinel_for<I> S, class T, class Proj = identity,
 
1646
  indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
1647
  constexpr bool binary_search(I first, S last, const T& value, Comp comp = {},
1648
  Proj proj = {});
1649
- template<forward_range R, class T, class Proj = identity,
 
1650
  indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
1651
  ranges::less>
1652
  constexpr bool binary_search(R&& r, const T& value, Comp comp = {},
1653
  Proj proj = {});
1654
  }
1655
 
1656
  // [alg.partitions], partitions
1657
  template<class InputIterator, class Predicate>
1658
  constexpr bool is_partitioned(InputIterator first, InputIterator last, Predicate pred);
1659
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
1660
- bool is_partitioned(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1661
  ForwardIterator first, ForwardIterator last, Predicate pred);
1662
 
1663
  namespace ranges {
1664
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
1665
  indirect_unary_predicate<projected<I, Proj>> Pred>
1666
  constexpr bool is_partitioned(I first, S last, Pred pred, Proj proj = {});
1667
  template<input_range R, class Proj = identity,
1668
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1669
  constexpr bool is_partitioned(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
1670
  }
1671
 
1672
  template<class ForwardIterator, class Predicate>
1673
  constexpr ForwardIterator partition(ForwardIterator first,
1674
  ForwardIterator last,
1675
  Predicate pred);
1676
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
1677
- ForwardIterator partition(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1678
  ForwardIterator first,
1679
  ForwardIterator last,
1680
  Predicate pred);
1681
 
1682
  namespace ranges {
@@ -1687,31 +2411,55 @@ namespace std {
1687
  template<forward_range R, class Proj = identity,
1688
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1689
  requires permutable<iterator_t<R>>
1690
  constexpr borrowed_subrange_t<R>
1691
  partition(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
1692
  }
1693
 
1694
  template<class BidirectionalIterator, class Predicate>
1695
- BidirectionalIterator stable_partition(BidirectionalIterator first,
1696
  BidirectionalIterator last,
1697
  Predicate pred);
1698
  template<class ExecutionPolicy, class BidirectionalIterator, class Predicate>
1699
- BidirectionalIterator stable_partition(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1700
- BidirectionalIterator first,
1701
  BidirectionalIterator last,
1702
  Predicate pred);
1703
 
1704
  namespace ranges {
1705
  template<bidirectional_iterator I, sentinel_for<I> S, class Proj = identity,
1706
  indirect_unary_predicate<projected<I, Proj>> Pred>
1707
  requires permutable<I>
1708
- subrange<I> stable_partition(I first, S last, Pred pred, Proj proj = {});
 
1709
  template<bidirectional_range R, class Proj = identity,
1710
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1711
  requires permutable<iterator_t<R>>
1712
- borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
1713
  }
1714
 
1715
  template<class InputIterator, class OutputIterator1,
1716
  class OutputIterator2, class Predicate>
1717
  constexpr pair<OutputIterator1, OutputIterator2>
@@ -1719,11 +2467,11 @@ namespace std {
1719
  OutputIterator1 out_true, OutputIterator2 out_false,
1720
  Predicate pred);
1721
  template<class ExecutionPolicy, class ForwardIterator, class ForwardIterator1,
1722
  class ForwardIterator2, class Predicate>
1723
  pair<ForwardIterator1, ForwardIterator2>
1724
- partition_copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1725
  ForwardIterator first, ForwardIterator last,
1726
  ForwardIterator1 out_true, ForwardIterator2 out_false,
1727
  Predicate pred);
1728
 
1729
  namespace ranges {
@@ -1742,10 +2490,30 @@ namespace std {
1742
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1743
  requires indirectly_copyable<iterator_t<R>, O1> &&
1744
  indirectly_copyable<iterator_t<R>, O2>
1745
  constexpr partition_copy_result<borrowed_iterator_t<R>, O1, O2>
1746
  partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1747
  }
1748
 
1749
  template<class ForwardIterator, class Predicate>
1750
  constexpr ForwardIterator
1751
  partition_point(ForwardIterator first, ForwardIterator last,
@@ -1774,18 +2542,18 @@ namespace std {
1774
  InputIterator2 first2, InputIterator2 last2,
1775
  OutputIterator result, Compare comp);
1776
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1777
  class ForwardIterator>
1778
  ForwardIterator
1779
- merge(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1780
  ForwardIterator1 first1, ForwardIterator1 last1,
1781
  ForwardIterator2 first2, ForwardIterator2 last2,
1782
  ForwardIterator result);
1783
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1784
  class ForwardIterator, class Compare>
1785
  ForwardIterator
1786
- merge(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1787
  ForwardIterator1 first1, ForwardIterator1 last1,
1788
  ForwardIterator2 first2, ForwardIterator2 last2,
1789
  ForwardIterator result, Compare comp);
1790
 
1791
  namespace ranges {
@@ -1803,41 +2571,69 @@ namespace std {
1803
  class Proj1 = identity, class Proj2 = identity>
1804
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
1805
  constexpr merge_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
1806
  merge(R1&& r1, R2&& r2, O result,
1807
  Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1808
  }
1809
 
1810
  template<class BidirectionalIterator>
1811
- void inplace_merge(BidirectionalIterator first,
1812
  BidirectionalIterator middle,
1813
  BidirectionalIterator last);
1814
  template<class BidirectionalIterator, class Compare>
1815
- void inplace_merge(BidirectionalIterator first,
1816
  BidirectionalIterator middle,
1817
  BidirectionalIterator last, Compare comp);
1818
  template<class ExecutionPolicy, class BidirectionalIterator>
1819
- void inplace_merge(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1820
  BidirectionalIterator first,
1821
  BidirectionalIterator middle,
1822
  BidirectionalIterator last);
1823
  template<class ExecutionPolicy, class BidirectionalIterator, class Compare>
1824
- void inplace_merge(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1825
  BidirectionalIterator first,
1826
  BidirectionalIterator middle,
1827
  BidirectionalIterator last, Compare comp);
1828
 
1829
  namespace ranges {
1830
  template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less,
1831
  class Proj = identity>
1832
  requires sortable<I, Comp, Proj>
1833
- I inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {});
 
1834
  template<bidirectional_range R, class Comp = ranges::less, class Proj = identity>
1835
  requires sortable<iterator_t<R>, Comp, Proj>
 
 
 
 
 
 
 
 
 
 
 
1836
  borrowed_iterator_t<R>
1837
- inplace_merge(R&& r, iterator_t<R> middle, Comp comp = {},
1838
- Proj proj = {});
1839
  }
1840
 
1841
  // [alg.set.operations], set operations
1842
  template<class InputIterator1, class InputIterator2>
1843
  constexpr bool includes(InputIterator1 first1, InputIterator1 last1,
@@ -1845,16 +2641,16 @@ namespace std {
1845
  template<class InputIterator1, class InputIterator2, class Compare>
1846
  constexpr bool includes(InputIterator1 first1, InputIterator1 last1,
1847
  InputIterator2 first2, InputIterator2 last2,
1848
  Compare comp);
1849
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
1850
- bool includes(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1851
  ForwardIterator1 first1, ForwardIterator1 last1,
1852
  ForwardIterator2 first2, ForwardIterator2 last2);
1853
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1854
  class Compare>
1855
- bool includes(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1856
  ForwardIterator1 first1, ForwardIterator1 last1,
1857
  ForwardIterator2 first2, ForwardIterator2 last2,
1858
  Compare comp);
1859
 
1860
  namespace ranges {
@@ -1868,10 +2664,24 @@ namespace std {
1868
  class Proj2 = identity,
1869
  indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>,
1870
  projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
1871
  constexpr bool includes(R1&& r1, R2&& r2, Comp comp = {},
1872
  Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1873
  }
1874
 
1875
  template<class InputIterator1, class InputIterator2, class OutputIterator>
1876
  constexpr OutputIterator
1877
  set_union(InputIterator1 first1, InputIterator1 last1,
@@ -1883,18 +2693,18 @@ namespace std {
1883
  InputIterator2 first2, InputIterator2 last2,
1884
  OutputIterator result, Compare comp);
1885
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1886
  class ForwardIterator>
1887
  ForwardIterator
1888
- set_union(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1889
  ForwardIterator1 first1, ForwardIterator1 last1,
1890
  ForwardIterator2 first2, ForwardIterator2 last2,
1891
  ForwardIterator result);
1892
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1893
  class ForwardIterator, class Compare>
1894
  ForwardIterator
1895
- set_union(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1896
  ForwardIterator1 first1, ForwardIterator1 last1,
1897
  ForwardIterator2 first2, ForwardIterator2 last2,
1898
  ForwardIterator result, Compare comp);
1899
 
1900
  namespace ranges {
@@ -1912,10 +2722,28 @@ namespace std {
1912
  class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
1913
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
1914
  constexpr set_union_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
1915
  set_union(R1&& r1, R2&& r2, O result, Comp comp = {},
1916
  Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1917
  }
1918
 
1919
  template<class InputIterator1, class InputIterator2, class OutputIterator>
1920
  constexpr OutputIterator
1921
  set_intersection(InputIterator1 first1, InputIterator1 last1,
@@ -1927,18 +2755,18 @@ namespace std {
1927
  InputIterator2 first2, InputIterator2 last2,
1928
  OutputIterator result, Compare comp);
1929
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1930
  class ForwardIterator>
1931
  ForwardIterator
1932
- set_intersection(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1933
  ForwardIterator1 first1, ForwardIterator1 last1,
1934
  ForwardIterator2 first2, ForwardIterator2 last2,
1935
  ForwardIterator result);
1936
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1937
  class ForwardIterator, class Compare>
1938
  ForwardIterator
1939
- set_intersection(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1940
  ForwardIterator1 first1, ForwardIterator1 last1,
1941
  ForwardIterator2 first2, ForwardIterator2 last2,
1942
  ForwardIterator result, Compare comp);
1943
 
1944
  namespace ranges {
@@ -1956,10 +2784,28 @@ namespace std {
1956
  class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
1957
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
1958
  constexpr set_intersection_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
1959
  set_intersection(R1&& r1, R2&& r2, O result,
1960
  Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1961
  }
1962
 
1963
  template<class InputIterator1, class InputIterator2, class OutputIterator>
1964
  constexpr OutputIterator
1965
  set_difference(InputIterator1 first1, InputIterator1 last1,
@@ -1971,18 +2817,18 @@ namespace std {
1971
  InputIterator2 first2, InputIterator2 last2,
1972
  OutputIterator result, Compare comp);
1973
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1974
  class ForwardIterator>
1975
  ForwardIterator
1976
- set_difference(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1977
  ForwardIterator1 first1, ForwardIterator1 last1,
1978
  ForwardIterator2 first2, ForwardIterator2 last2,
1979
  ForwardIterator result);
1980
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1981
  class ForwardIterator, class Compare>
1982
  ForwardIterator
1983
- set_difference(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
1984
  ForwardIterator1 first1, ForwardIterator1 last1,
1985
  ForwardIterator2 first2, ForwardIterator2 last2,
1986
  ForwardIterator result, Compare comp);
1987
 
1988
  namespace ranges {
@@ -2000,10 +2846,27 @@ namespace std {
2000
  class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
2001
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
2002
  constexpr set_difference_result<borrowed_iterator_t<R1>, O>
2003
  set_difference(R1&& r1, R2&& r2, O result,
2004
  Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2005
  }
2006
 
2007
  template<class InputIterator1, class InputIterator2, class OutputIterator>
2008
  constexpr OutputIterator
2009
  set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
@@ -2015,18 +2878,18 @@ namespace std {
2015
  InputIterator2 first2, InputIterator2 last2,
2016
  OutputIterator result, Compare comp);
2017
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2018
  class ForwardIterator>
2019
  ForwardIterator
2020
- set_symmetric_difference(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2021
  ForwardIterator1 first1, ForwardIterator1 last1,
2022
  ForwardIterator2 first2, ForwardIterator2 last2,
2023
  ForwardIterator result);
2024
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2025
  class ForwardIterator, class Compare>
2026
  ForwardIterator
2027
- set_symmetric_difference(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2028
  ForwardIterator1 first1, ForwardIterator1 last1,
2029
  ForwardIterator2 first2, ForwardIterator2 last2,
2030
  ForwardIterator result, Compare comp);
2031
 
2032
  namespace ranges {
@@ -2046,10 +2909,28 @@ namespace std {
2046
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
2047
  constexpr set_symmetric_difference_result<borrowed_iterator_t<R1>,
2048
  borrowed_iterator_t<R2>, O>
2049
  set_symmetric_difference(R1&& r1, R2&& r2, O result, Comp comp = {},
2050
  Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2051
  }
2052
 
2053
  // [alg.heap.operations], heap operations
2054
  template<class RandomAccessIterator>
2055
  constexpr void push_heap(RandomAccessIterator first, RandomAccessIterator last);
@@ -2127,24 +3008,33 @@ namespace std {
2127
  constexpr bool is_heap(RandomAccessIterator first, RandomAccessIterator last);
2128
  template<class RandomAccessIterator, class Compare>
2129
  constexpr bool is_heap(RandomAccessIterator first, RandomAccessIterator last,
2130
  Compare comp);
2131
  template<class ExecutionPolicy, class RandomAccessIterator>
2132
- bool is_heap(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2133
  RandomAccessIterator first, RandomAccessIterator last);
2134
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
2135
- bool is_heap(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2136
  RandomAccessIterator first, RandomAccessIterator last,
2137
  Compare comp);
2138
 
2139
  namespace ranges {
2140
  template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
2141
  indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
2142
  constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {});
2143
  template<random_access_range R, class Proj = identity,
2144
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2145
  constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
2146
  }
2147
 
2148
  template<class RandomAccessIterator>
2149
  constexpr RandomAccessIterator
2150
  is_heap_until(RandomAccessIterator first, RandomAccessIterator last);
@@ -2152,15 +3042,15 @@ namespace std {
2152
  constexpr RandomAccessIterator
2153
  is_heap_until(RandomAccessIterator first, RandomAccessIterator last,
2154
  Compare comp);
2155
  template<class ExecutionPolicy, class RandomAccessIterator>
2156
  RandomAccessIterator
2157
- is_heap_until(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2158
  RandomAccessIterator first, RandomAccessIterator last);
2159
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
2160
  RandomAccessIterator
2161
- is_heap_until(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2162
  RandomAccessIterator first, RandomAccessIterator last,
2163
  Compare comp);
2164
 
2165
  namespace ranges {
2166
  template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
@@ -2168,10 +3058,20 @@ namespace std {
2168
  constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {});
2169
  template<random_access_range R, class Proj = identity,
2170
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2171
  constexpr borrowed_iterator_t<R>
2172
  is_heap_until(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
2173
  }
2174
 
2175
  // [alg.min.max], minimum and maximum
2176
  template<class T> constexpr const T& min(const T& a, const T& b);
2177
  template<class T, class Compare>
@@ -2191,10 +3091,15 @@ namespace std {
2191
  template<input_range R, class Proj = identity,
2192
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2193
  requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
2194
  constexpr range_value_t<R>
2195
  min(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
2196
  }
2197
 
2198
  template<class T> constexpr const T& max(const T& a, const T& b);
2199
  template<class T, class Compare>
2200
  constexpr const T& max(const T& a, const T& b, Compare comp);
@@ -2213,10 +3118,15 @@ namespace std {
2213
  template<input_range R, class Proj = identity,
2214
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2215
  requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
2216
  constexpr range_value_t<R>
2217
  max(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
2218
  }
2219
 
2220
  template<class T> constexpr pair<const T&, const T&> minmax(const T& a, const T& b);
2221
  template<class T, class Compare>
2222
  constexpr pair<const T&, const T&> minmax(const T& a, const T& b, Compare comp);
@@ -2240,22 +3150,27 @@ namespace std {
2240
  template<input_range R, class Proj = identity,
2241
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2242
  requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
2243
  constexpr minmax_result<range_value_t<R>>
2244
  minmax(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
2245
  }
2246
 
2247
  template<class ForwardIterator>
2248
  constexpr ForwardIterator min_element(ForwardIterator first, ForwardIterator last);
2249
  template<class ForwardIterator, class Compare>
2250
  constexpr ForwardIterator min_element(ForwardIterator first, ForwardIterator last,
2251
  Compare comp);
2252
  template<class ExecutionPolicy, class ForwardIterator>
2253
- ForwardIterator min_element(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2254
  ForwardIterator first, ForwardIterator last);
2255
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
2256
- ForwardIterator min_element(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2257
  ForwardIterator first, ForwardIterator last,
2258
  Compare comp);
2259
 
2260
  namespace ranges {
2261
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
@@ -2263,22 +3178,33 @@ namespace std {
2263
  constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {});
2264
  template<forward_range R, class Proj = identity,
2265
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2266
  constexpr borrowed_iterator_t<R>
2267
  min_element(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
2268
  }
2269
 
2270
  template<class ForwardIterator>
2271
  constexpr ForwardIterator max_element(ForwardIterator first, ForwardIterator last);
2272
  template<class ForwardIterator, class Compare>
2273
  constexpr ForwardIterator max_element(ForwardIterator first, ForwardIterator last,
2274
  Compare comp);
2275
  template<class ExecutionPolicy, class ForwardIterator>
2276
- ForwardIterator max_element(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2277
  ForwardIterator first, ForwardIterator last);
2278
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
2279
- ForwardIterator max_element(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2280
  ForwardIterator first, ForwardIterator last,
2281
  Compare comp);
2282
 
2283
  namespace ranges {
2284
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
@@ -2286,25 +3212,36 @@ namespace std {
2286
  constexpr I max_element(I first, S last, Comp comp = {}, Proj proj = {});
2287
  template<forward_range R, class Proj = identity,
2288
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2289
  constexpr borrowed_iterator_t<R>
2290
  max_element(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
2291
  }
2292
 
2293
  template<class ForwardIterator>
2294
  constexpr pair<ForwardIterator, ForwardIterator>
2295
  minmax_element(ForwardIterator first, ForwardIterator last);
2296
  template<class ForwardIterator, class Compare>
2297
  constexpr pair<ForwardIterator, ForwardIterator>
2298
  minmax_element(ForwardIterator first, ForwardIterator last, Compare comp);
2299
  template<class ExecutionPolicy, class ForwardIterator>
2300
  pair<ForwardIterator, ForwardIterator>
2301
- minmax_element(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2302
  ForwardIterator first, ForwardIterator last);
2303
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
2304
  pair<ForwardIterator, ForwardIterator>
2305
- minmax_element(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2306
  ForwardIterator first, ForwardIterator last, Compare comp);
2307
 
2308
  namespace ranges {
2309
  template<class I>
2310
  using minmax_element_result = min_max_result<I>;
@@ -2315,10 +3252,21 @@ namespace std {
2315
  minmax_element(I first, S last, Comp comp = {}, Proj proj = {});
2316
  template<forward_range R, class Proj = identity,
2317
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2318
  constexpr minmax_element_result<borrowed_iterator_t<R>>
2319
  minmax_element(R&& r, Comp comp = {}, Proj proj = {});
 
 
 
 
 
 
 
 
 
 
 
2320
  }
2321
 
2322
  // [alg.clamp], bounded value
2323
  template<class T>
2324
  constexpr const T& clamp(const T& v, const T& lo, const T& hi);
@@ -2342,17 +3290,17 @@ namespace std {
2342
  lexicographical_compare(InputIterator1 first1, InputIterator1 last1,
2343
  InputIterator2 first2, InputIterator2 last2,
2344
  Compare comp);
2345
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
2346
  bool
2347
- lexicographical_compare(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2348
  ForwardIterator1 first1, ForwardIterator1 last1,
2349
  ForwardIterator2 first2, ForwardIterator2 last2);
2350
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2351
  class Compare>
2352
  bool
2353
- lexicographical_compare(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads]
2354
  ForwardIterator1 first1, ForwardIterator1 last1,
2355
  ForwardIterator2 first2, ForwardIterator2 last2,
2356
  Compare comp);
2357
 
2358
  namespace ranges {
@@ -2368,10 +3316,25 @@ namespace std {
2368
  indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>,
2369
  projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
2370
  constexpr bool
2371
  lexicographical_compare(R1&& r1, R2&& r2, Comp comp = {},
2372
  Proj1 proj1 = {}, Proj2 proj2 = {});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2373
  }
2374
 
2375
  // [alg.three.way], three-way comparison algorithms
2376
  template<class InputIterator1, class InputIterator2, class Cmp>
2377
  constexpr auto
 
1
  ## Header `<algorithm>` synopsis <a id="algorithm.syn">[[algorithm.syn]]</a>
2
 
3
  ``` cpp
4
+ // mostly freestanding
5
  #include <initializer_list> // see [initializer.list.syn]
6
 
7
  namespace std {
8
  namespace ranges {
9
  // [algorithms.results], algorithm result types
 
38
  // [alg.nonmodifying], non-modifying sequence operations
39
  // [alg.all.of], all of
40
  template<class InputIterator, class Predicate>
41
  constexpr bool all_of(InputIterator first, InputIterator last, Predicate pred);
42
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
43
+ bool all_of(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
44
  ForwardIterator first, ForwardIterator last, Predicate pred);
45
 
46
  namespace ranges {
47
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
48
  indirect_unary_predicate<projected<I, Proj>> Pred>
49
  constexpr bool all_of(I first, S last, Pred pred, Proj proj = {});
50
  template<input_range R, class Proj = identity,
51
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
52
  constexpr bool all_of(R&& r, Pred pred, Proj proj = {});
53
+
54
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
55
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
56
+ bool all_of(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); // freestanding-deleted
57
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
58
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
59
+ bool all_of(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
60
  }
61
 
62
  // [alg.any.of], any of
63
  template<class InputIterator, class Predicate>
64
  constexpr bool any_of(InputIterator first, InputIterator last, Predicate pred);
65
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
66
+ bool any_of(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
67
  ForwardIterator first, ForwardIterator last, Predicate pred);
68
 
69
  namespace ranges {
70
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
71
  indirect_unary_predicate<projected<I, Proj>> Pred>
72
  constexpr bool any_of(I first, S last, Pred pred, Proj proj = {});
73
  template<input_range R, class Proj = identity,
74
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
75
  constexpr bool any_of(R&& r, Pred pred, Proj proj = {});
76
+
77
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
78
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
79
+ bool any_of(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); // freestanding-deleted
80
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
81
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
82
+ bool any_of(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
83
  }
84
 
85
  // [alg.none.of], none of
86
  template<class InputIterator, class Predicate>
87
  constexpr bool none_of(InputIterator first, InputIterator last, Predicate pred);
88
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
89
+ bool none_of(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
90
  ForwardIterator first, ForwardIterator last, Predicate pred);
91
 
92
  namespace ranges {
93
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
94
  indirect_unary_predicate<projected<I, Proj>> Pred>
95
  constexpr bool none_of(I first, S last, Pred pred, Proj proj = {});
96
  template<input_range R, class Proj = identity,
97
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
98
  constexpr bool none_of(R&& r, Pred pred, Proj proj = {});
99
+
100
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
101
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
102
+ bool none_of(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); // freestanding-deleted
103
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
104
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
105
+ bool none_of(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
106
  }
107
 
108
  // [alg.contains], contains
109
  namespace ranges {
110
+ template<input_iterator I, sentinel_for<I> S, class Proj = identity,
111
+ class T = projected_value_t<I, Proj>>
112
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
113
  constexpr bool contains(I first, S last, const T& value, Proj proj = {});
114
+ template<input_range R, class Proj = identity,
115
+ class T = projected_value_t<iterator_t<R>, Proj>>
116
  requires
117
  indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
118
  constexpr bool contains(R&& r, const T& value, Proj proj = {});
119
 
120
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
121
+ class Proj = identity, class T = projected_value_t<I, Proj>>
122
+ requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
123
+ bool contains(Ep&& exec, I first, S last, const T& value,
124
+ Proj proj = {}); // freestanding-deleted
125
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
126
+ class T = projected_value_t<iterator_t<R>, Proj>>
127
+ requires
128
+ indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
129
+ bool contains(Ep&& exec, R&& r, const T& value, Proj proj = {}); // freestanding-deleted
130
+
131
  template<forward_iterator I1, sentinel_for<I1> S1,
132
  forward_iterator I2, sentinel_for<I2> S2,
133
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
134
  requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
135
  constexpr bool contains_subrange(I1 first1, S1 last1, I2 first2, S2 last2,
 
137
  template<forward_range R1, forward_range R2,
138
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
139
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
140
  constexpr bool contains_subrange(R1&& r1, R2&& r2,
141
  Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
142
+
143
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
144
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
145
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
146
+ requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
147
+ bool contains_subrange(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
148
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
149
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
150
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
151
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
152
+ bool contains_subrange(Ep&& exec, R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {},
153
+ Proj2 proj2 = {}); // freestanding-deleted
154
  }
155
 
156
  // [alg.foreach], for each
157
  template<class InputIterator, class Function>
158
  constexpr Function for_each(InputIterator first, InputIterator last, Function f);
159
  template<class ExecutionPolicy, class ForwardIterator, class Function>
160
+ void for_each(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
161
  ForwardIterator first, ForwardIterator last, Function f);
162
 
163
  namespace ranges {
164
  template<class I, class F>
165
  using for_each_result = in_fun_result<I, F>;
 
170
  for_each(I first, S last, Fun f, Proj proj = {});
171
  template<input_range R, class Proj = identity,
172
  indirectly_unary_invocable<projected<iterator_t<R>, Proj>> Fun>
173
  constexpr for_each_result<borrowed_iterator_t<R>, Fun>
174
  for_each(R&& r, Fun f, Proj proj = {});
175
+
176
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
177
+ class Proj = identity,
178
+ indirectly_unary_invocable<projected<I, Proj>> Fun>
179
+ I for_each(Ep&& exec, I first, S last, Fun f, Proj proj = {}); // freestanding-deleted
180
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
181
+ indirectly_unary_invocable<projected<iterator_t<R>, Proj>> Fun>
182
+ borrowed_iterator_t<R>
183
+ for_each(Ep&& exec, R&& r, Fun f, Proj proj = {}); // freestanding-deleted
184
  }
185
 
186
  template<class InputIterator, class Size, class Function>
187
  constexpr InputIterator for_each_n(InputIterator first, Size n, Function f);
188
  template<class ExecutionPolicy, class ForwardIterator, class Size, class Function>
189
+ ForwardIterator for_each_n(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
190
  ForwardIterator first, Size n, Function f);
191
 
192
  namespace ranges {
193
  template<class I, class F>
194
  using for_each_n_result = in_fun_result<I, F>;
195
 
196
  template<input_iterator I, class Proj = identity,
197
  indirectly_unary_invocable<projected<I, Proj>> Fun>
198
  constexpr for_each_n_result<I, Fun>
199
  for_each_n(I first, iter_difference_t<I> n, Fun f, Proj proj = {});
200
+
201
+ template<execution-policy Ep, random_access_iterator I, class Proj = identity,
202
+ indirectly_unary_invocable<projected<I, Proj>> Fun>
203
+ I for_each_n(Ep&& exec, I first, iter_difference_t<I> n, Fun f,
204
+ Proj proj = {}); // freestanding-deleted
205
  }
206
 
207
  // [alg.find], find
208
+ template<class InputIterator, class T = iterator_traits<InputIterator>::value_type>
209
  constexpr InputIterator find(InputIterator first, InputIterator last,
210
  const T& value);
211
+ template<class ExecutionPolicy, class ForwardIterator,
212
+ class T = iterator_traits<ForwardIterator>::value_type>
213
+ ForwardIterator find(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
214
  ForwardIterator first, ForwardIterator last,
215
  const T& value);
216
  template<class InputIterator, class Predicate>
217
  constexpr InputIterator find_if(InputIterator first, InputIterator last,
218
  Predicate pred);
219
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
220
+ ForwardIterator find_if(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
221
  ForwardIterator first, ForwardIterator last,
222
  Predicate pred);
223
  template<class InputIterator, class Predicate>
224
  constexpr InputIterator find_if_not(InputIterator first, InputIterator last,
225
  Predicate pred);
226
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
227
+ ForwardIterator find_if_not(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
228
  ForwardIterator first, ForwardIterator last,
229
  Predicate pred);
230
 
231
  namespace ranges {
232
+ template<input_iterator I, sentinel_for<I> S, class Proj = identity,
233
+ class T = projected_value_t<I, Proj>>
234
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
235
  constexpr I find(I first, S last, const T& value, Proj proj = {});
236
+ template<input_range R, class Proj = identity,
237
+ class T = projected_value_t<iterator_t<R>, Proj>>
238
  requires indirect_binary_predicate<ranges::equal_to,
239
  projected<iterator_t<R>, Proj>, const T*>
240
  constexpr borrowed_iterator_t<R>
241
  find(R&& r, const T& value, Proj proj = {});
242
+
243
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
244
+ class Proj = identity, class T = projected_value_t<I, Proj>>
245
+ requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
246
+ I find(Ep&& exec, I first, S last, const T& value, Proj proj = {}); // freestanding-deleted
247
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
248
+ class T = projected_value_t<iterator_t<R>, Proj>>
249
+ requires indirect_binary_predicate<ranges::equal_to,
250
+ projected<iterator_t<R>, Proj>, const T*>
251
+ borrowed_iterator_t<R>
252
+ find(Ep&& exec, R&& r, const T& value, Proj proj = {}); // freestanding-deleted
253
+
254
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
255
  indirect_unary_predicate<projected<I, Proj>> Pred>
256
  constexpr I find_if(I first, S last, Pred pred, Proj proj = {});
257
  template<input_range R, class Proj = identity,
258
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
259
  constexpr borrowed_iterator_t<R>
260
  find_if(R&& r, Pred pred, Proj proj = {});
261
+
262
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
263
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
264
+ I find_if(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); // freestanding-deleted
265
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
266
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
267
+ borrowed_iterator_t<R>
268
+ find_if(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
269
+
270
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
271
  indirect_unary_predicate<projected<I, Proj>> Pred>
272
  constexpr I find_if_not(I first, S last, Pred pred, Proj proj = {});
273
  template<input_range R, class Proj = identity,
274
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
275
  constexpr borrowed_iterator_t<R>
276
  find_if_not(R&& r, Pred pred, Proj proj = {});
277
+
278
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
279
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
280
+ I find_if_not(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); // freestanding-deleted
281
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
282
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
283
+ borrowed_iterator_t<R>
284
+ find_if_not(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
285
  }
286
 
287
  // [alg.find.last], find last
288
  namespace ranges {
289
+ template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
290
+ class T = projected_value_t<I, Proj>>
291
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
292
  constexpr subrange<I> find_last(I first, S last, const T& value, Proj proj = {});
293
+ template<forward_range R, class Proj = identity,
294
+ class T = projected_value_t<iterator_t<R>, Proj>>
295
  requires
296
  indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
297
  constexpr borrowed_subrange_t<R> find_last(R&& r, const T& value, Proj proj = {});
298
+
299
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
300
+ class Proj = identity, class T = projected_value_t<I, Proj>>
301
+ requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
302
+ subrange<I>
303
+ find_last(Ep&& exec, I first, S last, const T& value,
304
+ Proj proj = {}); // freestanding-deleted
305
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
306
+ class T = projected_value_t<iterator_t<R>, Proj>>
307
+ requires
308
+ indirect_binary_predicate<ranges::equal_to, projected<iterator_t<R>, Proj>, const T*>
309
+ borrowed_subrange_t<R>
310
+ find_last(Ep&& exec, R&& r, const T& value, Proj proj = {}); // freestanding-deleted
311
+
312
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
313
  indirect_unary_predicate<projected<I, Proj>> Pred>
314
  constexpr subrange<I> find_last_if(I first, S last, Pred pred, Proj proj = {});
315
  template<forward_range R, class Proj = identity,
316
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
317
  constexpr borrowed_subrange_t<R> find_last_if(R&& r, Pred pred, Proj proj = {});
318
+
319
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
320
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
321
+ subrange<I>
322
+ find_last_if(Ep&& exec, I first, S last, Pred pred,
323
+ Proj proj = {}); // freestanding-deleted
324
+ template<execution-policy Ep, sized-random-access-range R,
325
+ class Proj = identity,
326
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
327
+ borrowed_subrange_t<R>
328
+ find_last_if(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
329
+
330
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
331
  indirect_unary_predicate<projected<I, Proj>> Pred>
332
  constexpr subrange<I> find_last_if_not(I first, S last, Pred pred, Proj proj = {});
333
  template<forward_range R, class Proj = identity,
334
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
335
  constexpr borrowed_subrange_t<R> find_last_if_not(R&& r, Pred pred, Proj proj = {});
336
+
337
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
338
+ class Proj = identity,
339
+ indirect_unary_predicate<projected<I, Proj>> Pred>
340
+ subrange<I>
341
+ find_last_if_not(Ep&& exec, I first, S last, Pred pred,
342
+ Proj proj = {}); // freestanding-deleted
343
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
344
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
345
+ borrowed_subrange_t<R>
346
+ find_last_if_not(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
347
  }
348
 
349
  // [alg.find.end], find end
350
  template<class ForwardIterator1, class ForwardIterator2>
351
  constexpr ForwardIterator1
 
356
  find_end(ForwardIterator1 first1, ForwardIterator1 last1,
357
  ForwardIterator2 first2, ForwardIterator2 last2,
358
  BinaryPredicate pred);
359
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
360
  ForwardIterator1
361
+ find_end(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
362
  ForwardIterator1 first1, ForwardIterator1 last1,
363
  ForwardIterator2 first2, ForwardIterator2 last2);
364
  template<class ExecutionPolicy, class ForwardIterator1,
365
  class ForwardIterator2, class BinaryPredicate>
366
  ForwardIterator1
367
+ find_end(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
368
  ForwardIterator1 first1, ForwardIterator1 last1,
369
  ForwardIterator2 first2, ForwardIterator2 last2,
370
  BinaryPredicate pred);
371
 
372
  namespace ranges {
 
380
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
381
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
382
  constexpr borrowed_subrange_t<R1>
383
  find_end(R1&& r1, R2&& r2, Pred pred = {},
384
  Proj1 proj1 = {}, Proj2 proj2 = {});
385
+
386
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
387
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
388
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
389
+ requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
390
+ subrange<I1>
391
+ find_end(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
392
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
393
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
394
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
395
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
396
+ borrowed_subrange_t<R1>
397
+ find_end(Ep&& exec, R1&& r1, R2&& r2, Pred pred = {},
398
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
399
  }
400
 
401
+ // [alg.find.first.of], find first of
402
  template<class InputIterator, class ForwardIterator>
403
  constexpr InputIterator
404
  find_first_of(InputIterator first1, InputIterator last1,
405
  ForwardIterator first2, ForwardIterator last2);
406
  template<class InputIterator, class ForwardIterator, class BinaryPredicate>
 
408
  find_first_of(InputIterator first1, InputIterator last1,
409
  ForwardIterator first2, ForwardIterator last2,
410
  BinaryPredicate pred);
411
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
412
  ForwardIterator1
413
+ find_first_of(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
414
  ForwardIterator1 first1, ForwardIterator1 last1,
415
  ForwardIterator2 first2, ForwardIterator2 last2);
416
  template<class ExecutionPolicy, class ForwardIterator1,
417
  class ForwardIterator2, class BinaryPredicate>
418
  ForwardIterator1
419
+ find_first_of(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
420
  ForwardIterator1 first1, ForwardIterator1 last1,
421
  ForwardIterator2 first2, ForwardIterator2 last2,
422
  BinaryPredicate pred);
423
 
424
  namespace ranges {
 
431
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
432
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
433
  constexpr borrowed_iterator_t<R1>
434
  find_first_of(R1&& r1, R2&& r2, Pred pred = {},
435
  Proj1 proj1 = {}, Proj2 proj2 = {});
436
+
437
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
438
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
439
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
440
+ requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
441
+ I1 find_first_of(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
442
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
443
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
444
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
445
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
446
+ borrowed_iterator_t<R1>
447
+ find_first_of(Ep&& exec, R1&& r1, R2&& r2, Pred pred = {},
448
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
449
  }
450
 
451
  // [alg.adjacent.find], adjacent find
452
  template<class ForwardIterator>
453
  constexpr ForwardIterator
 
456
  constexpr ForwardIterator
457
  adjacent_find(ForwardIterator first, ForwardIterator last,
458
  BinaryPredicate pred);
459
  template<class ExecutionPolicy, class ForwardIterator>
460
  ForwardIterator
461
+ adjacent_find(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
462
  ForwardIterator first, ForwardIterator last);
463
  template<class ExecutionPolicy, class ForwardIterator, class BinaryPredicate>
464
  ForwardIterator
465
+ adjacent_find(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
466
  ForwardIterator first, ForwardIterator last,
467
  BinaryPredicate pred);
468
 
469
  namespace ranges {
470
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
 
475
  template<forward_range R, class Proj = identity,
476
  indirect_binary_predicate<projected<iterator_t<R>, Proj>,
477
  projected<iterator_t<R>, Proj>> Pred = ranges::equal_to>
478
  constexpr borrowed_iterator_t<R>
479
  adjacent_find(R&& r, Pred pred = {}, Proj proj = {});
480
+
481
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
482
+ class Proj = identity,
483
+ indirect_binary_predicate<projected<I, Proj>,
484
+ projected<I, Proj>> Pred = ranges::equal_to>
485
+ I adjacent_find(Ep&& exec, I first, S last, Pred pred = {},
486
+ Proj proj = {}); // freestanding-deleted
487
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
488
+ indirect_binary_predicate<projected<iterator_t<R>, Proj>,
489
+ projected<iterator_t<R>, Proj>> Pred = ranges::equal_to>
490
+ borrowed_iterator_t<R>
491
+ adjacent_find(Ep&& exec, R&& r, Pred pred = {}, Proj proj = {}); // freestanding-deleted
492
  }
493
 
494
  // [alg.count], count
495
+ template<class InputIterator, class T = iterator_traits<InputIterator>::value_type>
496
  constexpr typename iterator_traits<InputIterator>::difference_type
497
  count(InputIterator first, InputIterator last, const T& value);
498
+ template<class ExecutionPolicy, class ForwardIterator,
499
+ class T = iterator_traits<ForwardIterator>::value_type>
500
  typename iterator_traits<ForwardIterator>::difference_type
501
+ count(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
502
  ForwardIterator first, ForwardIterator last, const T& value);
503
  template<class InputIterator, class Predicate>
504
  constexpr typename iterator_traits<InputIterator>::difference_type
505
  count_if(InputIterator first, InputIterator last, Predicate pred);
506
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
507
  typename iterator_traits<ForwardIterator>::difference_type
508
+ count_if(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
509
  ForwardIterator first, ForwardIterator last, Predicate pred);
510
 
511
  namespace ranges {
512
+ template<input_iterator I, sentinel_for<I> S, class Proj = identity,
513
+ class T = projected_value_t<I, Proj>>
514
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
515
  constexpr iter_difference_t<I>
516
  count(I first, S last, const T& value, Proj proj = {});
517
+ template<input_range R, class Proj = identity,
518
+ class T = projected_value_t<iterator_t<R>, Proj>>
519
  requires indirect_binary_predicate<ranges::equal_to,
520
  projected<iterator_t<R>, Proj>, const T*>
521
  constexpr range_difference_t<R>
522
  count(R&& r, const T& value, Proj proj = {});
523
+
524
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
525
+ class Proj = identity, class T = projected_value_t<I, Proj>>
526
+ requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
527
+ iter_difference_t<I>
528
+ count(Ep&& exec, I first, S last, const T& value, Proj proj = {}); // freestanding-deleted
529
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
530
+ class T = projected_value_t<iterator_t<R>, Proj>>
531
+ requires indirect_binary_predicate<ranges::equal_to,
532
+ projected<iterator_t<R>, Proj>, const T*>
533
+ range_difference_t<R>
534
+ count(Ep&& exec, R&& r, const T& value, Proj proj = {}); // freestanding-deleted
535
+
536
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
537
  indirect_unary_predicate<projected<I, Proj>> Pred>
538
  constexpr iter_difference_t<I>
539
  count_if(I first, S last, Pred pred, Proj proj = {});
540
  template<input_range R, class Proj = identity,
541
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
542
  constexpr range_difference_t<R>
543
  count_if(R&& r, Pred pred, Proj proj = {});
544
+
545
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
546
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
547
+ iter_difference_t<I>
548
+ count_if(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); // freestanding-deleted
549
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
550
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
551
+ range_difference_t<R>
552
+ count_if(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
553
  }
554
 
555
+ // [alg.mismatch], mismatch
556
  template<class InputIterator1, class InputIterator2>
557
  constexpr pair<InputIterator1, InputIterator2>
558
  mismatch(InputIterator1 first1, InputIterator1 last1,
559
  InputIterator2 first2);
560
  template<class InputIterator1, class InputIterator2, class BinaryPredicate>
 
570
  mismatch(InputIterator1 first1, InputIterator1 last1,
571
  InputIterator2 first2, InputIterator2 last2,
572
  BinaryPredicate pred);
573
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
574
  pair<ForwardIterator1, ForwardIterator2>
575
+ mismatch(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
576
  ForwardIterator1 first1, ForwardIterator1 last1,
577
  ForwardIterator2 first2);
578
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
579
  class BinaryPredicate>
580
  pair<ForwardIterator1, ForwardIterator2>
581
+ mismatch(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
582
  ForwardIterator1 first1, ForwardIterator1 last1,
583
  ForwardIterator2 first2, BinaryPredicate pred);
584
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
585
  pair<ForwardIterator1, ForwardIterator2>
586
+ mismatch(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
587
  ForwardIterator1 first1, ForwardIterator1 last1,
588
  ForwardIterator2 first2, ForwardIterator2 last2);
589
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
590
  class BinaryPredicate>
591
  pair<ForwardIterator1, ForwardIterator2>
592
+ mismatch(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
593
  ForwardIterator1 first1, ForwardIterator1 last1,
594
  ForwardIterator2 first2, ForwardIterator2 last2,
595
  BinaryPredicate pred);
596
 
597
  namespace ranges {
 
608
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
609
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
610
  constexpr mismatch_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
611
  mismatch(R1&& r1, R2&& r2, Pred pred = {},
612
  Proj1 proj1 = {}, Proj2 proj2 = {});
613
+
614
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
615
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
616
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
617
+ requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
618
+ mismatch_result<I1, I2>
619
+ mismatch(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {},
620
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
621
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
622
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
623
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
624
+ mismatch_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
625
+ mismatch(Ep&& exec, R1&& r1, R2&& r2, Pred pred = {},
626
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
627
  }
628
 
629
  // [alg.equal], equal
630
  template<class InputIterator1, class InputIterator2>
631
  constexpr bool equal(InputIterator1 first1, InputIterator1 last1,
 
639
  template<class InputIterator1, class InputIterator2, class BinaryPredicate>
640
  constexpr bool equal(InputIterator1 first1, InputIterator1 last1,
641
  InputIterator2 first2, InputIterator2 last2,
642
  BinaryPredicate pred);
643
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
644
+ bool equal(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
645
  ForwardIterator1 first1, ForwardIterator1 last1,
646
  ForwardIterator2 first2);
647
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
648
  class BinaryPredicate>
649
+ bool equal(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
650
  ForwardIterator1 first1, ForwardIterator1 last1,
651
  ForwardIterator2 first2, BinaryPredicate pred);
652
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
653
+ bool equal(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
654
  ForwardIterator1 first1, ForwardIterator1 last1,
655
  ForwardIterator2 first2, ForwardIterator2 last2);
656
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
657
  class BinaryPredicate>
658
+ bool equal(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
659
  ForwardIterator1 first1, ForwardIterator1 last1,
660
  ForwardIterator2 first2, ForwardIterator2 last2,
661
  BinaryPredicate pred);
662
 
663
  namespace ranges {
 
670
  template<input_range R1, input_range R2, class Pred = ranges::equal_to,
671
  class Proj1 = identity, class Proj2 = identity>
672
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
673
  constexpr bool equal(R1&& r1, R2&& r2, Pred pred = {},
674
  Proj1 proj1 = {}, Proj2 proj2 = {});
675
+
676
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
677
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
678
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
679
+ requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
680
+ bool equal(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2,
681
+ Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
682
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
683
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
684
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
685
+ bool equal(Ep&& exec, R1&& r1, R2&& r2,
686
+ Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
687
  }
688
 
689
  // [alg.is.permutation], is permutation
690
  template<class ForwardIterator1, class ForwardIterator2>
691
  constexpr bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
 
728
  search(ForwardIterator1 first1, ForwardIterator1 last1,
729
  ForwardIterator2 first2, ForwardIterator2 last2,
730
  BinaryPredicate pred);
731
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
732
  ForwardIterator1
733
+ search(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
734
  ForwardIterator1 first1, ForwardIterator1 last1,
735
  ForwardIterator2 first2, ForwardIterator2 last2);
736
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
737
  class BinaryPredicate>
738
  ForwardIterator1
739
+ search(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
740
  ForwardIterator1 first1, ForwardIterator1 last1,
741
  ForwardIterator2 first2, ForwardIterator2 last2,
742
  BinaryPredicate pred);
743
 
744
  namespace ranges {
 
753
  class Proj1 = identity, class Proj2 = identity>
754
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
755
  constexpr borrowed_subrange_t<R1>
756
  search(R1&& r1, R2&& r2, Pred pred = {},
757
  Proj1 proj1 = {}, Proj2 proj2 = {});
758
+
759
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
760
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
761
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
762
+ requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
763
+ subrange<I1>
764
+ search(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2,
765
+ Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
766
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
767
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
768
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
769
+ borrowed_subrange_t<R1>
770
+ search(Ep&& exec, R1&& r1, R2&& r2,
771
+ Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
772
  }
773
 
774
+ template<class ForwardIterator, class Size,
775
+ class T = iterator_traits<ForwardIterator>::value_type>
776
  constexpr ForwardIterator
777
  search_n(ForwardIterator first, ForwardIterator last,
778
  Size count, const T& value);
779
+ template<class ForwardIterator, class Size,
780
+ class T = iterator_traits<ForwardIterator>::value_type, class BinaryPredicate>
781
  constexpr ForwardIterator
782
  search_n(ForwardIterator first, ForwardIterator last,
783
  Size count, const T& value, BinaryPredicate pred);
784
+ template<class ExecutionPolicy, class ForwardIterator, class Size,
785
+ class T = iterator_traits<ForwardIterator>::value_type>
786
  ForwardIterator
787
+ search_n(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
788
  ForwardIterator first, ForwardIterator last,
789
  Size count, const T& value);
790
+ template<class ExecutionPolicy, class ForwardIterator, class Size,
791
+ class T = iterator_traits<ForwardIterator>::value_type, class BinaryPredicate>
792
  ForwardIterator
793
+ search_n(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
794
  ForwardIterator first, ForwardIterator last,
795
  Size count, const T& value,
796
  BinaryPredicate pred);
797
 
798
  namespace ranges {
799
+ template<forward_iterator I, sentinel_for<I> S,
800
+ class Pred = ranges::equal_to, class Proj = identity,
801
+ class T = projected_value_t<I, Proj>>
802
  requires indirectly_comparable<I, const T*, Pred, Proj>
803
  constexpr subrange<I>
804
  search_n(I first, S last, iter_difference_t<I> count,
805
  const T& value, Pred pred = {}, Proj proj = {});
806
+ template<forward_range R, class Pred = ranges::equal_to,
807
+ class Proj = identity, class T = projected_value_t<I, Proj>>
808
  requires indirectly_comparable<iterator_t<R>, const T*, Pred, Proj>
809
  constexpr borrowed_subrange_t<R>
810
  search_n(R&& r, range_difference_t<R> count,
811
  const T& value, Pred pred = {}, Proj proj = {});
812
+
813
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
814
+ class Pred = ranges::equal_to, class Proj = identity,
815
+ class T = projected_value_t<I, Proj>>
816
+ requires indirectly_comparable<I, const T*, Pred, Proj>
817
+ subrange<I>
818
+ search_n(Ep&& exec, I first, S last, iter_difference_t<I> count,
819
+ const T& value, Pred pred = {}, Proj proj = {}); // freestanding-deleted
820
+ template<execution-policy Ep, sized-random-access-range R, class Pred = ranges::equal_to,
821
+ class Proj = identity, class T = projected_value_t<iterator_t<R>, Proj>>
822
+ requires indirectly_comparable<iterator_t<R>, const T*, Pred, Proj>
823
+ borrowed_subrange_t<R>
824
+ search_n(Ep&& exec, R&& r, range_difference_t<R> count,
825
+ const T& value, Pred pred = {}, Proj proj = {}); // freestanding-deleted
826
  }
827
 
828
  template<class ForwardIterator, class Searcher>
829
  constexpr ForwardIterator
830
  search(ForwardIterator first, ForwardIterator last, const Searcher& searcher);
 
840
  class Proj1 = identity, class Proj2 = identity>
841
  requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
842
  constexpr bool starts_with(R1&& r1, R2&& r2, Pred pred = {},
843
  Proj1 proj1 = {}, Proj2 proj2 = {});
844
 
845
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
846
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
847
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
848
+ requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
849
+ bool starts_with(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2,
850
+ Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
851
+ template<execution-policy Ep, sized-random-access-range R1,
852
+ sized-random-access-range R2, class Pred = ranges::equal_to,
853
+ class Proj1 = identity, class Proj2 = identity>
854
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
855
+ bool starts_with(Ep&& exec, R1&& r1, R2&& r2,
856
+ Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
857
+
858
  // [alg.ends.with], ends with
859
  template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
860
  class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
861
  requires (forward_iterator<I1> || sized_sentinel_for<S1, I1>) &&
862
  (forward_iterator<I2> || sized_sentinel_for<S2, I2>) &&
 
869
  (forward_range<R2> || sized_range<R2>) &&
870
  indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
871
  constexpr bool ends_with(R1&& r1, R2&& r2, Pred pred = {},
872
  Proj1 proj1 = {}, Proj2 proj2 = {});
873
 
874
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
875
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
876
+ class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity>
877
+ requires indirectly_comparable<I1, I2, Pred, Proj1, Proj2>
878
+ bool ends_with(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2,
879
+ Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
880
+ template<execution-policy Ep, sized-random-access-range R1,
881
+ sized-random-access-range R2, class Pred = ranges::equal_to,
882
+ class Proj1 = identity, class Proj2 = identity>
883
+ requires indirectly_comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2>
884
+ bool ends_with(Ep&& exec, R1&& r1, R2&& r2,
885
+ Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
886
+
887
  // [alg.fold], fold
888
  template<class F>
889
  class flipped { // exposition only
890
  F f; // exposition only
891
 
 
911
 
912
  template<class F, class T, class I>
913
  concept indirectly-binary-right-foldable = // exposition only
914
  indirectly-binary-left-foldable<flipped<F>, T, I>;
915
 
916
+ template<input_iterator I, sentinel_for<I> S, class T = iter_value_t<I>,
917
  indirectly-binary-left-foldable<T, I> F>
918
  constexpr auto fold_left(I first, S last, T init, F f);
919
 
920
+ template<input_range R, class T = range_value_t<R>,
921
+ indirectly-binary-left-foldable<T, iterator_t<R>> F>
922
  constexpr auto fold_left(R&& r, T init, F f);
923
 
924
  template<input_iterator I, sentinel_for<I> S,
925
  indirectly-binary-left-foldable<iter_value_t<I>, I> F>
926
  requires constructible_from<iter_value_t<I>, iter_reference_t<I>>
 
928
 
929
  template<input_range R, indirectly-binary-left-foldable<range_value_t<R>, iterator_t<R>> F>
930
  requires constructible_from<range_value_t<R>, range_reference_t<R>>
931
  constexpr auto fold_left_first(R&& r, F f);
932
 
933
+ template<bidirectional_iterator I, sentinel_for<I> S, class T = iter_value_t<I>,
934
  indirectly-binary-right-foldable<T, I> F>
935
  constexpr auto fold_right(I first, S last, T init, F f);
936
 
937
+ template<bidirectional_range R, class T = range_value_t<R>,
938
  indirectly-binary-right-foldable<T, iterator_t<R>> F>
939
  constexpr auto fold_right(R&& r, T init, F f);
940
 
941
  template<bidirectional_iterator I, sentinel_for<I> S,
942
  indirectly-binary-right-foldable<iter_value_t<I>, I> F>
 
951
  template<class I, class T>
952
  using fold_left_with_iter_result = in_value_result<I, T>;
953
  template<class I, class T>
954
  using fold_left_first_with_iter_result = in_value_result<I, T>;
955
 
956
+ template<input_iterator I, sentinel_for<I> S, class T = iter_value_t<I>,
957
  indirectly-binary-left-foldable<T, I> F>
958
  constexpr see below fold_left_with_iter(I first, S last, T init, F f);
959
 
960
+ template<input_range R, class T = range_value_t<R>,
961
+ indirectly-binary-left-foldable<T, iterator_t<R>> F>
962
  constexpr see below fold_left_with_iter(R&& r, T init, F f);
963
 
964
  template<input_iterator I, sentinel_for<I> S,
965
  indirectly-binary-left-foldable<iter_value_t<I>, I> F>
966
  requires constructible_from<iter_value_t<I>, iter_reference_t<I>>
 
976
  // [alg.copy], copy
977
  template<class InputIterator, class OutputIterator>
978
  constexpr OutputIterator copy(InputIterator first, InputIterator last,
979
  OutputIterator result);
980
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
981
+ ForwardIterator2 copy(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
982
  ForwardIterator1 first, ForwardIterator1 last,
983
  ForwardIterator2 result);
984
 
985
  namespace ranges {
986
  template<class I, class O>
 
992
  copy(I first, S last, O result);
993
  template<input_range R, weakly_incrementable O>
994
  requires indirectly_copyable<iterator_t<R>, O>
995
  constexpr copy_result<borrowed_iterator_t<R>, O>
996
  copy(R&& r, O result);
997
+
998
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
999
+ random_access_iterator O, sized_sentinel_for<O> OutS>
1000
+ requires indirectly_copyable<I, O>
1001
+ copy_result<I, O>
1002
+ copy(Ep&& exec, I first, S last, O result, OutS result_last); // freestanding-deleted
1003
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR>
1004
+ requires indirectly_copyable<iterator_t<R>, iterator_t<OutR>>
1005
+ copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1006
+ copy(Ep&& exec, R&& r, OutR&& result_r); // freestanding-deleted
1007
  }
1008
 
1009
  template<class InputIterator, class Size, class OutputIterator>
1010
  constexpr OutputIterator copy_n(InputIterator first, Size n,
1011
  OutputIterator result);
1012
  template<class ExecutionPolicy, class ForwardIterator1, class Size,
1013
  class ForwardIterator2>
1014
+ ForwardIterator2 copy_n(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1015
  ForwardIterator1 first, Size n,
1016
  ForwardIterator2 result);
1017
 
1018
  namespace ranges {
1019
  template<class I, class O>
 
1021
 
1022
  template<input_iterator I, weakly_incrementable O>
1023
  requires indirectly_copyable<I, O>
1024
  constexpr copy_n_result<I, O>
1025
  copy_n(I first, iter_difference_t<I> n, O result);
1026
+
1027
+ template<execution-policy Ep, random_access_iterator I, random_access_iterator O,
1028
+ sized_sentinel_for<O> OutS>
1029
+ requires indirectly_copyable<I, O>
1030
+ copy_n_result<I, O>
1031
+ copy_n(Ep&& exec, I first, iter_difference_t<I> n, O result,
1032
+ OutS result_last); // freestanding-deleted
1033
  }
1034
 
1035
  template<class InputIterator, class OutputIterator, class Predicate>
1036
  constexpr OutputIterator copy_if(InputIterator first, InputIterator last,
1037
  OutputIterator result, Predicate pred);
1038
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1039
  class Predicate>
1040
+ ForwardIterator2 copy_if(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1041
  ForwardIterator1 first, ForwardIterator1 last,
1042
  ForwardIterator2 result, Predicate pred);
1043
 
1044
  namespace ranges {
1045
  template<class I, class O>
 
1053
  template<input_range R, weakly_incrementable O, class Proj = identity,
1054
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1055
  requires indirectly_copyable<iterator_t<R>, O>
1056
  constexpr copy_if_result<borrowed_iterator_t<R>, O>
1057
  copy_if(R&& r, O result, Pred pred, Proj proj = {});
1058
+
1059
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1060
+ random_access_iterator O, sized_sentinel_for<O> OutS,
1061
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
1062
+ requires indirectly_copyable<I, O>
1063
+ copy_if_result<I, O>
1064
+ copy_if(Ep&& exec, I first, S last, O result, OutS result_last,
1065
+ Pred pred, Proj proj = {}); // freestanding-deleted
1066
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR,
1067
+ class Proj = identity,
1068
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1069
+ requires indirectly_copyable<iterator_t<R>, iterator_t<OutR>>
1070
+ copy_if_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1071
+ copy_if(Ep&& exec, R&& r, OutR&& result_r, Pred pred,
1072
+ Proj proj = {}); // freestanding-deleted
1073
  }
1074
 
1075
  template<class BidirectionalIterator1, class BidirectionalIterator2>
1076
  constexpr BidirectionalIterator2
1077
  copy_backward(BidirectionalIterator1 first, BidirectionalIterator1 last,
 
1095
  template<class InputIterator, class OutputIterator>
1096
  constexpr OutputIterator move(InputIterator first, InputIterator last,
1097
  OutputIterator result);
1098
  template<class ExecutionPolicy, class ForwardIterator1,
1099
  class ForwardIterator2>
1100
+ ForwardIterator2 move(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1101
  ForwardIterator1 first, ForwardIterator1 last,
1102
  ForwardIterator2 result);
1103
 
1104
  namespace ranges {
1105
  template<class I, class O>
 
1111
  move(I first, S last, O result);
1112
  template<input_range R, weakly_incrementable O>
1113
  requires indirectly_movable<iterator_t<R>, O>
1114
  constexpr move_result<borrowed_iterator_t<R>, O>
1115
  move(R&& r, O result);
1116
+
1117
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1118
+ random_access_iterator O, sized_sentinel_for<O> OutS>
1119
+ requires indirectly_movable<I, O>
1120
+ move_result<I, O>
1121
+ move(Ep&& exec, I first, S last, O result, OutS result_last); // freestanding-deleted
1122
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR>
1123
+ requires indirectly_movable<iterator_t<R>, iterator_t<OutR>>
1124
+ move_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1125
+ move(Ep&& exec, R&& r, OutR&& result_r); // freestanding-deleted
1126
  }
1127
 
1128
  template<class BidirectionalIterator1, class BidirectionalIterator2>
1129
  constexpr BidirectionalIterator2
1130
  move_backward(BidirectionalIterator1 first, BidirectionalIterator1 last,
 
1147
  // [alg.swap], swap
1148
  template<class ForwardIterator1, class ForwardIterator2>
1149
  constexpr ForwardIterator2 swap_ranges(ForwardIterator1 first1, ForwardIterator1 last1,
1150
  ForwardIterator2 first2);
1151
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
1152
+ ForwardIterator2 swap_ranges(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1153
  ForwardIterator1 first1, ForwardIterator1 last1,
1154
  ForwardIterator2 first2);
1155
 
1156
  namespace ranges {
1157
  template<class I1, class I2>
 
1163
  swap_ranges(I1 first1, S1 last1, I2 first2, S2 last2);
1164
  template<input_range R1, input_range R2>
1165
  requires indirectly_swappable<iterator_t<R1>, iterator_t<R2>>
1166
  constexpr swap_ranges_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
1167
  swap_ranges(R1&& r1, R2&& r2);
1168
+
1169
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
1170
+ random_access_iterator I2, sized_sentinel_for<I2> S2>
1171
+ requires indirectly_swappable<I1, I2>
1172
+ swap_ranges_result<I1, I2>
1173
+ swap_ranges(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2); // freestanding-deleted
1174
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2>
1175
+ requires indirectly_swappable<iterator_t<R1>, iterator_t<R2>>
1176
+ swap_ranges_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
1177
+ swap_ranges(Ep&& exec, R1&& r1, R2&& r2); // freestanding-deleted
1178
  }
1179
 
1180
  template<class ForwardIterator1, class ForwardIterator2>
1181
  constexpr void iter_swap(ForwardIterator1 a, ForwardIterator2 b);
1182
 
 
1192
  InputIterator2 first2, OutputIterator result,
1193
  BinaryOperation binary_op);
1194
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1195
  class UnaryOperation>
1196
  ForwardIterator2
1197
+ transform(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1198
  ForwardIterator1 first1, ForwardIterator1 last1,
1199
  ForwardIterator2 result, UnaryOperation op);
1200
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1201
  class ForwardIterator, class BinaryOperation>
1202
  ForwardIterator
1203
+ transform(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1204
  ForwardIterator1 first1, ForwardIterator1 last1,
1205
  ForwardIterator2 first2, ForwardIterator result,
1206
  BinaryOperation binary_op);
1207
 
1208
  namespace ranges {
 
1218
  class Proj = identity>
1219
  requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R>, Proj>>>
1220
  constexpr unary_transform_result<borrowed_iterator_t<R>, O>
1221
  transform(R&& r, O result, F op, Proj proj = {});
1222
 
1223
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1224
+ random_access_iterator O, sized_sentinel_for<O> OutS,
1225
+ copy_constructible F, class Proj = identity>
1226
+ requires indirectly_writable<O, indirect_result_t<F&, projected<I, Proj>>>
1227
+ unary_transform_result<I, O>
1228
+ transform(Ep&& exec, I first1, S last1, O result, OutS result_last,
1229
+ F op, Proj proj = {}); // freestanding-deleted
1230
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR,
1231
+ copy_constructible F, class Proj = identity>
1232
+ requires indirectly_writable<iterator_t<OutR>,
1233
+ indirect_result_t<F&, projected<iterator_t<R>, Proj>>>
1234
+ unary_transform_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1235
+ transform(Ep&& exec, R&& r, OutR&& result_r, F op, Proj proj = {}); // freestanding-deleted
1236
+
1237
  template<class I1, class I2, class O>
1238
  using binary_transform_result = in_in_out_result<I1, I2, O>;
1239
 
1240
  template<input_iterator I1, sentinel_for<I1> S1, input_iterator I2, sentinel_for<I2> S2,
1241
  weakly_incrementable O, copy_constructible F, class Proj1 = identity,
 
1250
  requires indirectly_writable<O, indirect_result_t<F&, projected<iterator_t<R1>, Proj1>,
1251
  projected<iterator_t<R2>, Proj2>>>
1252
  constexpr binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
1253
  transform(R1&& r1, R2&& r2, O result,
1254
  F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {});
1255
+
1256
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
1257
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
1258
+ random_access_iterator O, sized_sentinel_for<O> OutS,
1259
+ copy_constructible F, class Proj1 = identity, class Proj2 = identity>
1260
+ requires indirectly_writable<O, indirect_result_t<F&, projected<I1, Proj1>,
1261
+ projected<I2, Proj2>>>
1262
+ binary_transform_result<I1, I2, O>
1263
+ transform(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2,
1264
+ O result, OutS result_last,
1265
+ F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
1266
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
1267
+ sized-random-access-range OutR, copy_constructible F,
1268
+ class Proj1 = identity, class Proj2 = identity>
1269
+ requires indirectly_writable<iterator_t<OutR>,
1270
+ indirect_result_t<F&, projected<iterator_t<R1>, Proj1>,
1271
+ projected<iterator_t<R2>, Proj2>>>
1272
+ binary_transform_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>,
1273
+ borrowed_iterator_t<OutR>>
1274
+ transform(Ep&& exec, R1&& r1, R2&& r2, OutR&& result_r,
1275
+ F binary_op, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
1276
  }
1277
 
1278
  // [alg.replace], replace
1279
  template<class ForwardIterator, class T>
1280
  constexpr void replace(ForwardIterator first, ForwardIterator last,
1281
  const T& old_value, const T& new_value);
1282
+ template<class ExecutionPolicy, class ForwardIterator,
1283
+ class T = iterator_traits<ForwardIterator>::value_type>
1284
+ void replace(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1285
  ForwardIterator first, ForwardIterator last,
1286
  const T& old_value, const T& new_value);
1287
+ template<class ForwardIterator, class Predicate,
1288
+ class T = iterator_traits<ForwardIterator>::value_type>
1289
  constexpr void replace_if(ForwardIterator first, ForwardIterator last,
1290
  Predicate pred, const T& new_value);
1291
+ template<class ExecutionPolicy, class ForwardIterator, class Predicate,
1292
+ class T = iterator_traits<ForwardIterator>::value_type>
1293
+ void replace_if(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1294
  ForwardIterator first, ForwardIterator last,
1295
  Predicate pred, const T& new_value);
1296
 
1297
  namespace ranges {
1298
+ template<input_iterator I, sentinel_for<I> S, class Proj = identity,
1299
+ class T1 = projected_value_t<I, Proj>, class T2 = T1>
1300
  requires indirectly_writable<I, const T2&> &&
1301
  indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*>
1302
  constexpr I
1303
  replace(I first, S last, const T1& old_value, const T2& new_value, Proj proj = {});
1304
+ template<input_range R, class Proj = identity,
1305
+ class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = T1>
1306
  requires indirectly_writable<iterator_t<R>, const T2&> &&
1307
  indirect_binary_predicate<ranges::equal_to,
1308
  projected<iterator_t<R>, Proj>, const T1*>
1309
  constexpr borrowed_iterator_t<R>
1310
  replace(R&& r, const T1& old_value, const T2& new_value, Proj proj = {});
1311
+
1312
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1313
+ class Proj = identity, class T1 = projected_value_t<I, Proj>, class T2 = T1>
1314
+ requires indirectly_writable<I, const T2&> &&
1315
+ indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*>
1316
+ I replace(Ep&& exec, I first, S last,
1317
+ const T1& old_value, const T2& new_value, Proj proj = {}); // freestanding-deleted
1318
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
1319
+ class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = T1>
1320
+ requires indirectly_writable<iterator_t<R>, const T2&> &&
1321
+ indirect_binary_predicate<ranges::equal_to,
1322
+ projected<iterator_t<R>, Proj>, const T1*>
1323
+ borrowed_iterator_t<R>
1324
+ replace(Ep&& exec, R&& r, const T1& old_value, const T2& new_value,
1325
+ Proj proj = {}); // freestanding-deleted
1326
+
1327
+ template<input_iterator I, sentinel_for<I> S, class Proj = identity,
1328
+ class T = projected_value_t<I, Proj>,
1329
  indirect_unary_predicate<projected<I, Proj>> Pred>
1330
  requires indirectly_writable<I, const T&>
1331
  constexpr I replace_if(I first, S last, Pred pred, const T& new_value, Proj proj = {});
1332
+ template<input_range R, class Proj = identity, class T = projected_value_t<I, Proj>,
1333
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1334
  requires indirectly_writable<iterator_t<R>, const T&>
1335
  constexpr borrowed_iterator_t<R>
1336
  replace_if(R&& r, Pred pred, const T& new_value, Proj proj = {});
1337
+
1338
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1339
+ class Proj = identity, class T = projected_value_t<I, Proj>,
1340
+ indirect_unary_predicate<projected<I, Proj>> Pred>
1341
+ requires indirectly_writable<I, const T&>
1342
+ I replace_if(Ep&& exec, I first, S last, Pred pred,
1343
+ const T& new_value, Proj proj = {}); // freestanding-deleted
1344
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
1345
+ class T = projected_value_t<iterator_t<R>, Proj>,
1346
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1347
+ requires indirectly_writable<iterator_t<R>, const T&>
1348
+ borrowed_iterator_t<R>
1349
+ replace_if(Ep&& exec, R&& r, Pred pred, const T& new_value,
1350
+ Proj proj = {}); // freestanding-deleted
1351
  }
1352
 
1353
  template<class InputIterator, class OutputIterator, class T>
1354
  constexpr OutputIterator replace_copy(InputIterator first, InputIterator last,
1355
  OutputIterator result,
1356
  const T& old_value, const T& new_value);
1357
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2, class T>
1358
+ ForwardIterator2 replace_copy(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1359
  ForwardIterator1 first, ForwardIterator1 last,
1360
  ForwardIterator2 result,
1361
  const T& old_value, const T& new_value);
1362
+ template<class InputIterator, class OutputIterator, class Predicate,
1363
+ class T = iterator_traits<OutputIterator>::value_type>
1364
  constexpr OutputIterator replace_copy_if(InputIterator first, InputIterator last,
1365
  OutputIterator result,
1366
  Predicate pred, const T& new_value);
1367
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1368
+ class Predicate, class T = iterator_traits<ForwardIterator2>::value_type>
1369
+ ForwardIterator2 replace_copy_if(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1370
  ForwardIterator1 first, ForwardIterator1 last,
1371
  ForwardIterator2 result,
1372
  Predicate pred, const T& new_value);
1373
 
1374
  namespace ranges {
1375
  template<class I, class O>
1376
  using replace_copy_result = in_out_result<I, O>;
1377
 
1378
+ template<input_iterator I, sentinel_for<I> S, class O,
1379
+ class Proj = identity,
1380
+ class T1 = projected_value_t<I, Proj>, class T2 = iter_value_t<O>>
1381
  requires indirectly_copyable<I, O> &&
1382
+ indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*> &&
1383
+ output_iterator<O, const T2&>
1384
  constexpr replace_copy_result<I, O>
1385
  replace_copy(I first, S last, O result, const T1& old_value, const T2& new_value,
1386
  Proj proj = {});
1387
+ template<input_range R, class O, class Proj = identity,
1388
+ class T1 = projected_value_t<iterator_t<R>, Proj>, class T2 = iter_value_t<O>>
1389
  requires indirectly_copyable<iterator_t<R>, O> &&
1390
  indirect_binary_predicate<ranges::equal_to,
1391
+ projected<iterator_t<R>, Proj>, const T1*> &&
1392
+ output_iterator<O, const T2&>
1393
  constexpr replace_copy_result<borrowed_iterator_t<R>, O>
1394
  replace_copy(R&& r, O result, const T1& old_value, const T2& new_value,
1395
  Proj proj = {});
1396
 
1397
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1398
+ random_access_iterator O, sized_sentinel_for<O> OutS,
1399
+ class Proj = identity,
1400
+ class T1 = projected_value_t<I, Proj>, class T2 = iter_value_t<O>>
1401
+ requires indirectly_copyable<I, O> &&
1402
+ indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T1*> &&
1403
+ indirectly_writable<O, const T2&>
1404
+ replace_copy_result<I, O>
1405
+ replace_copy(Ep&& exec, I first, S last, O result, OutS result_last, const T1& old_value,
1406
+ const T2& new_value, Proj proj = {}); // freestanding-deleted
1407
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR,
1408
+ class Proj = identity, class T1 = projected_value_t<iterator_t<R>, Proj>,
1409
+ class T2 = range_value_t<OutR>>
1410
+ requires indirectly_copyable<iterator_t<R>, iterator_t<OutR>> &&
1411
+ indirect_binary_predicate<ranges::equal_to,
1412
+ projected<iterator_t<R>, Proj>, const T1*> &&
1413
+ indirectly_writable<iterator_t<OutR>, const T2&>
1414
+ replace_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1415
+ replace_copy(Ep&& exec, R&& r, OutR&& result_r, const T1& old_value, const T2& new_value,
1416
+ Proj proj = {}); // freestanding-deleted
1417
+
1418
  template<class I, class O>
1419
  using replace_copy_if_result = in_out_result<I, O>;
1420
 
1421
+ template<input_iterator I, sentinel_for<I> S, class O, class T = iter_value_t<O>,
1422
  class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
1423
+ requires indirectly_copyable<I, O> && output_iterator<O, const T&>
1424
  constexpr replace_copy_if_result<I, O>
1425
  replace_copy_if(I first, S last, O result, Pred pred, const T& new_value,
1426
  Proj proj = {});
1427
+ template<input_range R, class O, class T = iter_value_t<O>, class Proj = identity,
1428
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1429
+ requires indirectly_copyable<iterator_t<R>, O> && output_iterator<O, const T&>
1430
  constexpr replace_copy_if_result<borrowed_iterator_t<R>, O>
1431
  replace_copy_if(R&& r, O result, Pred pred, const T& new_value,
1432
  Proj proj = {});
1433
+
1434
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1435
+ random_access_iterator O, sized_sentinel_for<O> OutS, class T = iter_value_t<O>,
1436
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
1437
+ requires indirectly_copyable<I, O> && indirectly_writable<O, const T&>
1438
+ replace_copy_if_result<I, O>
1439
+ replace_copy_if(Ep&& exec, I first, S last, O result, OutS result_last,
1440
+ Pred pred, const T& new_value, Proj proj = {}); // freestanding-deleted
1441
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR,
1442
+ class T = range_value_t<OutR>, class Proj = identity,
1443
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1444
+ requires indirectly_copyable<iterator_t<R>, iterator_t<OutR>> &&
1445
+ indirectly_writable<iterator_t<OutR>, const T&>
1446
+ replace_copy_if_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1447
+ replace_copy_if(Ep&& exec, R&& r, OutR&& result_r, Pred pred, const T& new_value,
1448
+ Proj proj = {}); // freestanding-deleted
1449
  }
1450
 
1451
  // [alg.fill], fill
1452
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type>
1453
  constexpr void fill(ForwardIterator first, ForwardIterator last, const T& value);
1454
+ template<class ExecutionPolicy, class ForwardIterator,
1455
+ class T = iterator_traits<ForwardIterator>::value_type>
1456
+ void fill(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1457
  ForwardIterator first, ForwardIterator last, const T& value);
1458
+ template<class OutputIterator, class Size,
1459
+ class T = iterator_traits<OutputIterator>::value_type>
1460
+ constexpr OutputIterator fill_n(OutputIterator first, Size n, const T& value)
1461
  template<class ExecutionPolicy, class ForwardIterator,
1462
+ class Size, class T = iterator_traits<ForwardIterator>::value_type>
1463
+ ForwardIterator fill_n(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1464
  ForwardIterator first, Size n, const T& value);
1465
 
1466
  namespace ranges {
1467
+ template<class O, sentinel_for<O> S, class T = iter_value_t<O>>
1468
+ requires output_iterator<O, const T&>
1469
  constexpr O fill(O first, S last, const T& value);
1470
+ template<class R, class T = range_value_t<R>>
1471
+ requires output_range<R, const T&>
1472
  constexpr borrowed_iterator_t<R> fill(R&& r, const T& value);
1473
+ template<class O, class T = iter_value_t<O>>
1474
+ requires output_iterator<O, const T&>
1475
  constexpr O fill_n(O first, iter_difference_t<O> n, const T& value);
1476
+
1477
+ template<execution-policy Ep, random_access_iterator O, sized_sentinel_for<O> S,
1478
+ class T = iter_value_t<O>>
1479
+ requires indirectly_writable<O, const T&>
1480
+ O fill(Ep&& exec, O first, S last, const T& value); // freestanding-deleted
1481
+ template<execution-policy Ep, sized-random-access-range R, class T = range_value_t<R>>
1482
+ requires indirectly_writable<iterator_t<R>, const T&>
1483
+ borrowed_iterator_t<R> fill(Ep&& exec, R&& r, const T& value); // freestanding-deleted
1484
+ template<execution-policy Ep, random_access_iterator O, class T = iter_value_t<O>>
1485
+ requires indirectly_writable<O, const T&>
1486
+ O fill_n(Ep&& exec, O first, iter_difference_t<O> n, const T& value); // freestanding-deleted
1487
  }
1488
 
1489
  // [alg.generate], generate
1490
  template<class ForwardIterator, class Generator>
1491
  constexpr void generate(ForwardIterator first, ForwardIterator last,
1492
  Generator gen);
1493
  template<class ExecutionPolicy, class ForwardIterator, class Generator>
1494
+ void generate(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1495
  ForwardIterator first, ForwardIterator last,
1496
  Generator gen);
1497
  template<class OutputIterator, class Size, class Generator>
1498
  constexpr OutputIterator generate_n(OutputIterator first, Size n, Generator gen);
1499
  template<class ExecutionPolicy, class ForwardIterator, class Size, class Generator>
1500
+ ForwardIterator generate_n(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1501
  ForwardIterator first, Size n, Generator gen);
1502
 
1503
  namespace ranges {
1504
  template<input_or_output_iterator O, sentinel_for<O> S, copy_constructible F>
1505
  requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
 
1508
  requires invocable<F&> && output_range<R, invoke_result_t<F&>>
1509
  constexpr borrowed_iterator_t<R> generate(R&& r, F gen);
1510
  template<input_or_output_iterator O, copy_constructible F>
1511
  requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
1512
  constexpr O generate_n(O first, iter_difference_t<O> n, F gen);
1513
+ template<execution-policy Ep, random_access_iterator O, sized_sentinel_for<O> S,
1514
+ copy_constructible F>
1515
+ requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
1516
+ O generate(Ep&& exec, O first, S last, F gen); // freestanding-deleted
1517
+ template<execution-policy Ep, sized-random-access-range R, copy_constructible F>
1518
+ requires invocable<F&> && indirectly_writable<iterator_t<R>, invoke_result_t<F&>>
1519
+ borrowed_iterator_t<R> generate(Ep&& exec, R&& r, F gen); // freestanding-deleted
1520
+ template<execution-policy Ep, random_access_iterator O, copy_constructible F>
1521
+ requires invocable<F&> && indirectly_writable<O, invoke_result_t<F&>>
1522
+ O generate_n(Ep&& exec, O first, iter_difference_t<O> n, F gen); // freestanding-deleted
1523
  }
1524
 
1525
  // [alg.remove], remove
1526
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type>
1527
  constexpr ForwardIterator remove(ForwardIterator first, ForwardIterator last,
1528
  const T& value);
1529
+ template<class ExecutionPolicy, class ForwardIterator,
1530
+ class T = iterator_traits<ForwardIterator>::value_type>
1531
+ ForwardIterator remove(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1532
  ForwardIterator first, ForwardIterator last,
1533
  const T& value);
1534
  template<class ForwardIterator, class Predicate>
1535
  constexpr ForwardIterator remove_if(ForwardIterator first, ForwardIterator last,
1536
  Predicate pred);
1537
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
1538
+ ForwardIterator remove_if(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1539
  ForwardIterator first, ForwardIterator last,
1540
  Predicate pred);
1541
 
1542
  namespace ranges {
1543
+ template<permutable I, sentinel_for<I> S, class Proj = identity,
1544
+ class T = projected_value_t<I, Proj>>
1545
  requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
1546
  constexpr subrange<I> remove(I first, S last, const T& value, Proj proj = {});
1547
+ template<forward_range R, class Proj = identity,
1548
+ class T = projected_value_t<iterator_t<R>, Proj>>
1549
  requires permutable<iterator_t<R>> &&
1550
  indirect_binary_predicate<ranges::equal_to,
1551
  projected<iterator_t<R>, Proj>, const T*>
1552
  constexpr borrowed_subrange_t<R>
1553
  remove(R&& r, const T& value, Proj proj = {});
1554
+
1555
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1556
+ class Proj = identity, class T = projected_value_t<I, Proj>>
1557
+ requires indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
1558
+ subrange<I> remove(Ep&& exec, I first, S last, const T& value,
1559
+ Proj proj = {}); // freestanding-deleted
1560
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
1561
+ class T = projected_value_t<iterator_t<R>, Proj>>
1562
+ requires permutable<iterator_t<R>> &&
1563
+ indirect_binary_predicate<ranges::equal_to,
1564
+ projected<iterator_t<R>, Proj>, const T*>
1565
+ borrowed_subrange_t<R>
1566
+ remove(Ep&& exec, R&& r, const T& value, Proj proj = {}); // freestanding-deleted
1567
+
1568
  template<permutable I, sentinel_for<I> S, class Proj = identity,
1569
  indirect_unary_predicate<projected<I, Proj>> Pred>
1570
  constexpr subrange<I> remove_if(I first, S last, Pred pred, Proj proj = {});
1571
  template<forward_range R, class Proj = identity,
1572
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1573
  requires permutable<iterator_t<R>>
1574
  constexpr borrowed_subrange_t<R>
1575
  remove_if(R&& r, Pred pred, Proj proj = {});
1576
+
1577
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1578
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
1579
+ subrange<I>
1580
+ remove_if(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); // freestanding-deleted
1581
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
1582
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1583
+ requires permutable<iterator_t<R>>
1584
+ borrowed_subrange_t<R>
1585
+ remove_if(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
1586
  }
1587
 
1588
+ template<class InputIterator, class OutputIterator,
1589
+ class T = iterator_traits<InputIterator>::value_type>
1590
  constexpr OutputIterator
1591
  remove_copy(InputIterator first, InputIterator last,
1592
  OutputIterator result, const T& value);
1593
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1594
+ class T = iterator_traits<ForwardIterator1>::value_type>
1595
  ForwardIterator2
1596
+ remove_copy(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1597
  ForwardIterator1 first, ForwardIterator1 last,
1598
  ForwardIterator2 result, const T& value);
1599
  template<class InputIterator, class OutputIterator, class Predicate>
1600
  constexpr OutputIterator
1601
  remove_copy_if(InputIterator first, InputIterator last,
1602
  OutputIterator result, Predicate pred);
1603
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1604
  class Predicate>
1605
  ForwardIterator2
1606
+ remove_copy_if(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1607
  ForwardIterator1 first, ForwardIterator1 last,
1608
  ForwardIterator2 result, Predicate pred);
1609
 
1610
  namespace ranges {
1611
  template<class I, class O>
1612
  using remove_copy_result = in_out_result<I, O>;
1613
 
1614
+ template<input_iterator I, sentinel_for<I> S, weakly_incrementable O,
1615
+ class Proj = identity, class T = projected_value_t<I, Proj>>
1616
  requires indirectly_copyable<I, O> &&
1617
  indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
1618
  constexpr remove_copy_result<I, O>
1619
  remove_copy(I first, S last, O result, const T& value, Proj proj = {});
1620
+ template<input_range R, weakly_incrementable O, class Proj = identity,
1621
+ class T = projected_value_t<iterator_t<R>, Proj>>
1622
  requires indirectly_copyable<iterator_t<R>, O> &&
1623
  indirect_binary_predicate<ranges::equal_to,
1624
  projected<iterator_t<R>, Proj>, const T*>
1625
  constexpr remove_copy_result<borrowed_iterator_t<R>, O>
1626
  remove_copy(R&& r, O result, const T& value, Proj proj = {});
1627
 
1628
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1629
+ random_access_iterator O, sized_sentinel_for<O> OutS,
1630
+ class Proj = identity, class T = projected_value_t<I, Proj>>
1631
+ requires indirectly_copyable<I, O> &&
1632
+ indirect_binary_predicate<ranges::equal_to, projected<I, Proj>, const T*>
1633
+ remove_copy_result<I, O>
1634
+ remove_copy(Ep&& exec, I first, S last, O result, OutS result_last, const T& value,
1635
+ Proj proj = {}); // freestanding-deleted
1636
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR,
1637
+ class Proj = identity, class T = projected_value_t<iterator_t<R>, Proj>>
1638
+ requires indirectly_copyable<iterator_t<R>, iterator_t<OutR>> &&
1639
+ indirect_binary_predicate<ranges::equal_to,
1640
+ projected<iterator_t<R>, Proj>, const T*>
1641
+ remove_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1642
+ remove_copy(Ep&& exec, R&& r, OutR&& result_r, const T& value,
1643
+ Proj proj = {}); // freestanding-deleted
1644
+
1645
  template<class I, class O>
1646
  using remove_copy_if_result = in_out_result<I, O>;
1647
 
1648
  template<input_iterator I, sentinel_for<I> S, weakly_incrementable O,
1649
  class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
 
1653
  template<input_range R, weakly_incrementable O, class Proj = identity,
1654
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1655
  requires indirectly_copyable<iterator_t<R>, O>
1656
  constexpr remove_copy_if_result<borrowed_iterator_t<R>, O>
1657
  remove_copy_if(R&& r, O result, Pred pred, Proj proj = {});
1658
+
1659
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1660
+ random_access_iterator O, sized_sentinel_for<O> OutS,
1661
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
1662
+ requires indirectly_copyable<I, O>
1663
+ remove_copy_if_result<I, O>
1664
+ remove_copy_if(Ep&& exec, I first, S last, O result, OutS result_last, Pred pred,
1665
+ Proj proj = {}); // freestanding-deleted
1666
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR,
1667
+ class Proj = identity,
1668
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
1669
+ requires indirectly_copyable<iterator_t<R>, iterator_t<OutR>>
1670
+ remove_copy_if_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1671
+ remove_copy_if(Ep&& exec, R&& r, OutR&& result_r, Pred pred,
1672
+ Proj proj = {}); // freestanding-deleted
1673
  }
1674
 
1675
  // [alg.unique], unique
1676
  template<class ForwardIterator>
1677
  constexpr ForwardIterator unique(ForwardIterator first, ForwardIterator last);
1678
  template<class ForwardIterator, class BinaryPredicate>
1679
  constexpr ForwardIterator unique(ForwardIterator first, ForwardIterator last,
1680
  BinaryPredicate pred);
1681
  template<class ExecutionPolicy, class ForwardIterator>
1682
+ ForwardIterator unique(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1683
  ForwardIterator first, ForwardIterator last);
1684
  template<class ExecutionPolicy, class ForwardIterator, class BinaryPredicate>
1685
+ ForwardIterator unique(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1686
  ForwardIterator first, ForwardIterator last,
1687
  BinaryPredicate pred);
1688
 
1689
  namespace ranges {
1690
  template<permutable I, sentinel_for<I> S, class Proj = identity,
 
1693
  template<forward_range R, class Proj = identity,
1694
  indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
1695
  requires permutable<iterator_t<R>>
1696
  constexpr borrowed_subrange_t<R>
1697
  unique(R&& r, C comp = {}, Proj proj = {});
1698
+
1699
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1700
+ class Proj = identity,
1701
+ indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to>
1702
+ requires permutable<I>
1703
+ subrange<I> unique(Ep&& exec, I first, S last, C comp = {},
1704
+ Proj proj = {}); // freestanding-deleted
1705
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
1706
+ indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
1707
+ requires permutable<iterator_t<R>>
1708
+ borrowed_subrange_t<R>
1709
+ unique(Ep&& exec, R&& r, C comp = {}, Proj proj = {}); // freestanding-deleted
1710
  }
1711
 
1712
  template<class InputIterator, class OutputIterator>
1713
  constexpr OutputIterator
1714
  unique_copy(InputIterator first, InputIterator last,
 
1717
  constexpr OutputIterator
1718
  unique_copy(InputIterator first, InputIterator last,
1719
  OutputIterator result, BinaryPredicate pred);
1720
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
1721
  ForwardIterator2
1722
+ unique_copy(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1723
  ForwardIterator1 first, ForwardIterator1 last,
1724
  ForwardIterator2 result);
1725
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
1726
  class BinaryPredicate>
1727
  ForwardIterator2
1728
+ unique_copy(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1729
  ForwardIterator1 first, ForwardIterator1 last,
1730
  ForwardIterator2 result, BinaryPredicate pred);
1731
 
1732
  namespace ranges {
1733
  template<class I, class O>
 
1747
  (forward_iterator<iterator_t<R>> ||
1748
  (input_iterator<O> && same_as<range_value_t<R>, iter_value_t<O>>) ||
1749
  indirectly_copyable_storable<iterator_t<R>, O>)
1750
  constexpr unique_copy_result<borrowed_iterator_t<R>, O>
1751
  unique_copy(R&& r, O result, C comp = {}, Proj proj = {});
1752
+
1753
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1754
+ random_access_iterator O, sized_sentinel_for<O> OutS, class Proj = identity,
1755
+ indirect_equivalence_relation<projected<I, Proj>> C = ranges::equal_to>
1756
+ requires indirectly_copyable<I, O>
1757
+ unique_copy_result<I, O>
1758
+ unique_copy(Ep&& exec, I first, S last, O result, OutS result_last, C comp = {},
1759
+ Proj proj = {}); // freestanding-deleted
1760
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR,
1761
+ class Proj = identity,
1762
+ indirect_equivalence_relation<projected<iterator_t<R>, Proj>> C = ranges::equal_to>
1763
+ requires indirectly_copyable<iterator_t<R>, iterator_t<OutR>>
1764
+ unique_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1765
+ unique_copy(Ep&& exec, R&& r, OutR&& result_r, C comp = {},
1766
+ Proj proj = {}); // freestanding-deleted
1767
  }
1768
 
1769
  // [alg.reverse], reverse
1770
  template<class BidirectionalIterator>
1771
  constexpr void reverse(BidirectionalIterator first, BidirectionalIterator last);
1772
  template<class ExecutionPolicy, class BidirectionalIterator>
1773
+ void reverse(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1774
  BidirectionalIterator first, BidirectionalIterator last);
1775
 
1776
  namespace ranges {
1777
  template<bidirectional_iterator I, sentinel_for<I> S>
1778
  requires permutable<I>
1779
  constexpr I reverse(I first, S last);
1780
  template<bidirectional_range R>
1781
  requires permutable<iterator_t<R>>
1782
  constexpr borrowed_iterator_t<R> reverse(R&& r);
1783
+
1784
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S>
1785
+ requires permutable<I>
1786
+ I reverse(Ep&& exec, I first, S last); // freestanding-deleted
1787
+ template<execution-policy Ep, sized-random-access-range R>
1788
+ requires permutable<iterator_t<R>>
1789
+ borrowed_iterator_t<R> reverse(Ep&& exec, R&& r); // freestanding-deleted
1790
  }
1791
 
1792
  template<class BidirectionalIterator, class OutputIterator>
1793
  constexpr OutputIterator
1794
  reverse_copy(BidirectionalIterator first, BidirectionalIterator last,
1795
  OutputIterator result);
1796
  template<class ExecutionPolicy, class BidirectionalIterator, class ForwardIterator>
1797
  ForwardIterator
1798
+ reverse_copy(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1799
  BidirectionalIterator first, BidirectionalIterator last,
1800
  ForwardIterator result);
1801
 
1802
  namespace ranges {
1803
  template<class I, class O>
1804
  using reverse_copy_result = in_out_result<I, O>;
1805
+ template<class I, class O>
1806
+ using reverse_copy_truncated_result = in_in_out_result<I, I, O>;
1807
 
1808
  template<bidirectional_iterator I, sentinel_for<I> S, weakly_incrementable O>
1809
  requires indirectly_copyable<I, O>
1810
  constexpr reverse_copy_result<I, O>
1811
  reverse_copy(I first, S last, O result);
1812
  template<bidirectional_range R, weakly_incrementable O>
1813
  requires indirectly_copyable<iterator_t<R>, O>
1814
  constexpr reverse_copy_result<borrowed_iterator_t<R>, O>
1815
  reverse_copy(R&& r, O result);
1816
+
1817
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1818
+ random_access_iterator O, sized_sentinel_for<O> OutS>
1819
+ requires indirectly_copyable<I, O>
1820
+ reverse_copy_truncated_result<I, O>
1821
+ reverse_copy(Ep&& exec, I first, S last, O result,
1822
+ OutS result_last); // freestanding-deleted
1823
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR>
1824
+ requires indirectly_copyable<iterator_t<R>, iterator_t<OutR>>
1825
+ reverse_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1826
+ reverse_copy(Ep&& exec, R&& r, OutR&& result_r); // freestanding-deleted
1827
  }
1828
 
1829
  // [alg.rotate], rotate
1830
  template<class ForwardIterator>
1831
  constexpr ForwardIterator rotate(ForwardIterator first,
1832
  ForwardIterator middle,
1833
  ForwardIterator last);
1834
  template<class ExecutionPolicy, class ForwardIterator>
1835
+ ForwardIterator rotate(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1836
  ForwardIterator first,
1837
  ForwardIterator middle,
1838
  ForwardIterator last);
1839
 
1840
  namespace ranges {
1841
  template<permutable I, sentinel_for<I> S>
1842
  constexpr subrange<I> rotate(I first, I middle, S last);
1843
  template<forward_range R>
1844
  requires permutable<iterator_t<R>>
1845
  constexpr borrowed_subrange_t<R> rotate(R&& r, iterator_t<R> middle);
1846
+
1847
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S>
1848
+ requires permutable<I>
1849
+ subrange<I>
1850
+ rotate(Ep&& exec, I first, I middle, S last); // freestanding-deleted
1851
+ template<execution-policy Ep, sized-random-access-range R>
1852
+ requires permutable<iterator_t<R>>
1853
+ borrowed_subrange_t<R>
1854
+ rotate(Ep&& exec, R&& r, iterator_t<R> middle); // freestanding-deleted
1855
  }
1856
 
1857
  template<class ForwardIterator, class OutputIterator>
1858
  constexpr OutputIterator
1859
  rotate_copy(ForwardIterator first, ForwardIterator middle,
1860
  ForwardIterator last, OutputIterator result);
1861
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
1862
  ForwardIterator2
1863
+ rotate_copy(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1864
  ForwardIterator1 first, ForwardIterator1 middle,
1865
  ForwardIterator1 last, ForwardIterator2 result);
1866
 
1867
  namespace ranges {
1868
  template<class I, class O>
1869
  using rotate_copy_result = in_out_result<I, O>;
1870
+ template<class I, class O>
1871
+ using rotate_copy_truncated_result = in_in_out_result<I, I, O>;
1872
 
1873
  template<forward_iterator I, sentinel_for<I> S, weakly_incrementable O>
1874
  requires indirectly_copyable<I, O>
1875
  constexpr rotate_copy_result<I, O>
1876
  rotate_copy(I first, I middle, S last, O result);
1877
  template<forward_range R, weakly_incrementable O>
1878
  requires indirectly_copyable<iterator_t<R>, O>
1879
  constexpr rotate_copy_result<borrowed_iterator_t<R>, O>
1880
  rotate_copy(R&& r, iterator_t<R> middle, O result);
1881
+
1882
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
1883
+ random_access_iterator O, sized_sentinel_for<O> OutS>
1884
+ requires indirectly_copyable<I, O>
1885
+ rotate_copy_truncated_result<I, O>
1886
+ rotate_copy(Ep&& exec, I first, I middle, S last, O result, // freestanding-deleted
1887
+ OutS result_last);
1888
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR>
1889
+ requires indirectly_copyable<iterator_t<R>, iterator_t<OutR>>
1890
+ rotate_copy_truncated_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
1891
+ rotate_copy(Ep&& exec, R&& r, iterator_t<R> middle, // freestanding-deleted
1892
+ OutR&& result_r);
1893
  }
1894
 
1895
  // [alg.random.sample], sample
1896
  template<class PopulationIterator, class SampleIterator,
1897
  class Distance, class UniformRandomBitGenerator>
 
1935
  constexpr ForwardIterator
1936
  shift_left(ForwardIterator first, ForwardIterator last,
1937
  typename iterator_traits<ForwardIterator>::difference_type n);
1938
  template<class ExecutionPolicy, class ForwardIterator>
1939
  ForwardIterator
1940
+ shift_left(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1941
  ForwardIterator first, ForwardIterator last,
1942
  typename iterator_traits<ForwardIterator>::difference_type n);
1943
 
1944
  namespace ranges {
1945
  template<permutable I, sentinel_for<I> S>
1946
  constexpr subrange<I> shift_left(I first, S last, iter_difference_t<I> n);
1947
  template<forward_range R>
1948
  requires permutable<iterator_t<R>>
1949
  constexpr borrowed_subrange_t<R> shift_left(R&& r, range_difference_t<R> n);
1950
+
1951
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S>
1952
+ requires permutable<I>
1953
+ subrange<I>
1954
+ shift_left(Ep&& exec, I first, S last, iter_difference_t<I> n); // freestanding-deleted
1955
+ template<execution-policy Ep, sized-random-access-range R>
1956
+ requires permutable<iterator_t<R>>
1957
+ borrowed_subrange_t<R>
1958
+ shift_left(Ep&& exec, R&& r, range_difference_t<R> n); // freestanding-deleted
1959
  }
1960
 
1961
  template<class ForwardIterator>
1962
  constexpr ForwardIterator
1963
  shift_right(ForwardIterator first, ForwardIterator last,
1964
  typename iterator_traits<ForwardIterator>::difference_type n);
1965
  template<class ExecutionPolicy, class ForwardIterator>
1966
  ForwardIterator
1967
+ shift_right(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1968
  ForwardIterator first, ForwardIterator last,
1969
  typename iterator_traits<ForwardIterator>::difference_type n);
1970
 
1971
  namespace ranges {
1972
  template<permutable I, sentinel_for<I> S>
1973
  constexpr subrange<I> shift_right(I first, S last, iter_difference_t<I> n);
1974
  template<forward_range R>
1975
  requires permutable<iterator_t<R>>
1976
  constexpr borrowed_subrange_t<R> shift_right(R&& r, range_difference_t<R> n);
1977
+
1978
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S>
1979
+ requires permutable<I>
1980
+ subrange<I>
1981
+ shift_right(Ep&& exec, I first, S last, iter_difference_t<I> n); // freestanding-deleted
1982
+ template<execution-policy Ep, sized-random-access-range R>
1983
+ requires permutable<iterator_t<R>>
1984
+ borrowed_subrange_t<R>
1985
+ shift_right(Ep&& exec, R&& r, range_difference_t<R> n); // freestanding-deleted
1986
  }
1987
 
1988
  // [alg.sorting], sorting and related operations
1989
  // [alg.sort], sorting
1990
  template<class RandomAccessIterator>
1991
  constexpr void sort(RandomAccessIterator first, RandomAccessIterator last);
1992
  template<class RandomAccessIterator, class Compare>
1993
  constexpr void sort(RandomAccessIterator first, RandomAccessIterator last,
1994
  Compare comp);
1995
  template<class ExecutionPolicy, class RandomAccessIterator>
1996
+ void sort(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
1997
  RandomAccessIterator first, RandomAccessIterator last);
1998
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
1999
+ void sort(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2000
  RandomAccessIterator first, RandomAccessIterator last,
2001
  Compare comp);
2002
 
2003
  namespace ranges {
2004
  template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
 
2008
  sort(I first, S last, Comp comp = {}, Proj proj = {});
2009
  template<random_access_range R, class Comp = ranges::less, class Proj = identity>
2010
  requires sortable<iterator_t<R>, Comp, Proj>
2011
  constexpr borrowed_iterator_t<R>
2012
  sort(R&& r, Comp comp = {}, Proj proj = {});
2013
+
2014
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2015
+ class Comp = ranges::less, class Proj = identity>
2016
+ requires sortable<I, Comp, Proj>
2017
+ I sort(Ep&& exec, I first, S last, Comp comp = {}, Proj proj = {}); // freestanding-deleted
2018
+ template<execution-policy Ep, sized-random-access-range R, class Comp = ranges::less,
2019
+ class Proj = identity>
2020
+ requires sortable<iterator_t<R>, Comp, Proj>
2021
+ borrowed_iterator_t<R>
2022
+ sort(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
2023
  }
2024
 
2025
  template<class RandomAccessIterator>
2026
+ constexpr void stable_sort(RandomAccessIterator first, RandomAccessIterator last); // hosted
2027
  template<class RandomAccessIterator, class Compare>
2028
+ constexpr void stable_sort(RandomAccessIterator first, RandomAccessIterator last, // hosted
2029
  Compare comp);
2030
  template<class ExecutionPolicy, class RandomAccessIterator>
2031
+ void stable_sort(ExecutionPolicy&& exec, // hosted, see [algorithms.parallel.overloads]
2032
  RandomAccessIterator first, RandomAccessIterator last);
2033
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
2034
+ void stable_sort(ExecutionPolicy&& exec, // hosted, see [algorithms.parallel.overloads]
2035
  RandomAccessIterator first, RandomAccessIterator last,
2036
  Compare comp);
2037
 
2038
  namespace ranges {
2039
  template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
2040
  class Proj = identity>
2041
  requires sortable<I, Comp, Proj>
2042
+ constexpr I stable_sort(I first, S last, Comp comp = {}, Proj proj = {}); // hosted
2043
  template<random_access_range R, class Comp = ranges::less, class Proj = identity>
2044
  requires sortable<iterator_t<R>, Comp, Proj>
2045
+ constexpr borrowed_iterator_t<R>
2046
+ stable_sort(R&& r, Comp comp = {}, Proj proj = {}); // hosted
2047
+
2048
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2049
+ class Comp = ranges::less, class Proj = identity>
2050
+ requires sortable<I, Comp, Proj>
2051
+ I stable_sort(Ep&& exec, I first, S last, Comp comp = {},
2052
+ Proj proj = {}); // freestanding-deleted
2053
+ template<execution-policy Ep, sized-random-access-range R, class Comp = ranges::less,
2054
+ class Proj = identity>
2055
+ requires sortable<iterator_t<R>, Comp, Proj>
2056
  borrowed_iterator_t<R>
2057
+ stable_sort(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
2058
  }
2059
 
2060
  template<class RandomAccessIterator>
2061
  constexpr void partial_sort(RandomAccessIterator first, RandomAccessIterator middle,
2062
  RandomAccessIterator last);
2063
  template<class RandomAccessIterator, class Compare>
2064
  constexpr void partial_sort(RandomAccessIterator first, RandomAccessIterator middle,
2065
  RandomAccessIterator last, Compare comp);
2066
  template<class ExecutionPolicy, class RandomAccessIterator>
2067
+ void partial_sort(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2068
  RandomAccessIterator first, RandomAccessIterator middle,
2069
  RandomAccessIterator last);
2070
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
2071
+ void partial_sort(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2072
  RandomAccessIterator first, RandomAccessIterator middle,
2073
  RandomAccessIterator last, Compare comp);
2074
 
2075
  namespace ranges {
2076
  template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
 
2081
  template<random_access_range R, class Comp = ranges::less, class Proj = identity>
2082
  requires sortable<iterator_t<R>, Comp, Proj>
2083
  constexpr borrowed_iterator_t<R>
2084
  partial_sort(R&& r, iterator_t<R> middle, Comp comp = {},
2085
  Proj proj = {});
2086
+
2087
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2088
+ class Comp = ranges::less, class Proj = identity>
2089
+ requires sortable<I, Comp, Proj>
2090
+ I partial_sort(Ep&& exec, I first, I middle, S last, Comp comp = {},
2091
+ Proj proj = {}); // freestanding-deleted
2092
+ template<execution-policy Ep, sized-random-access-range R,
2093
+ class Comp = ranges::less, class Proj = identity>
2094
+ requires sortable<iterator_t<R>, Comp, Proj>
2095
+ borrowed_iterator_t<R>
2096
+ partial_sort(Ep&& exec, R&& r, iterator_t<R> middle, Comp comp = {},
2097
+ Proj proj = {}); // freestanding-deleted
2098
  }
2099
 
2100
  template<class InputIterator, class RandomAccessIterator>
2101
  constexpr RandomAccessIterator
2102
  partial_sort_copy(InputIterator first, InputIterator last,
 
2108
  RandomAccessIterator result_first,
2109
  RandomAccessIterator result_last,
2110
  Compare comp);
2111
  template<class ExecutionPolicy, class ForwardIterator, class RandomAccessIterator>
2112
  RandomAccessIterator
2113
+ partial_sort_copy(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2114
  ForwardIterator first, ForwardIterator last,
2115
  RandomAccessIterator result_first,
2116
  RandomAccessIterator result_last);
2117
  template<class ExecutionPolicy, class ForwardIterator, class RandomAccessIterator,
2118
  class Compare>
2119
  RandomAccessIterator
2120
+ partial_sort_copy(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2121
  ForwardIterator first, ForwardIterator last,
2122
  RandomAccessIterator result_first,
2123
  RandomAccessIterator result_last,
2124
  Compare comp);
2125
 
 
2142
  indirect_strict_weak_order<Comp, projected<iterator_t<R1>, Proj1>,
2143
  projected<iterator_t<R2>, Proj2>>
2144
  constexpr partial_sort_copy_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
2145
  partial_sort_copy(R1&& r, R2&& result_r, Comp comp = {},
2146
  Proj1 proj1 = {}, Proj2 proj2 = {});
2147
+
2148
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
2149
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
2150
+ class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
2151
+ requires indirectly_copyable<I1, I2> && sortable<I2, Comp, Proj2> &&
2152
+ indirect_strict_weak_order<Comp, projected<I1, Proj1>, projected<I2, Proj2>>
2153
+ partial_sort_copy_result<I1, I2>
2154
+ partial_sort_copy(Ep&& exec, I1 first, S1 last, I2 result_first, S2 result_last,
2155
+ Comp comp = {}, Proj1 proj1 = {},
2156
+ Proj2 proj2 = {}); // freestanding-deleted
2157
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
2158
+ class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
2159
+ requires indirectly_copyable<iterator_t<R1>, iterator_t<R2>> &&
2160
+ sortable<iterator_t<R2>, Comp, Proj2> &&
2161
+ indirect_strict_weak_order<Comp, projected<iterator_t<R1>, Proj1>,
2162
+ projected<iterator_t<R2>, Proj2>>
2163
+ partial_sort_copy_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>>
2164
+ partial_sort_copy(Ep&& exec, R1&& r, R2&& result_r, Comp comp = {},
2165
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2166
  }
2167
 
2168
  template<class ForwardIterator>
2169
  constexpr bool is_sorted(ForwardIterator first, ForwardIterator last);
2170
  template<class ForwardIterator, class Compare>
2171
  constexpr bool is_sorted(ForwardIterator first, ForwardIterator last,
2172
  Compare comp);
2173
  template<class ExecutionPolicy, class ForwardIterator>
2174
+ bool is_sorted(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2175
  ForwardIterator first, ForwardIterator last);
2176
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
2177
+ bool is_sorted(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2178
  ForwardIterator first, ForwardIterator last,
2179
  Compare comp);
2180
 
2181
  namespace ranges {
2182
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
2183
  indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
2184
  constexpr bool is_sorted(I first, S last, Comp comp = {}, Proj proj = {});
2185
  template<forward_range R, class Proj = identity,
2186
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2187
  constexpr bool is_sorted(R&& r, Comp comp = {}, Proj proj = {});
2188
+
2189
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2190
+ class Proj = identity,
2191
+ indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
2192
+ bool is_sorted(Ep&& exec, I first, S last, Comp comp = {},
2193
+ Proj proj = {}); // freestanding-deleted
2194
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
2195
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2196
+ bool is_sorted(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
2197
  }
2198
 
2199
  template<class ForwardIterator>
2200
  constexpr ForwardIterator
2201
  is_sorted_until(ForwardIterator first, ForwardIterator last);
 
2203
  constexpr ForwardIterator
2204
  is_sorted_until(ForwardIterator first, ForwardIterator last,
2205
  Compare comp);
2206
  template<class ExecutionPolicy, class ForwardIterator>
2207
  ForwardIterator
2208
+ is_sorted_until(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2209
  ForwardIterator first, ForwardIterator last);
2210
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
2211
  ForwardIterator
2212
+ is_sorted_until(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2213
  ForwardIterator first, ForwardIterator last,
2214
  Compare comp);
2215
 
2216
  namespace ranges {
2217
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
 
2219
  constexpr I is_sorted_until(I first, S last, Comp comp = {}, Proj proj = {});
2220
  template<forward_range R, class Proj = identity,
2221
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2222
  constexpr borrowed_iterator_t<R>
2223
  is_sorted_until(R&& r, Comp comp = {}, Proj proj = {});
2224
+
2225
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2226
+ class Proj = identity,
2227
+ indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
2228
+ I is_sorted_until(Ep&& exec, I first, S last, Comp comp = {},
2229
+ Proj proj = {}); // freestanding-deleted
2230
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
2231
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
2232
+ borrowed_iterator_t<R>
2233
+ is_sorted_until(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
2234
  }
2235
 
2236
  // [alg.nth.element], Nth element
2237
  template<class RandomAccessIterator>
2238
  constexpr void nth_element(RandomAccessIterator first, RandomAccessIterator nth,
2239
  RandomAccessIterator last);
2240
  template<class RandomAccessIterator, class Compare>
2241
  constexpr void nth_element(RandomAccessIterator first, RandomAccessIterator nth,
2242
  RandomAccessIterator last, Compare comp);
2243
  template<class ExecutionPolicy, class RandomAccessIterator>
2244
+ void nth_element(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2245
  RandomAccessIterator first, RandomAccessIterator nth,
2246
  RandomAccessIterator last);
2247
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
2248
+ void nth_element(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2249
  RandomAccessIterator first, RandomAccessIterator nth,
2250
  RandomAccessIterator last, Compare comp);
2251
 
2252
  namespace ranges {
2253
  template<random_access_iterator I, sentinel_for<I> S, class Comp = ranges::less,
 
2257
  nth_element(I first, I nth, S last, Comp comp = {}, Proj proj = {});
2258
  template<random_access_range R, class Comp = ranges::less, class Proj = identity>
2259
  requires sortable<iterator_t<R>, Comp, Proj>
2260
  constexpr borrowed_iterator_t<R>
2261
  nth_element(R&& r, iterator_t<R> nth, Comp comp = {}, Proj proj = {});
2262
+
2263
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2264
+ class Comp = ranges::less, class Proj = identity>
2265
+ requires sortable<I, Comp, Proj>
2266
+ I nth_element(Ep&& exec, I first, I nth, S last, Comp comp = {},
2267
+ Proj proj = {}); // freestanding-deleted
2268
+ template<execution-policy Ep, sized-random-access-range R, class Comp = ranges::less,
2269
+ class Proj = identity>
2270
+ requires sortable<iterator_t<R>, Comp, Proj>
2271
+ borrowed_iterator_t<R>
2272
+ nth_element(Ep&& exec, R&& r, iterator_t<R> nth, Comp comp = {},
2273
+ Proj proj = {}); // freestanding-deleted
2274
  }
2275
 
2276
  // [alg.binary.search], binary search
2277
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type>
2278
  constexpr ForwardIterator
2279
  lower_bound(ForwardIterator first, ForwardIterator last,
2280
  const T& value);
2281
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type,
2282
+ class Compare>
2283
  constexpr ForwardIterator
2284
  lower_bound(ForwardIterator first, ForwardIterator last,
2285
  const T& value, Compare comp);
2286
 
2287
  namespace ranges {
2288
+ template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
2289
+ class T = projected_value_t<I, Proj>,
2290
  indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
2291
  constexpr I lower_bound(I first, S last, const T& value, Comp comp = {},
2292
  Proj proj = {});
2293
+ template<forward_range R, class Proj = identity,
2294
+ class T = projected_value_t<iterator_t<R>, Proj>,
2295
  indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
2296
  ranges::less>
2297
  constexpr borrowed_iterator_t<R>
2298
  lower_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {});
2299
  }
2300
 
2301
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type>
2302
  constexpr ForwardIterator
2303
  upper_bound(ForwardIterator first, ForwardIterator last,
2304
  const T& value);
2305
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type,
2306
+ class Compare>
2307
  constexpr ForwardIterator
2308
  upper_bound(ForwardIterator first, ForwardIterator last,
2309
  const T& value, Compare comp);
2310
 
2311
  namespace ranges {
2312
+ template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
2313
+ class T = projected_value_t<I, Proj>
2314
  indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
2315
  constexpr I upper_bound(I first, S last, const T& value, Comp comp = {}, Proj proj = {});
2316
+ template<forward_range R, class Proj = identity,
2317
+ class T = projected_value_t<iterator_t<R>, Proj>,
2318
  indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
2319
  ranges::less>
2320
  constexpr borrowed_iterator_t<R>
2321
  upper_bound(R&& r, const T& value, Comp comp = {}, Proj proj = {});
2322
  }
2323
 
2324
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type>
2325
  constexpr pair<ForwardIterator, ForwardIterator>
2326
  equal_range(ForwardIterator first, ForwardIterator last,
2327
  const T& value);
2328
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type,
2329
+ class Compare>
2330
  constexpr pair<ForwardIterator, ForwardIterator>
2331
  equal_range(ForwardIterator first, ForwardIterator last,
2332
  const T& value, Compare comp);
2333
 
2334
  namespace ranges {
2335
+ template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
2336
+ class T = projected_value_t<I, Proj,
2337
  indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
2338
  constexpr subrange<I>
2339
  equal_range(I first, S last, const T& value, Comp comp = {}, Proj proj = {});
2340
+ template<forward_range R, class Proj = identity,
2341
+ class T = projected_value_t<iterator_t<R>, Proj>,
2342
  indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
2343
  ranges::less>
2344
  constexpr borrowed_subrange_t<R>
2345
  equal_range(R&& r, const T& value, Comp comp = {}, Proj proj = {});
2346
  }
2347
 
2348
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type>
2349
  constexpr bool
2350
  binary_search(ForwardIterator first, ForwardIterator last,
2351
  const T& value);
2352
+ template<class ForwardIterator, class T = iterator_traits<ForwardIterator>::value_type,
2353
+ class Compare>
2354
  constexpr bool
2355
  binary_search(ForwardIterator first, ForwardIterator last,
2356
  const T& value, Compare comp);
2357
 
2358
  namespace ranges {
2359
+ template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
2360
+ class T = projected_value_t<I, Proj>,
2361
  indirect_strict_weak_order<const T*, projected<I, Proj>> Comp = ranges::less>
2362
  constexpr bool binary_search(I first, S last, const T& value, Comp comp = {},
2363
  Proj proj = {});
2364
+ template<forward_range R, class Proj = identity,
2365
+ class T = projected_value_t<iterator_t<R>, Proj>,
2366
  indirect_strict_weak_order<const T*, projected<iterator_t<R>, Proj>> Comp =
2367
  ranges::less>
2368
  constexpr bool binary_search(R&& r, const T& value, Comp comp = {},
2369
  Proj proj = {});
2370
  }
2371
 
2372
  // [alg.partitions], partitions
2373
  template<class InputIterator, class Predicate>
2374
  constexpr bool is_partitioned(InputIterator first, InputIterator last, Predicate pred);
2375
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
2376
+ bool is_partitioned(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2377
  ForwardIterator first, ForwardIterator last, Predicate pred);
2378
 
2379
  namespace ranges {
2380
  template<input_iterator I, sentinel_for<I> S, class Proj = identity,
2381
  indirect_unary_predicate<projected<I, Proj>> Pred>
2382
  constexpr bool is_partitioned(I first, S last, Pred pred, Proj proj = {});
2383
  template<input_range R, class Proj = identity,
2384
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
2385
  constexpr bool is_partitioned(R&& r, Pred pred, Proj proj = {});
2386
+
2387
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2388
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
2389
+ bool is_partitioned(Ep&& exec, I first, S last, Pred pred,
2390
+ Proj proj = {}); // freestanding-deleted
2391
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
2392
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
2393
+ bool is_partitioned(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
2394
  }
2395
 
2396
  template<class ForwardIterator, class Predicate>
2397
  constexpr ForwardIterator partition(ForwardIterator first,
2398
  ForwardIterator last,
2399
  Predicate pred);
2400
  template<class ExecutionPolicy, class ForwardIterator, class Predicate>
2401
+ ForwardIterator partition(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2402
  ForwardIterator first,
2403
  ForwardIterator last,
2404
  Predicate pred);
2405
 
2406
  namespace ranges {
 
2411
  template<forward_range R, class Proj = identity,
2412
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
2413
  requires permutable<iterator_t<R>>
2414
  constexpr borrowed_subrange_t<R>
2415
  partition(R&& r, Pred pred, Proj proj = {});
2416
+
2417
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2418
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
2419
+ subrange<I>
2420
+ partition(Ep&& exec, I first, S last, Pred pred, Proj proj = {}); // freestanding-deleted
2421
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
2422
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
2423
+ requires permutable<iterator_t<R>>
2424
+ borrowed_subrange_t<R>
2425
+ partition(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
2426
  }
2427
 
2428
  template<class BidirectionalIterator, class Predicate>
2429
+ constexpr BidirectionalIterator stable_partition(BidirectionalIterator first, // hosted
2430
  BidirectionalIterator last,
2431
  Predicate pred);
2432
  template<class ExecutionPolicy, class BidirectionalIterator, class Predicate>
2433
+ BidirectionalIterator stable_partition(ExecutionPolicy&& exec, // hosted,
2434
+ BidirectionalIterator first, // see [algorithms.parallel.overloads]
2435
  BidirectionalIterator last,
2436
  Predicate pred);
2437
 
2438
  namespace ranges {
2439
  template<bidirectional_iterator I, sentinel_for<I> S, class Proj = identity,
2440
  indirect_unary_predicate<projected<I, Proj>> Pred>
2441
  requires permutable<I>
2442
+ constexpr subrange<I> stable_partition(I first, S last, Pred pred, // hosted
2443
+ Proj proj = {});
2444
  template<bidirectional_range R, class Proj = identity,
2445
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
2446
  requires permutable<iterator_t<R>>
2447
+ constexpr borrowed_subrange_t<R> stable_partition(R&& r, Pred pred, // hosted
2448
+ Proj proj = {});
2449
+
2450
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2451
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
2452
+ requires permutable<I>
2453
+ subrange<I>
2454
+ stable_partition(Ep&& exec, I first, S last, Pred pred,
2455
+ Proj proj = {}); // freestanding-deleted
2456
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
2457
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
2458
+ requires permutable<iterator_t<R>>
2459
+ borrowed_subrange_t<R>
2460
+ stable_partition(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted
2461
  }
2462
 
2463
  template<class InputIterator, class OutputIterator1,
2464
  class OutputIterator2, class Predicate>
2465
  constexpr pair<OutputIterator1, OutputIterator2>
 
2467
  OutputIterator1 out_true, OutputIterator2 out_false,
2468
  Predicate pred);
2469
  template<class ExecutionPolicy, class ForwardIterator, class ForwardIterator1,
2470
  class ForwardIterator2, class Predicate>
2471
  pair<ForwardIterator1, ForwardIterator2>
2472
+ partition_copy(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2473
  ForwardIterator first, ForwardIterator last,
2474
  ForwardIterator1 out_true, ForwardIterator2 out_false,
2475
  Predicate pred);
2476
 
2477
  namespace ranges {
 
2490
  indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
2491
  requires indirectly_copyable<iterator_t<R>, O1> &&
2492
  indirectly_copyable<iterator_t<R>, O2>
2493
  constexpr partition_copy_result<borrowed_iterator_t<R>, O1, O2>
2494
  partition_copy(R&& r, O1 out_true, O2 out_false, Pred pred, Proj proj = {});
2495
+
2496
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2497
+ random_access_iterator O1, sized_sentinel_for<O1> OutS1,
2498
+ random_access_iterator O2, sized_sentinel_for<O2> OutS2,
2499
+ class Proj = identity, indirect_unary_predicate<projected<I, Proj>> Pred>
2500
+ requires indirectly_copyable<I, O1> && indirectly_copyable<I, O2>
2501
+ partition_copy_result<I, O1, O2>
2502
+ partition_copy(Ep&& exec, I first, S last, O1 out_true, OutS1 last_true,
2503
+ O2 out_false, OutS2 last_false, Pred pred,
2504
+ Proj proj = {}); // freestanding-deleted
2505
+ template<execution-policy Ep, sized-random-access-range R,
2506
+ sized-random-access-range OutR1, sized-random-access-range OutR2,
2507
+ class Proj = identity,
2508
+ indirect_unary_predicate<projected<iterator_t<R>, Proj>> Pred>
2509
+ requires indirectly_copyable<iterator_t<R>, iterator_t<OutR1>> &&
2510
+ indirectly_copyable<iterator_t<R>, iterator_t<OutR2>>
2511
+ partition_copy_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR1>,
2512
+ borrowed_iterator_t<OutR2>>
2513
+ partition_copy(Ep&& exec, R&& r, OutR1&& out_true_r, OutR2&& out_false_r, Pred pred,
2514
+ Proj proj = {}); // freestanding-deleted
2515
  }
2516
 
2517
  template<class ForwardIterator, class Predicate>
2518
  constexpr ForwardIterator
2519
  partition_point(ForwardIterator first, ForwardIterator last,
 
2542
  InputIterator2 first2, InputIterator2 last2,
2543
  OutputIterator result, Compare comp);
2544
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2545
  class ForwardIterator>
2546
  ForwardIterator
2547
+ merge(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2548
  ForwardIterator1 first1, ForwardIterator1 last1,
2549
  ForwardIterator2 first2, ForwardIterator2 last2,
2550
  ForwardIterator result);
2551
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2552
  class ForwardIterator, class Compare>
2553
  ForwardIterator
2554
+ merge(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2555
  ForwardIterator1 first1, ForwardIterator1 last1,
2556
  ForwardIterator2 first2, ForwardIterator2 last2,
2557
  ForwardIterator result, Compare comp);
2558
 
2559
  namespace ranges {
 
2571
  class Proj1 = identity, class Proj2 = identity>
2572
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
2573
  constexpr merge_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
2574
  merge(R1&& r1, R2&& r2, O result,
2575
  Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
2576
+
2577
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
2578
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
2579
+ random_access_iterator O, sized_sentinel_for<O> OutS, class Comp = ranges::less,
2580
+ class Proj1 = identity, class Proj2 = identity>
2581
+ requires mergeable<I1, I2, O, Comp, Proj1, Proj2>
2582
+ merge_result<I1, I2, O>
2583
+ merge(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2, O result, OutS result_last,
2584
+ Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2585
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
2586
+ sized-random-access-range OutR, class Comp = ranges::less,
2587
+ class Proj1 = identity, class Proj2 = identity>
2588
+ requires mergeable<iterator_t<R1>, iterator_t<R2>, iterator_t<OutR>, Comp, Proj1, Proj2>
2589
+ merge_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, borrowed_iterator_t<OutR>>
2590
+ merge(Ep&& exec, R1&& r1, R2&& r2, OutR&& result_r,
2591
+ Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2592
  }
2593
 
2594
  template<class BidirectionalIterator>
2595
+ constexpr void inplace_merge(BidirectionalIterator first, // hosted
2596
  BidirectionalIterator middle,
2597
  BidirectionalIterator last);
2598
  template<class BidirectionalIterator, class Compare>
2599
+ constexpr void inplace_merge(BidirectionalIterator first, // hosted
2600
  BidirectionalIterator middle,
2601
  BidirectionalIterator last, Compare comp);
2602
  template<class ExecutionPolicy, class BidirectionalIterator>
2603
+ void inplace_merge(ExecutionPolicy&& exec, // hosted, see [algorithms.parallel.overloads]
2604
  BidirectionalIterator first,
2605
  BidirectionalIterator middle,
2606
  BidirectionalIterator last);
2607
  template<class ExecutionPolicy, class BidirectionalIterator, class Compare>
2608
+ void inplace_merge(ExecutionPolicy&& exec, // hosted, see [algorithms.parallel.overloads]
2609
  BidirectionalIterator first,
2610
  BidirectionalIterator middle,
2611
  BidirectionalIterator last, Compare comp);
2612
 
2613
  namespace ranges {
2614
  template<bidirectional_iterator I, sentinel_for<I> S, class Comp = ranges::less,
2615
  class Proj = identity>
2616
  requires sortable<I, Comp, Proj>
2617
+ constexpr I
2618
+ inplace_merge(I first, I middle, S last, Comp comp = {}, Proj proj = {}); // hosted
2619
  template<bidirectional_range R, class Comp = ranges::less, class Proj = identity>
2620
  requires sortable<iterator_t<R>, Comp, Proj>
2621
+ constexpr borrowed_iterator_t<R>
2622
+ inplace_merge(R&& r, iterator_t<R> middle, Comp comp = {}, Proj proj = {}); // hosted
2623
+
2624
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
2625
+ class Comp = ranges::less, class Proj = identity>
2626
+ requires sortable<I, Comp, Proj>
2627
+ I inplace_merge(Ep&& exec, I first, I middle, S last, Comp comp = {},
2628
+ Proj proj = {}); // freestanding-deleted
2629
+ template<execution-policy Ep, sized-random-access-range R, class Comp = ranges::less,
2630
+ class Proj = identity>
2631
+ requires sortable<iterator_t<R>, Comp, Proj>
2632
  borrowed_iterator_t<R>
2633
+ inplace_merge(Ep&& exec, R&& r, iterator_t<R> middle, Comp comp = {},
2634
+ Proj proj = {}); // freestanding-deleted
2635
  }
2636
 
2637
  // [alg.set.operations], set operations
2638
  template<class InputIterator1, class InputIterator2>
2639
  constexpr bool includes(InputIterator1 first1, InputIterator1 last1,
 
2641
  template<class InputIterator1, class InputIterator2, class Compare>
2642
  constexpr bool includes(InputIterator1 first1, InputIterator1 last1,
2643
  InputIterator2 first2, InputIterator2 last2,
2644
  Compare comp);
2645
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
2646
+ bool includes(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2647
  ForwardIterator1 first1, ForwardIterator1 last1,
2648
  ForwardIterator2 first2, ForwardIterator2 last2);
2649
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2650
  class Compare>
2651
+ bool includes(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2652
  ForwardIterator1 first1, ForwardIterator1 last1,
2653
  ForwardIterator2 first2, ForwardIterator2 last2,
2654
  Compare comp);
2655
 
2656
  namespace ranges {
 
2664
  class Proj2 = identity,
2665
  indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>,
2666
  projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
2667
  constexpr bool includes(R1&& r1, R2&& r2, Comp comp = {},
2668
  Proj1 proj1 = {}, Proj2 proj2 = {});
2669
+
2670
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
2671
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
2672
+ class Proj1 = identity, class Proj2 = identity,
2673
+ indirect_strict_weak_order<projected<I1, Proj1>, projected<I2, Proj2>> Comp =
2674
+ ranges::less>
2675
+ bool includes(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2,
2676
+ Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2677
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
2678
+ class Proj1 = identity, class Proj2 = identity,
2679
+ indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>,
2680
+ projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
2681
+ bool includes(Ep&& exec, R1&& r1, R2&& r2,
2682
+ Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2683
  }
2684
 
2685
  template<class InputIterator1, class InputIterator2, class OutputIterator>
2686
  constexpr OutputIterator
2687
  set_union(InputIterator1 first1, InputIterator1 last1,
 
2693
  InputIterator2 first2, InputIterator2 last2,
2694
  OutputIterator result, Compare comp);
2695
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2696
  class ForwardIterator>
2697
  ForwardIterator
2698
+ set_union(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2699
  ForwardIterator1 first1, ForwardIterator1 last1,
2700
  ForwardIterator2 first2, ForwardIterator2 last2,
2701
  ForwardIterator result);
2702
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2703
  class ForwardIterator, class Compare>
2704
  ForwardIterator
2705
+ set_union(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2706
  ForwardIterator1 first1, ForwardIterator1 last1,
2707
  ForwardIterator2 first2, ForwardIterator2 last2,
2708
  ForwardIterator result, Compare comp);
2709
 
2710
  namespace ranges {
 
2722
  class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
2723
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
2724
  constexpr set_union_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
2725
  set_union(R1&& r1, R2&& r2, O result, Comp comp = {},
2726
  Proj1 proj1 = {}, Proj2 proj2 = {});
2727
+
2728
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
2729
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
2730
+ random_access_iterator O, sized_sentinel_for<O> OutS, class Comp = ranges::less,
2731
+ class Proj1 = identity, class Proj2 = identity>
2732
+ requires mergeable<I1, I2, O, Comp, Proj1, Proj2>
2733
+ set_union_result<I1, I2, O>
2734
+ set_union(Ep&& exec, I1 first1, S1 last1,
2735
+ I2 first2, S2 last2, O result, OutS result_last,
2736
+ Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2737
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
2738
+ sized-random-access-range OutR, class Comp = ranges::less,
2739
+ class Proj1 = identity, class Proj2 = identity>
2740
+ requires mergeable<iterator_t<R1>, iterator_t<R2>, iterator_t<OutR>, Comp, Proj1, Proj2>
2741
+ set_union_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>,
2742
+ borrowed_iterator_t<OutR>>
2743
+ set_union(Ep&& exec, R1&& r1, R2&& r2, OutR&& result_r, Comp comp = {},
2744
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2745
  }
2746
 
2747
  template<class InputIterator1, class InputIterator2, class OutputIterator>
2748
  constexpr OutputIterator
2749
  set_intersection(InputIterator1 first1, InputIterator1 last1,
 
2755
  InputIterator2 first2, InputIterator2 last2,
2756
  OutputIterator result, Compare comp);
2757
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2758
  class ForwardIterator>
2759
  ForwardIterator
2760
+ set_intersection(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2761
  ForwardIterator1 first1, ForwardIterator1 last1,
2762
  ForwardIterator2 first2, ForwardIterator2 last2,
2763
  ForwardIterator result);
2764
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2765
  class ForwardIterator, class Compare>
2766
  ForwardIterator
2767
+ set_intersection(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2768
  ForwardIterator1 first1, ForwardIterator1 last1,
2769
  ForwardIterator2 first2, ForwardIterator2 last2,
2770
  ForwardIterator result, Compare comp);
2771
 
2772
  namespace ranges {
 
2784
  class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
2785
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
2786
  constexpr set_intersection_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>, O>
2787
  set_intersection(R1&& r1, R2&& r2, O result,
2788
  Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
2789
+
2790
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
2791
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
2792
+ random_access_iterator O, sized_sentinel_for<O> OutS, class Comp = ranges::less,
2793
+ class Proj1 = identity, class Proj2 = identity>
2794
+ requires mergeable<I1, I2, O, Comp, Proj1, Proj2>
2795
+ set_intersection_result<I1, I2, O>
2796
+ set_intersection(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2,
2797
+ O result, OutS result_last, Comp comp = {}, Proj1 proj1 = {},
2798
+ Proj2 proj2 = {}); // freestanding-deleted
2799
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
2800
+ sized-random-access-range OutR, class Comp = ranges::less,
2801
+ class Proj1 = identity, class Proj2 = identity>
2802
+ requires mergeable<iterator_t<R1>, iterator_t<R2>, iterator_t<OutR>, Comp, Proj1, Proj2>
2803
+ set_intersection_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>,
2804
+ borrowed_iterator_t<OutR>>
2805
+ set_intersection(Ep&& exec, R1&& r1, R2&& r2, OutR&& result_r, Comp comp = {},
2806
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2807
  }
2808
 
2809
  template<class InputIterator1, class InputIterator2, class OutputIterator>
2810
  constexpr OutputIterator
2811
  set_difference(InputIterator1 first1, InputIterator1 last1,
 
2817
  InputIterator2 first2, InputIterator2 last2,
2818
  OutputIterator result, Compare comp);
2819
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2820
  class ForwardIterator>
2821
  ForwardIterator
2822
+ set_difference(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2823
  ForwardIterator1 first1, ForwardIterator1 last1,
2824
  ForwardIterator2 first2, ForwardIterator2 last2,
2825
  ForwardIterator result);
2826
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2827
  class ForwardIterator, class Compare>
2828
  ForwardIterator
2829
+ set_difference(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2830
  ForwardIterator1 first1, ForwardIterator1 last1,
2831
  ForwardIterator2 first2, ForwardIterator2 last2,
2832
  ForwardIterator result, Compare comp);
2833
 
2834
  namespace ranges {
 
2846
  class Comp = ranges::less, class Proj1 = identity, class Proj2 = identity>
2847
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
2848
  constexpr set_difference_result<borrowed_iterator_t<R1>, O>
2849
  set_difference(R1&& r1, R2&& r2, O result,
2850
  Comp comp = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
2851
+
2852
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
2853
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
2854
+ random_access_iterator O, sized_sentinel_for<O> OutS, class Comp = ranges::less,
2855
+ class Proj1 = identity, class Proj2 = identity>
2856
+ requires mergeable<I1, I2, O, Comp, Proj1, Proj2>
2857
+ set_difference_result<I1, O>
2858
+ set_difference(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2,
2859
+ O result, OutS result_last, Comp comp = {}, Proj1 proj1 = {},
2860
+ Proj2 proj2 = {}); // freestanding-deleted
2861
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
2862
+ sized-random-access-range OutR, class Comp = ranges::less,
2863
+ class Proj1 = identity, class Proj2 = identity>
2864
+ requires mergeable<iterator_t<R1>, iterator_t<R2>, iterator_t<OutR>, Comp, Proj1, Proj2>
2865
+ set_difference_result<borrowed_iterator_t<R1>, borrowed_iterator_t<OutR>>
2866
+ set_difference(Ep&& exec, R1&& r1, R2&& r2, OutR&& result_r, Comp comp = {},
2867
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2868
  }
2869
 
2870
  template<class InputIterator1, class InputIterator2, class OutputIterator>
2871
  constexpr OutputIterator
2872
  set_symmetric_difference(InputIterator1 first1, InputIterator1 last1,
 
2878
  InputIterator2 first2, InputIterator2 last2,
2879
  OutputIterator result, Compare comp);
2880
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2881
  class ForwardIterator>
2882
  ForwardIterator
2883
+ set_symmetric_difference(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2884
  ForwardIterator1 first1, ForwardIterator1 last1,
2885
  ForwardIterator2 first2, ForwardIterator2 last2,
2886
  ForwardIterator result);
2887
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
2888
  class ForwardIterator, class Compare>
2889
  ForwardIterator
2890
+ set_symmetric_difference(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
2891
  ForwardIterator1 first1, ForwardIterator1 last1,
2892
  ForwardIterator2 first2, ForwardIterator2 last2,
2893
  ForwardIterator result, Compare comp);
2894
 
2895
  namespace ranges {
 
2909
  requires mergeable<iterator_t<R1>, iterator_t<R2>, O, Comp, Proj1, Proj2>
2910
  constexpr set_symmetric_difference_result<borrowed_iterator_t<R1>,
2911
  borrowed_iterator_t<R2>, O>
2912
  set_symmetric_difference(R1&& r1, R2&& r2, O result, Comp comp = {},
2913
  Proj1 proj1 = {}, Proj2 proj2 = {});
2914
+
2915
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
2916
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
2917
+ random_access_iterator O, sized_sentinel_for<O> OutS, class Comp = ranges::less,
2918
+ class Proj1 = identity, class Proj2 = identity>
2919
+ requires mergeable<I1, I2, O, Comp, Proj1, Proj2>
2920
+ set_symmetric_difference_result<I1, I2, O>
2921
+ set_symmetric_difference(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2,
2922
+ O result, OutS result_last, Comp comp = {},
2923
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2924
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
2925
+ sized-random-access-range OutR, class Comp = ranges::less,
2926
+ class Proj1 = identity, class Proj2 = identity>
2927
+ requires mergeable<iterator_t<R1>, iterator_t<R2>, iterator_t<OutR>, Comp, Proj1, Proj2>
2928
+ set_symmetric_difference_result<borrowed_iterator_t<R1>, borrowed_iterator_t<R2>,
2929
+ borrowed_iterator_t<OutR>>
2930
+ set_symmetric_difference(Ep&& exec, R1&& r1, R2&& r2, OutR&& result_r, Comp comp = {},
2931
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
2932
  }
2933
 
2934
  // [alg.heap.operations], heap operations
2935
  template<class RandomAccessIterator>
2936
  constexpr void push_heap(RandomAccessIterator first, RandomAccessIterator last);
 
3008
  constexpr bool is_heap(RandomAccessIterator first, RandomAccessIterator last);
3009
  template<class RandomAccessIterator, class Compare>
3010
  constexpr bool is_heap(RandomAccessIterator first, RandomAccessIterator last,
3011
  Compare comp);
3012
  template<class ExecutionPolicy, class RandomAccessIterator>
3013
+ bool is_heap(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3014
  RandomAccessIterator first, RandomAccessIterator last);
3015
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
3016
+ bool is_heap(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3017
  RandomAccessIterator first, RandomAccessIterator last,
3018
  Compare comp);
3019
 
3020
  namespace ranges {
3021
  template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
3022
  indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
3023
  constexpr bool is_heap(I first, S last, Comp comp = {}, Proj proj = {});
3024
  template<random_access_range R, class Proj = identity,
3025
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3026
  constexpr bool is_heap(R&& r, Comp comp = {}, Proj proj = {});
3027
+
3028
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
3029
+ class Proj = identity,
3030
+ indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
3031
+ bool is_heap(Ep&& exec, I first, S last, Comp comp = {},
3032
+ Proj proj = {}); // freestanding-deleted
3033
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
3034
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3035
+ bool is_heap(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
3036
  }
3037
 
3038
  template<class RandomAccessIterator>
3039
  constexpr RandomAccessIterator
3040
  is_heap_until(RandomAccessIterator first, RandomAccessIterator last);
 
3042
  constexpr RandomAccessIterator
3043
  is_heap_until(RandomAccessIterator first, RandomAccessIterator last,
3044
  Compare comp);
3045
  template<class ExecutionPolicy, class RandomAccessIterator>
3046
  RandomAccessIterator
3047
+ is_heap_until(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3048
  RandomAccessIterator first, RandomAccessIterator last);
3049
  template<class ExecutionPolicy, class RandomAccessIterator, class Compare>
3050
  RandomAccessIterator
3051
+ is_heap_until(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3052
  RandomAccessIterator first, RandomAccessIterator last,
3053
  Compare comp);
3054
 
3055
  namespace ranges {
3056
  template<random_access_iterator I, sentinel_for<I> S, class Proj = identity,
 
3058
  constexpr I is_heap_until(I first, S last, Comp comp = {}, Proj proj = {});
3059
  template<random_access_range R, class Proj = identity,
3060
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3061
  constexpr borrowed_iterator_t<R>
3062
  is_heap_until(R&& r, Comp comp = {}, Proj proj = {});
3063
+
3064
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
3065
+ class Proj = identity,
3066
+ indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
3067
+ I is_heap_until(Ep&& exec, I first, S last, Comp comp = {},
3068
+ Proj proj = {}); // freestanding-deleted
3069
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
3070
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3071
+ borrowed_iterator_t<R>
3072
+ is_heap_until(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
3073
  }
3074
 
3075
  // [alg.min.max], minimum and maximum
3076
  template<class T> constexpr const T& min(const T& a, const T& b);
3077
  template<class T, class Compare>
 
3091
  template<input_range R, class Proj = identity,
3092
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3093
  requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
3094
  constexpr range_value_t<R>
3095
  min(R&& r, Comp comp = {}, Proj proj = {});
3096
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
3097
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3098
+ requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
3099
+ range_value_t<R>
3100
+ min(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
3101
  }
3102
 
3103
  template<class T> constexpr const T& max(const T& a, const T& b);
3104
  template<class T, class Compare>
3105
  constexpr const T& max(const T& a, const T& b, Compare comp);
 
3118
  template<input_range R, class Proj = identity,
3119
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3120
  requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
3121
  constexpr range_value_t<R>
3122
  max(R&& r, Comp comp = {}, Proj proj = {});
3123
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
3124
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3125
+ requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
3126
+ range_value_t<R>
3127
+ max(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
3128
  }
3129
 
3130
  template<class T> constexpr pair<const T&, const T&> minmax(const T& a, const T& b);
3131
  template<class T, class Compare>
3132
  constexpr pair<const T&, const T&> minmax(const T& a, const T& b, Compare comp);
 
3150
  template<input_range R, class Proj = identity,
3151
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3152
  requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
3153
  constexpr minmax_result<range_value_t<R>>
3154
  minmax(R&& r, Comp comp = {}, Proj proj = {});
3155
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
3156
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3157
+ requires indirectly_copyable_storable<iterator_t<R>, range_value_t<R>*>
3158
+ minmax_result<range_value_t<R>>
3159
+ minmax(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
3160
  }
3161
 
3162
  template<class ForwardIterator>
3163
  constexpr ForwardIterator min_element(ForwardIterator first, ForwardIterator last);
3164
  template<class ForwardIterator, class Compare>
3165
  constexpr ForwardIterator min_element(ForwardIterator first, ForwardIterator last,
3166
  Compare comp);
3167
  template<class ExecutionPolicy, class ForwardIterator>
3168
+ ForwardIterator min_element(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3169
  ForwardIterator first, ForwardIterator last);
3170
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
3171
+ ForwardIterator min_element(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3172
  ForwardIterator first, ForwardIterator last,
3173
  Compare comp);
3174
 
3175
  namespace ranges {
3176
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
 
3178
  constexpr I min_element(I first, S last, Comp comp = {}, Proj proj = {});
3179
  template<forward_range R, class Proj = identity,
3180
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3181
  constexpr borrowed_iterator_t<R>
3182
  min_element(R&& r, Comp comp = {}, Proj proj = {});
3183
+
3184
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
3185
+ class Proj = identity,
3186
+ indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
3187
+ I min_element(Ep&& exec, I first, S last, Comp comp = {},
3188
+ Proj proj = {}); // freestanding-deleted
3189
+ template<execution-policy Ep, sized-random-access-range R,
3190
+ class Proj = identity,
3191
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3192
+ borrowed_iterator_t<R>
3193
+ min_element(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
3194
  }
3195
 
3196
  template<class ForwardIterator>
3197
  constexpr ForwardIterator max_element(ForwardIterator first, ForwardIterator last);
3198
  template<class ForwardIterator, class Compare>
3199
  constexpr ForwardIterator max_element(ForwardIterator first, ForwardIterator last,
3200
  Compare comp);
3201
  template<class ExecutionPolicy, class ForwardIterator>
3202
+ ForwardIterator max_element(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3203
  ForwardIterator first, ForwardIterator last);
3204
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
3205
+ ForwardIterator max_element(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3206
  ForwardIterator first, ForwardIterator last,
3207
  Compare comp);
3208
 
3209
  namespace ranges {
3210
  template<forward_iterator I, sentinel_for<I> S, class Proj = identity,
 
3212
  constexpr I max_element(I first, S last, Comp comp = {}, Proj proj = {});
3213
  template<forward_range R, class Proj = identity,
3214
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3215
  constexpr borrowed_iterator_t<R>
3216
  max_element(R&& r, Comp comp = {}, Proj proj = {});
3217
+
3218
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
3219
+ class Proj = identity,
3220
+ indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
3221
+ I max_element(Ep&& exec, I first, S last, Comp comp = {},
3222
+ Proj proj = {}); // freestanding-deleted
3223
+ template<execution-policy Ep, sized-random-access-range R,
3224
+ class Proj = identity,
3225
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3226
+ borrowed_iterator_t<R>
3227
+ max_element(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
3228
  }
3229
 
3230
  template<class ForwardIterator>
3231
  constexpr pair<ForwardIterator, ForwardIterator>
3232
  minmax_element(ForwardIterator first, ForwardIterator last);
3233
  template<class ForwardIterator, class Compare>
3234
  constexpr pair<ForwardIterator, ForwardIterator>
3235
  minmax_element(ForwardIterator first, ForwardIterator last, Compare comp);
3236
  template<class ExecutionPolicy, class ForwardIterator>
3237
  pair<ForwardIterator, ForwardIterator>
3238
+ minmax_element(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3239
  ForwardIterator first, ForwardIterator last);
3240
  template<class ExecutionPolicy, class ForwardIterator, class Compare>
3241
  pair<ForwardIterator, ForwardIterator>
3242
+ minmax_element(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3243
  ForwardIterator first, ForwardIterator last, Compare comp);
3244
 
3245
  namespace ranges {
3246
  template<class I>
3247
  using minmax_element_result = min_max_result<I>;
 
3252
  minmax_element(I first, S last, Comp comp = {}, Proj proj = {});
3253
  template<forward_range R, class Proj = identity,
3254
  indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3255
  constexpr minmax_element_result<borrowed_iterator_t<R>>
3256
  minmax_element(R&& r, Comp comp = {}, Proj proj = {});
3257
+
3258
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
3259
+ class Proj = identity,
3260
+ indirect_strict_weak_order<projected<I, Proj>> Comp = ranges::less>
3261
+ minmax_element_result<I>
3262
+ minmax_element(Ep&& exec, I first, S last, Comp comp = {},
3263
+ Proj proj = {}); // freestanding-deleted
3264
+ template<execution-policy Ep, sized-random-access-range R, class Proj = identity,
3265
+ indirect_strict_weak_order<projected<iterator_t<R>, Proj>> Comp = ranges::less>
3266
+ minmax_element_result<borrowed_iterator_t<R>>
3267
+ minmax_element(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted
3268
  }
3269
 
3270
  // [alg.clamp], bounded value
3271
  template<class T>
3272
  constexpr const T& clamp(const T& v, const T& lo, const T& hi);
 
3290
  lexicographical_compare(InputIterator1 first1, InputIterator1 last1,
3291
  InputIterator2 first2, InputIterator2 last2,
3292
  Compare comp);
3293
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
3294
  bool
3295
+ lexicographical_compare(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3296
  ForwardIterator1 first1, ForwardIterator1 last1,
3297
  ForwardIterator2 first2, ForwardIterator2 last2);
3298
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2,
3299
  class Compare>
3300
  bool
3301
+ lexicographical_compare(ExecutionPolicy&& exec, // freestanding-deleted, see [algorithms.parallel.overloads]
3302
  ForwardIterator1 first1, ForwardIterator1 last1,
3303
  ForwardIterator2 first2, ForwardIterator2 last2,
3304
  Compare comp);
3305
 
3306
  namespace ranges {
 
3316
  indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>,
3317
  projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
3318
  constexpr bool
3319
  lexicographical_compare(R1&& r1, R2&& r2, Comp comp = {},
3320
  Proj1 proj1 = {}, Proj2 proj2 = {});
3321
+
3322
+ template<execution-policy Ep, random_access_iterator I1, sized_sentinel_for<I1> S1,
3323
+ random_access_iterator I2, sized_sentinel_for<I2> S2,
3324
+ class Proj1 = identity, class Proj2 = identity,
3325
+ indirect_strict_weak_order<projected<I1, Proj1>,
3326
+ projected<I2, Proj2>> Comp = ranges::less>
3327
+ bool lexicographical_compare(Ep&& exec, I1 first1, S1 last1, I2 first2, S2 last2,
3328
+ Comp comp = {}, Proj1 proj1 = {},
3329
+ Proj2 proj2 = {}); // freestanding-deleted
3330
+ template<execution-policy Ep, sized-random-access-range R1, sized-random-access-range R2,
3331
+ class Proj1 = identity, class Proj2 = identity,
3332
+ indirect_strict_weak_order<projected<iterator_t<R1>, Proj1>,
3333
+ projected<iterator_t<R2>, Proj2>> Comp = ranges::less>
3334
+ bool lexicographical_compare(Ep&& exec, R1&& r1, R2&& r2, Comp comp = {},
3335
+ Proj1 proj1 = {}, Proj2 proj2 = {}); // freestanding-deleted
3336
  }
3337
 
3338
  // [alg.three.way], three-way comparison algorithms
3339
  template<class InputIterator1, class InputIterator2, class Cmp>
3340
  constexpr auto