From aced8dc9a1b82d224460750c1c4c0bbd8e8e7127 Mon Sep 17 00:00:00 2001 From: Christopher Di Bella Date: Thu, 9 Mar 2017 10:35:01 +1100 Subject: [PATCH] Relocate deprecated algorithm overloads completely to Annex A * Drive-by: Fixed typo in minmax Fixes #359. --- algorithms.tex | 171 +------------------------------------------------ deprecated.tex | 10 ++- 2 files changed, 6 insertions(+), 175 deletions(-) diff --git a/algorithms.tex b/algorithms.tex index 40af1d2e..28adb404 100644 --- a/algorithms.tex +++ b/algorithms.tex @@ -166,23 +166,6 @@ difference_type_t> count_if(Rng&& rng, Pred pred, Proj proj = Proj{}); - // \ref{depr.algo.range-and-a-half} (deprecated): - template S1, InputIterator I2, - class Proj1 = identity, class Proj2 = identity, - IndirectPredicate, projected> Pred = equal_to<>> - tagged_pair - mismatch(I1 first1, S1 last1, I2 first2, Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - - // \ref{depr.algo.range-and-a-half} (deprecated): - template , Proj1>, - projected> Pred = equal_to<>> - tagged_pair), tag::in2(I2)> - mismatch(Rng1&& rng1, I2 first2, Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - template S1, InputIterator I2, Sentinel S2, class Proj1 = identity, class Proj2 = identity, IndirectPredicate, projected> Pred = equal_to<>> @@ -199,21 +182,6 @@ mismatch(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - // \ref{depr.algo.range-and-a-half} (deprecated): - template S1, InputIterator I2, - class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable() - bool equal(I1 first1, S1 last1, - I2 first2, Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - - // \ref{depr.algo.range-and-a-half} (deprecated): - template , - class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable, I2, Pred, Proj1, Proj2>() - bool equal(Rng1&& rng1, I2 first2, Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - template S1, InputIterator I2, Sentinel S2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires IndirectlyComparable() @@ -227,20 +195,6 @@ bool equal(Rng1&& rng1, Rng2&& rng2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - // \ref{depr.algo.range-and-a-half} (deprecated): - template S1, ForwardIterator I2, - class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable() - bool is_permutation(I1 first1, S1 last1, I2 first2, - Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - - // \ref{depr.algo.range-and-a-half} (deprecated): - template , - class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable, I2, Pred, Proj1, Proj2>() - bool is_permutation(Rng1&& rng1, I2 first2, Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); template S1, ForwardIterator I2, Sentinel S2, class Pred = equal_to<>, class Proj1 = identity, @@ -347,18 +301,6 @@ tagged_pair), tag::out(I)> move_backward(Rng&& rng, I result); - // \ref{alg.swap}, swap, \ref{depr.algo.range-and-a-half} (deprecated): - template S1, ForwardIterator I2> - requires IndirectlySwappable() - tagged_pair - swap_ranges(I1 first1, S1 last1, I2 first2); - - // \ref{depr.algo.range-and-a-half} (deprecated): - template - requires IndirectlySwappable, I>() - tagged_pair), tag::in2(I)> - swap_ranges(Rng&& rng1, I first2); - template S1, ForwardIterator I2, Sentinel S2> requires IndirectlySwappable() tagged_pair @@ -380,24 +322,6 @@ tagged_pair), tag::out(O)> transform(Rng&& rng, O result, F op, Proj proj = Proj{}); - // \ref{depr.algo.range-and-a-half} (deprecated): - template S1, InputIterator I2, WeaklyIncrementable O, - class F, class Proj1 = identity, class Proj2 = identity> - requires Writable, - projected)>>() - tagged_tuple - transform(I1 first1, S1 last1, I2 first2, O result, - F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - - // \ref{depr.algo.range-and-a-half} (deprecated): - template - requires Writable, Proj1>, projected>)>() - tagged_tuple), tag::in2(I), tag::out(O)> - transform(Rng&& rng1, I first2, O result, - F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - template S1, InputIterator I2, Sentinel S2, WeaklyIncrementable O, class F, class Proj1 = identity, class Proj2 = identity> requires Writable, @@ -1005,7 +929,7 @@ minmax(initializer_list t, Comp comp = Comp{}, Proj proj = Proj{}); template , Proj> Comp = less<>> + IndirectStrictWeakOrder, Proj>> Comp = less<>> requires Copyable>>() tagged_pair>), tag::max(value_type_t>)> @@ -1577,23 +1501,6 @@ \indexlibrary{\idxcode{mismatch}}% \begin{itemdecl} -// \ref{depr.algo.range-and-a-half} (deprecated): -template S1, InputIterator I2, - class Proj1 = identity, class Proj2 = identity, - IndirectPredicate, projected> Pred = equal_to<>> - tagged_pair - mismatch(I1 first1, S1 last1, I2 first2, Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - -// \ref{depr.algo.range-and-a-half} (deprecated): -template , Proj1>, - projected> Pred = equal_to<>> - tagged_pair), tag::in2(I2)> - mismatch(Rng1&& rng1, I2 first2, Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - template S1, InputIterator I2, Sentinel S2, class Proj1 = identity, class Proj2 = identity, IndirectPredicate, projected> Pred = equal_to<>> @@ -1611,10 +1518,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\remarks If \tcode{last2} was not given in the argument list, it denotes -\tcode{first2 + (last1 - first1)} below. - \pnum \returns A pair of iterators @@ -1654,21 +1557,6 @@ \indexlibrary{\idxcode{equal}}% \begin{itemdecl} -// \ref{depr.algo.range-and-a-half} (deprecated): -template S1, InputIterator I2, - class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable() - bool equal(I1 first1, S1 last1, - I2 first2, Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - -// \ref{depr.algo.range-and-a-half} (deprecated): -template , - class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable, I2, Pred, Proj1, Proj2>() - bool equal(Rng1&& rng1, I2 first2, Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - template S1, InputIterator I2, Sentinel S2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires IndirectlyComparable() @@ -1684,10 +1572,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\remarks If \tcode{last2} was not given in the argument list, it denotes -\tcode{first2 + (last1 - first1)} below. - \pnum \returns If @@ -1720,21 +1604,6 @@ \indexlibrary{\idxcode{is_permutation}}% \begin{itemdecl} -// \ref{depr.algo.range-and-a-half} (deprecated): -template S1, ForwardIterator I2, - class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable() - bool is_permutation(I1 first1, S1 last1, I2 first2, - Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - -// \ref{depr.algo.range-and-a-half} (deprecated): -template , - class Proj1 = identity, class Proj2 = identity> - requires IndirectlyComparable, I2, Pred, Proj1, Proj2>() - bool is_permutation(Rng1&& rng1, I2 first2, Pred pred = Pred{}, - Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - template S1, ForwardIterator I2, Sentinel S2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> @@ -1751,10 +1620,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\remarks If \tcode{last2} was not given in the argument list, it denotes -\tcode{first2 + (last1 - first1)} below. - \pnum \returns If \tcode{last1 - first1 != last2 - first2}, return \tcode{false}. Otherwise return \tcode{true} if there exists a permutation of the elements in the @@ -2100,18 +1965,6 @@ \indexlibrary{\idxcode{swap_ranges}}% \begin{itemdecl} -// \ref{depr.algo.range-and-a-half} (deprecated): -template S1, ForwardIterator I2> - requires IndirectlySwappable() - tagged_pair - swap_ranges(I1 first1, S1 last1, I2 first2); - -// \ref{depr.algo.range-and-a-half} (deprecated): -template - requires IndirectlySwappable, I>() - tagged_pair), tag::in2(I)> - swap_ranges(Rng&& rng1, I first2); - template S1, ForwardIterator I2, Sentinel S2> requires IndirectlySwappable() tagged_pair @@ -2126,7 +1979,6 @@ \begin{itemdescr} \pnum \effects -For the first two overloads, let \tcode{last2} be \tcode{first2 + (last1 - first1)}. For each non-negative integer \tcode{n < min(last1 - first1, last2 - first2)} performs: \tcode{swap(*(first1 + n), \brk{}*(first2 + n))}. @@ -2167,24 +2019,6 @@ tagged_pair), tag::out(O)> transform(Rng&& rng, O result, F op, Proj proj = Proj{}); -// \ref{depr.algo.range-and-a-half} (deprecated): -template S1, InputIterator I2, WeaklyIncrementable O, - class F, class Proj1 = identity, class Proj2 = identity> - requires Writable, - projected)>>() - tagged_tuple - transform(I1 first1, S1 last1, I2 first2, O result, - F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - -// \ref{depr.algo.range-and-a-half} (deprecated): -template - requires Writable, Proj1>, projected)>>() - tagged_tuple), tag::in2(I), tag::out(O)> - transform(Rng&& rng1, I first2, O result, - F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); - template S1, InputIterator I2, Sentinel S2, WeaklyIncrementable O, class F, class Proj1 = identity, class Proj2 = identity> requires Writable, @@ -2206,8 +2040,7 @@ \begin{itemdescr} \pnum -For binary transforms that do not take \tcode{last2}, let \tcode{last2} -be \tcode{first2 + (last1 - first1)}. Let $N$ be \tcode{(last1 - first1)} +Let $N$ be \tcode{(last1 - first1)} for unary transforms, or \tcode{min(last1 - first1, last2 - first2) for binary transforms.} diff --git a/deprecated.tex b/deprecated.tex index 8280d52e..51212816 100644 --- a/deprecated.tex +++ b/deprecated.tex @@ -29,10 +29,9 @@ \rSec1[depr.algo.range-and-a-half]{Range-and-a-half algorithms} \pnum -The following algorithms are deemed unsafe and are deprecated in this document. +The following algorithm signatures are deemed unsafe and are deprecated in this document. \begin{codeblock} -// \ref{mismatch}, mismatch template S1, InputIterator I2, class Proj1 = identity, class Proj2 = identity, IndirectPredicate, projected> Pred = equal_to<>> @@ -48,7 +47,6 @@ mismatch(Rng1&& rng1, I2 first2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); -// \ref{alg.equal}, equal template S1, InputIterator I2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires IndirectlyComparable() @@ -62,7 +60,6 @@ bool equal(Rng1&& rng1, I2 first2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); -// \ref{alg.is_permutation}, is_permutation template S1, ForwardIterator I2, class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity> requires IndirectlyComparable() @@ -76,7 +73,6 @@ bool is_permutation(Rng1&& rng1, I2 first2, Pred pred = Pred{}, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); -// \ref{alg.swap}, swap_ranges template S1, ForwardIterator I2> requires IndirectlySwappable() tagged_pair @@ -87,7 +83,6 @@ tagged_pair), tag::in2(I)> swap_ranges(Rng&& rng1, I first2); -// \ref{alg.transform}, transform template S1, InputIterator I2, WeaklyIncrementable O, class F, class Proj1 = identity, class Proj2 = identity> requires Writable, projected)>>() @@ -103,3 +98,6 @@ transform(Rng&& rng1, I first2, O result, F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{}); \end{codeblock} + +\remark These signatures behave as described in Clause~\ref{algorithms} with the name +\tcode{last2} defined as \tcode{first2 + (last1 - first1)}. \ No newline at end of file