From Jason Turner

[algorithms.general]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpqzg8jdmb/{from.md → to.md} +72 -33
tmp/tmpqzg8jdmb/{from.md → to.md} RENAMED
@@ -87,26 +87,58 @@ namespace std {
87
  <class InputIterator1, class InputIterator2, class BinaryPredicate>
88
  pair<InputIterator1, InputIterator2>
89
  mismatch(InputIterator1 first1, InputIterator1 last1,
90
  InputIterator2 first2, BinaryPredicate pred);
91
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  template<class InputIterator1, class InputIterator2>
93
  bool equal(InputIterator1 first1, InputIterator1 last1,
94
  InputIterator2 first2);
95
  template
96
  <class InputIterator1, class InputIterator2, class BinaryPredicate>
97
  bool equal(InputIterator1 first1, InputIterator1 last1,
98
  InputIterator2 first2, BinaryPredicate pred);
99
 
 
 
 
 
 
 
 
 
 
 
100
  template<class ForwardIterator1, class ForwardIterator2>
101
  bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
102
  ForwardIterator2 first2);
103
  template<class ForwardIterator1, class ForwardIterator2,
104
  class BinaryPredicate>
105
  bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
106
  ForwardIterator2 first2, BinaryPredicate pred);
107
 
 
 
 
 
 
 
 
 
 
 
108
  template<class ForwardIterator1, class ForwardIterator2>
109
  ForwardIterator1 search(
110
  ForwardIterator1 first1, ForwardIterator1 last1,
111
  ForwardIterator2 first2, ForwardIterator2 last2);
112
  template<class ForwardIterator1, class ForwardIterator2,
@@ -118,11 +150,11 @@ namespace std {
118
  template<class ForwardIterator, class Size, class T>
119
  ForwardIterator search_n(ForwardIterator first, ForwardIterator last,
120
  Size count, const T& value);
121
  template
122
  <class ForwardIterator, class Size, class T, class BinaryPredicate>
123
- ForwardIterator1 search_n(ForwardIterator first, ForwardIterator last,
124
  Size count, const T& value,
125
  BinaryPredicate pred);
126
 
127
  // [alg.modifying.operations], modifying sequence operations:
128
  // [alg.copy], copy:
@@ -229,21 +261,24 @@ namespace std {
229
  template<class ForwardIterator, class OutputIterator>
230
  OutputIterator rotate_copy(
231
  ForwardIterator first, ForwardIterator middle,
232
  ForwardIterator last, OutputIterator result);
233
 
 
234
  template<class RandomAccessIterator>
235
  void random_shuffle(RandomAccessIterator first,
236
  RandomAccessIterator last);
237
  template<class RandomAccessIterator, class RandomNumberGenerator>
238
  void random_shuffle(RandomAccessIterator first,
239
  RandomAccessIterator last,
240
- RandomNumberGenerator&& rand);
 
 
241
  template<class RandomAccessIterator, class UniformRandomNumberGenerator>
242
  void shuffle(RandomAccessIterator first,
243
  RandomAccessIterator last,
244
- UniformRandomNumberGenerator&& rand);
245
 
246
  // [alg.partitions], partitions:
247
  template <class InputIterator, class Predicate>
248
  bool is_partitioned(InputIterator first, InputIterator last, Predicate pred);
249
 
@@ -457,33 +492,33 @@ namespace std {
457
  template<class RandomAccessIterator, class Compare>
458
  RandomAccessIterator is_heap_until(RandomAccessIterator first, RandomAccessIterator last,
459
  Compare comp);
460
 
461
  // [alg.min.max], minimum and maximum:
462
- template<class T> const T& min(const T& a, const T& b);
463
  template<class T, class Compare>
464
- const T& min(const T& a, const T& b, Compare comp);
465
  template<class T>
466
- T min(initializer_list<T> t);
467
  template<class T, class Compare>
468
- T min(initializer_list<T> t, Compare comp);
469
 
470
- template<class T> const T& max(const T& a, const T& b);
471
  template<class T, class Compare>
472
- const T& max(const T& a, const T& b, Compare comp);
473
  template<class T>
474
- T max(initializer_list<T> t);
475
  template<class T, class Compare>
476
- T max(initializer_list<T> t, Compare comp);
477
 
478
- template<class T> pair<const T&, const T&> minmax(const T& a, const T& b);
479
  template<class T, class Compare>
480
- pair<const T&, const T&> minmax(const T& a, const T& b, Compare comp);
481
  template<class T>
482
- pair<T, T> minmax(initializer_list<T> t);
483
  template<class T, class Compare>
484
- pair<T, T> minmax(initializer_list<T> t, Compare comp);
485
 
486
  template<class ForwardIterator>
487
  ForwardIterator min_element(ForwardIterator first, ForwardIterator last);
488
  template<class ForwardIterator, class Compare>
489
  ForwardIterator min_element(ForwardIterator first, ForwardIterator last,
@@ -535,35 +570,39 @@ the algorithms.
535
  For purposes of determining the existence of data races, algorithms
536
  shall not modify objects referenced through an iterator argument unless
537
  the specification requires such modification.
538
 
539
  Throughout this Clause, the names of template parameters are used to
540
- express type requirements. If an algorithm’s template parameter is
541
- `InputIterator`, `InputIterator1`, or `InputIterator2`, the actual
542
- template argument shall satisfy the requirements of an input iterator (
543
- [[input.iterators]]). If an algorithm’s template parameter is
544
- `OutputIterator`, `OutputIterator1`, or `OutputIterator2`, the actual
545
- template argument shall satisfy the requirements of an output iterator (
546
- [[output.iterators]]). If an algorithm’s template parameter is
547
- `ForwardIterator`, `ForwardIterator1`, or `ForwardIterator2`, the actual
548
- template argument shall satisfy the requirements of a forward iterator (
549
- [[forward.iterators]]). If an algorithm’s template parameter is
550
- `BidirectionalIterator`, `BidirectionalIterator1`, or
551
- `BidirectionalIterator2`, the actual template argument shall satisfy the
552
- requirements of a bidirectional iterator ([[bidirectional.iterators]]).
553
- If an algorithm’s template parameter is `RandomAccessIterator`,
554
- `RandomAccessIterator1`, or `RandomAccessIterator2`, the actual template
 
 
 
 
555
  argument shall satisfy the requirements of a random-access iterator (
556
  [[random.access.iterators]]).
557
 
558
  If an algorithm’s section says that a value pointed to by any iterator
559
  passed as an argument is modified, then that algorithm has an additional
560
  type requirement: The type of that argument shall satisfy the
561
  requirements of a mutable iterator ([[iterator.requirements]]). This
562
- requirement does not affect arguments that are declared as
563
- `OutputIterator`, `OutputIterator1`, or `OutputIterator2`, because
564
- output iterators must always be mutable.
565
 
566
  Both in-place and copying versions are provided for certain
567
  algorithms.[^1] When such a version is provided for *algorithm* it is
568
  called *algorithm`_copy`*. Algorithms that take predicates end with the
569
  suffix `_if` (which follows the suffix `_copy`).
 
87
  <class InputIterator1, class InputIterator2, class BinaryPredicate>
88
  pair<InputIterator1, InputIterator2>
89
  mismatch(InputIterator1 first1, InputIterator1 last1,
90
  InputIterator2 first2, BinaryPredicate pred);
91
 
92
+ template<class InputIterator1, class InputIterator2>
93
+ pair<InputIterator1, InputIterator2>
94
+ mismatch(InputIterator1 first1, InputIterator1 last1,
95
+ InputIterator2 first2, InputIterator2 last2);
96
+
97
+ template
98
+ <class InputIterator1, class InputIterator2, class BinaryPredicate>
99
+ pair<InputIterator1, InputIterator2>
100
+ mismatch(InputIterator1 first1, InputIterator1 last1,
101
+ InputIterator2 first2, InputIterator2 last2,
102
+ BinaryPredicate pred);
103
+
104
  template<class InputIterator1, class InputIterator2>
105
  bool equal(InputIterator1 first1, InputIterator1 last1,
106
  InputIterator2 first2);
107
  template
108
  <class InputIterator1, class InputIterator2, class BinaryPredicate>
109
  bool equal(InputIterator1 first1, InputIterator1 last1,
110
  InputIterator2 first2, BinaryPredicate pred);
111
 
112
+ template<class InputIterator1, class InputIterator2>
113
+ bool equal(InputIterator1 first1, InputIterator1 last1,
114
+ InputIterator2 first2, InputIterator2 last2);
115
+
116
+ template
117
+ <class InputIterator1, class InputIterator2, class BinaryPredicate>
118
+ bool equal(InputIterator1 first1, InputIterator1 last1,
119
+ InputIterator2 first2, InputIterator2 last2,
120
+ BinaryPredicate pred);
121
+
122
  template<class ForwardIterator1, class ForwardIterator2>
123
  bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
124
  ForwardIterator2 first2);
125
  template<class ForwardIterator1, class ForwardIterator2,
126
  class BinaryPredicate>
127
  bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
128
  ForwardIterator2 first2, BinaryPredicate pred);
129
 
130
+ template<class ForwardIterator1, class ForwardIterator2>
131
+ bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
132
+ ForwardIterator2 first2, ForwardIterator2 last2);
133
+
134
+ template<class ForwardIterator1, class ForwardIterator2,
135
+ class BinaryPredicate>
136
+ bool is_permutation(ForwardIterator1 first1, ForwardIterator1 last1,
137
+ ForwardIterator2 first2, ForwardIterator2 last2,
138
+ BinaryPredicate pred);
139
+
140
  template<class ForwardIterator1, class ForwardIterator2>
141
  ForwardIterator1 search(
142
  ForwardIterator1 first1, ForwardIterator1 last1,
143
  ForwardIterator2 first2, ForwardIterator2 last2);
144
  template<class ForwardIterator1, class ForwardIterator2,
 
150
  template<class ForwardIterator, class Size, class T>
151
  ForwardIterator search_n(ForwardIterator first, ForwardIterator last,
152
  Size count, const T& value);
153
  template
154
  <class ForwardIterator, class Size, class T, class BinaryPredicate>
155
+ ForwardIterator search_n(ForwardIterator first, ForwardIterator last,
156
  Size count, const T& value,
157
  BinaryPredicate pred);
158
 
159
  // [alg.modifying.operations], modifying sequence operations:
160
  // [alg.copy], copy:
 
261
  template<class ForwardIterator, class OutputIterator>
262
  OutputIterator rotate_copy(
263
  ForwardIterator first, ForwardIterator middle,
264
  ForwardIterator last, OutputIterator result);
265
 
266
+ // [depr.alg.random.shuffle], random_shuffle (deprecated):
267
  template<class RandomAccessIterator>
268
  void random_shuffle(RandomAccessIterator first,
269
  RandomAccessIterator last);
270
  template<class RandomAccessIterator, class RandomNumberGenerator>
271
  void random_shuffle(RandomAccessIterator first,
272
  RandomAccessIterator last,
273
+ RandomNumberGenerator&& rng);
274
+
275
+ // [alg.random.shuffle], shuffle:
276
  template<class RandomAccessIterator, class UniformRandomNumberGenerator>
277
  void shuffle(RandomAccessIterator first,
278
  RandomAccessIterator last,
279
+ UniformRandomNumberGenerator&& g);
280
 
281
  // [alg.partitions], partitions:
282
  template <class InputIterator, class Predicate>
283
  bool is_partitioned(InputIterator first, InputIterator last, Predicate pred);
284
 
 
492
  template<class RandomAccessIterator, class Compare>
493
  RandomAccessIterator is_heap_until(RandomAccessIterator first, RandomAccessIterator last,
494
  Compare comp);
495
 
496
  // [alg.min.max], minimum and maximum:
497
+ template<class T> constexpr const T& min(const T& a, const T& b);
498
  template<class T, class Compare>
499
+ constexpr const T& min(const T& a, const T& b, Compare comp);
500
  template<class T>
501
+ constexpr T min(initializer_list<T> t);
502
  template<class T, class Compare>
503
+ constexpr T min(initializer_list<T> t, Compare comp);
504
 
505
+ template<class T> constexpr const T& max(const T& a, const T& b);
506
  template<class T, class Compare>
507
+ constexpr const T& max(const T& a, const T& b, Compare comp);
508
  template<class T>
509
+ constexpr T max(initializer_list<T> t);
510
  template<class T, class Compare>
511
+ constexpr T max(initializer_list<T> t, Compare comp);
512
 
513
+ template<class T> constexpr pair<const T&, const T&> minmax(const T& a, const T& b);
514
  template<class T, class Compare>
515
+ constexpr pair<const T&, const T&> minmax(const T& a, const T& b, Compare comp);
516
  template<class T>
517
+ constexpr pair<T, T> minmax(initializer_list<T> t);
518
  template<class T, class Compare>
519
+ constexpr pair<T, T> minmax(initializer_list<T> t, Compare comp);
520
 
521
  template<class ForwardIterator>
522
  ForwardIterator min_element(ForwardIterator first, ForwardIterator last);
523
  template<class ForwardIterator, class Compare>
524
  ForwardIterator min_element(ForwardIterator first, ForwardIterator last,
 
570
  For purposes of determining the existence of data races, algorithms
571
  shall not modify objects referenced through an iterator argument unless
572
  the specification requires such modification.
573
 
574
  Throughout this Clause, the names of template parameters are used to
575
+ express type requirements.
576
+
577
+ - If an algorithm’s template parameter is named `InputIterator`,
578
+ `InputIterator1`, or `InputIterator2`, the template argument shall
579
+ satisfy the requirements of an input iterator ([[input.iterators]]).
580
+ - If an algorithm’s template parameter is named `OutputIterator`,
581
+ `OutputIterator1`, or `OutputIterator2`, the template argument shall
582
+ satisfy the requirements of an output iterator (
583
+ [[output.iterators]]).
584
+ - If an algorithm’s template parameter is named `ForwardIterator`,
585
+ `ForwardIterator1`, or `ForwardIterator2`, the template argument shall
586
+ satisfy the requirements of a forward iterator (
587
+ [[forward.iterators]]).
588
+ - If an algorithm’s template parameter is named `BidirectionalIterator`,
589
+ `BidirectionalIterator1`, or `BidirectionalIterator2`, the template
590
+ argument shall satisfy the requirements of a bidirectional iterator (
591
+ [[bidirectional.iterators]]).
592
+ - If an algorithm’s template parameter is named `RandomAccessIterator`,
593
+ `RandomAccessIterator1`, or `RandomAccessIterator2`, the template
594
  argument shall satisfy the requirements of a random-access iterator (
595
  [[random.access.iterators]]).
596
 
597
  If an algorithm’s section says that a value pointed to by any iterator
598
  passed as an argument is modified, then that algorithm has an additional
599
  type requirement: The type of that argument shall satisfy the
600
  requirements of a mutable iterator ([[iterator.requirements]]). This
601
+ requirement does not affect arguments that are named `OutputIterator`,
602
+ `OutputIterator1`, or `OutputIterator2`, because output iterators must
603
+ always be mutable.
604
 
605
  Both in-place and copying versions are provided for certain
606
  algorithms.[^1] When such a version is provided for *algorithm* it is
607
  called *algorithm`_copy`*. Algorithms that take predicates end with the
608
  suffix `_if` (which follows the suffix `_copy`).