Skip to content

Commit

Permalink
Relocate deprecated algorithm overloads completely to Annex A
Browse files Browse the repository at this point in the history
* Drive-by: Fixed typo in minmax

Fixes #359.
  • Loading branch information
cjdb authored and CaseyCarter committed Mar 8, 2017
1 parent 040b899 commit aced8dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 175 deletions.
171 changes: 2 additions & 169 deletions algorithms.tex
Expand Up @@ -166,23 +166,6 @@
difference_type_t<iterator_t<Rng>>
count_if(Rng&& rng, Pred pred, Proj proj = Proj{});

// \ref{depr.algo.range-and-a-half} (deprecated):
template <InputIterator I1, Sentinel<I1> S1, InputIterator I2,
class Proj1 = identity, class Proj2 = identity,
IndirectPredicate<projected<I1, Proj1>, projected<I2, Proj2>> Pred = equal_to<>>
tagged_pair<tag::in1(I1), tag::in2(I2)>
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 <InputRange Rng1, InputIterator I2,
class Proj1 = identity, class Proj2 = identity,
IndirectPredicate<projected<iterator_t<Rng1>, Proj1>,
projected<I2, Proj2>> Pred = equal_to<>>
tagged_pair<tag::in1(safe_iterator_t<Rng1>), tag::in2(I2)>
mismatch(Rng1&& rng1, I2 first2, Pred pred = Pred{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <InputIterator I1, Sentinel<I1> S1, InputIterator I2, Sentinel<I2> S2,
class Proj1 = identity, class Proj2 = identity,
IndirectPredicate<projected<I1, Proj1>, projected<I2, Proj2>> Pred = equal_to<>>
Expand All @@ -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 <InputIterator I1, Sentinel<I1> S1, InputIterator I2,
class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<I1, I2, Pred, Proj1, Proj2>()
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 <InputRange Rng1, InputIterator I2, class Pred = equal_to<>,
class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<iterator_t<Rng1>, I2, Pred, Proj1, Proj2>()
bool equal(Rng1&& rng1, I2 first2, Pred pred = Pred{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <InputIterator I1, Sentinel<I1> S1, InputIterator I2, Sentinel<I2> S2,
class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<I1, I2, Pred, Proj1, Proj2>()
Expand All @@ -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 <ForwardIterator I1, Sentinel<I1> S1, ForwardIterator I2,
class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<I1, I2, Pred, Proj1, Proj2>()
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 <ForwardRange Rng1, ForwardIterator I2, class Pred = equal_to<>,
class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<iterator_t<Rng1>, I2, Pred, Proj1, Proj2>()
bool is_permutation(Rng1&& rng1, I2 first2, Pred pred = Pred{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <ForwardIterator I1, Sentinel<I1> S1, ForwardIterator I2,
Sentinel<I2> S2, class Pred = equal_to<>, class Proj1 = identity,
Expand Down Expand Up @@ -347,18 +301,6 @@
tagged_pair<tag::in(safe_iterator_t<Rng>), tag::out(I)>
move_backward(Rng&& rng, I result);

// \ref{alg.swap}, swap, \ref{depr.algo.range-and-a-half} (deprecated):
template <ForwardIterator I1, Sentinel<I1> S1, ForwardIterator I2>
requires IndirectlySwappable<I1, I2>()
tagged_pair<tag::in1(I1), tag::in2(I2)>
swap_ranges(I1 first1, S1 last1, I2 first2);

// \ref{depr.algo.range-and-a-half} (deprecated):
template <ForwardRange Rng, ForwardIterator I>
requires IndirectlySwappable<iterator_t<Rng>, I>()
tagged_pair<tag::in1(safe_iterator_t<Rng>), tag::in2(I)>
swap_ranges(Rng&& rng1, I first2);

template <ForwardIterator I1, Sentinel<I1> S1, ForwardIterator I2, Sentinel<I2> S2>
requires IndirectlySwappable<I1, I2>()
tagged_pair<tag::in1(I1), tag::in2(I2)>
Expand All @@ -380,24 +322,6 @@
tagged_pair<tag::in(safe_iterator_t<Rng>), tag::out(O)>
transform(Rng&& rng, O result, F op, Proj proj = Proj{});

// \ref{depr.algo.range-and-a-half} (deprecated):
template <InputIterator I1, Sentinel<I1> S1, InputIterator I2, WeaklyIncrementable O,
class F, class Proj1 = identity, class Proj2 = identity>
requires Writable<O, indirect_result_of_t<F&(projected<I1, Proj1>,
projected<I2, Proj2>)>>()
tagged_tuple<tag::in1(I1), tag::in2(I2), tag::out(O)>
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 <InputRange Rng, InputIterator I, WeaklyIncrementable O, class F,
class Proj1 = identity, class Proj2 = identity>
requires Writable<O, indirect_result_of_t<F&(
projected<iterator_t<Rng>, Proj1>, projected<I, Proj2>>)>()
tagged_tuple<tag::in1(safe_iterator_t<Rng>), tag::in2(I), tag::out(O)>
transform(Rng&& rng1, I first2, O result,
F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <InputIterator I1, Sentinel<I1> S1, InputIterator I2, Sentinel<I2> S2,
WeaklyIncrementable O, class F, class Proj1 = identity, class Proj2 = identity>
requires Writable<O, indirect_result_of_t<F&(projected<I1, Proj1>,
Expand Down Expand Up @@ -1005,7 +929,7 @@
minmax(initializer_list<T> t, Comp comp = Comp{}, Proj proj = Proj{});

template <InputRange Rng, class Proj = identity,
IndirectStrictWeakOrder<projected<iterator_t<Rng>, Proj> Comp = less<>>
IndirectStrictWeakOrder<projected<iterator_t<Rng>, Proj>> Comp = less<>>
requires Copyable<value_type_t<iterator_t<Rng>>>()
tagged_pair<tag::min(value_type_t<iterator_t<Rng>>),
tag::max(value_type_t<iterator_t<Rng>>)>
Expand Down Expand Up @@ -1577,23 +1501,6 @@

\indexlibrary{\idxcode{mismatch}}%
\begin{itemdecl}
// \ref{depr.algo.range-and-a-half} (deprecated):
template <InputIterator I1, Sentinel<I1> S1, InputIterator I2,
class Proj1 = identity, class Proj2 = identity,
IndirectPredicate<projected<I1, Proj1>, projected<I2, Proj2>> Pred = equal_to<>>
tagged_pair<tag::in1(I1), tag::in2(I2)>
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 <InputRange Rng1, InputIterator I2,
class Proj1 = identity, class Proj2 = identity,
IndirectPredicate<projected<iterator_t<Rng1>, Proj1>,
projected<I2, Proj2>> Pred = equal_to<>>
tagged_pair<tag::in1(safe_iterator_t<Rng1>), tag::in2(I2)>
mismatch(Rng1&& rng1, I2 first2, Pred pred = Pred{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <InputIterator I1, Sentinel<I1> S1, InputIterator I2, Sentinel<I2> S2,
class Proj1 = identity, class Proj2 = identity,
IndirectPredicate<projected<I1, Proj1>, projected<I2, Proj2>> Pred = equal_to<>>
Expand All @@ -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
Expand Down Expand Up @@ -1654,21 +1557,6 @@

\indexlibrary{\idxcode{equal}}%
\begin{itemdecl}
// \ref{depr.algo.range-and-a-half} (deprecated):
template <InputIterator I1, Sentinel<I1> S1, InputIterator I2,
class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<I1, I2, Pred, Proj1, Proj2>()
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 <InputRange Rng1, InputIterator I2, class Pred = equal_to<>,
class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<iterator_t<Rng1>, I2, Pred, Proj1, Proj2>()
bool equal(Rng1&& rng1, I2 first2, Pred pred = Pred{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <InputIterator I1, Sentinel<I1> S1, InputIterator I2, Sentinel<I2> S2,
class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<I1, I2, Pred, Proj1, Proj2>()
Expand All @@ -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
Expand Down Expand Up @@ -1720,21 +1604,6 @@

\indexlibrary{\idxcode{is_permutation}}%
\begin{itemdecl}
// \ref{depr.algo.range-and-a-half} (deprecated):
template <ForwardIterator I1, Sentinel<I1> S1, ForwardIterator I2,
class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<I1, I2, Pred, Proj1, Proj2>()
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 <ForwardRange Rng1, ForwardIterator I2, class Pred = equal_to<>,
class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<iterator_t<Rng1>, I2, Pred, Proj1, Proj2>()
bool is_permutation(Rng1&& rng1, I2 first2, Pred pred = Pred{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <ForwardIterator I1, Sentinel<I1> S1, ForwardIterator I2,
Sentinel<I2> S2, class Pred = equal_to<>, class Proj1 = identity,
class Proj2 = identity>
Expand All @@ -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
Expand Down Expand Up @@ -2100,18 +1965,6 @@

\indexlibrary{\idxcode{swap_ranges}}%
\begin{itemdecl}
// \ref{depr.algo.range-and-a-half} (deprecated):
template <ForwardIterator I1, Sentinel<I1> S1, ForwardIterator I2>
requires IndirectlySwappable<I1, I2>()
tagged_pair<tag::in1(I1), tag::in2(I2)>
swap_ranges(I1 first1, S1 last1, I2 first2);

// \ref{depr.algo.range-and-a-half} (deprecated):
template <ForwardRange Rng, ForwardIterator I>
requires IndirectlySwappable<iterator_t<Rng>, I>()
tagged_pair<tag::in1(safe_iterator_t<Rng>), tag::in2(I)>
swap_ranges(Rng&& rng1, I first2);

template <ForwardIterator I1, Sentinel<I1> S1, ForwardIterator I2, Sentinel<I2> S2>
requires IndirectlySwappable<I1, I2>()
tagged_pair<tag::in1(I1), tag::in2(I2)>
Expand All @@ -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))}.
Expand Down Expand Up @@ -2167,24 +2019,6 @@
tagged_pair<tag::in(safe_iterator_t<Rng>), tag::out(O)>
transform(Rng&& rng, O result, F op, Proj proj = Proj{});

// \ref{depr.algo.range-and-a-half} (deprecated):
template <InputIterator I1, Sentinel<I1> S1, InputIterator I2, WeaklyIncrementable O,
class F, class Proj1 = identity, class Proj2 = identity>
requires Writable<O, indirect_result_of_t<F&(projected<I1, Proj1>,
projected<I2, Proj2>)>>()
tagged_tuple<tag::in1(I1), tag::in2(I2), tag::out(O)>
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 <InputRange Rng, InputIterator I, WeaklyIncrementable O, class F,
class Proj1 = identity, class Proj2 = identity>
requires Writable<O, indirect_result_of_t<F&(
projected<iterator_t<Rng>, Proj1>, projected<I, Proj2>)>>()
tagged_tuple<tag::in1(safe_iterator_t<Rng>), tag::in2(I), tag::out(O)>
transform(Rng&& rng1, I first2, O result,
F binary_op, Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

template <InputIterator I1, Sentinel<I1> S1, InputIterator I2, Sentinel<I2> S2,
WeaklyIncrementable O, class F, class Proj1 = identity, class Proj2 = identity>
requires Writable<O, indirect_result_of_t<F&(projected<I1, Proj1>,
Expand All @@ -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.}

Expand Down
10 changes: 4 additions & 6 deletions deprecated.tex
Expand Up @@ -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 <InputIterator I1, Sentinel<I1> S1, InputIterator I2,
class Proj1 = identity, class Proj2 = identity,
IndirectPredicate<projected<I1, Proj1>, projected<I2, Proj2>> Pred = equal_to<>>
Expand All @@ -48,7 +47,6 @@
mismatch(Rng1&& rng1, I2 first2, Pred pred = Pred{},
Proj1 proj1 = Proj1{}, Proj2 proj2 = Proj2{});

// \ref{alg.equal}, equal
template <InputIterator I1, Sentinel<I1> S1, InputIterator I2,
class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<I1, I2, Pred, Proj1, Proj2>()
Expand All @@ -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 <ForwardIterator I1, Sentinel<I1> S1, ForwardIterator I2,
class Pred = equal_to<>, class Proj1 = identity, class Proj2 = identity>
requires IndirectlyComparable<I1, I2, Pred, Proj1, Proj2>()
Expand All @@ -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 <ForwardIterator I1, Sentinel<I1> S1, ForwardIterator I2>
requires IndirectlySwappable<I1, I2>()
tagged_pair<tag::in1(I1), tag::in2(I2)>
Expand All @@ -87,7 +83,6 @@
tagged_pair<tag::in1(safe_iterator_t<Rng>), tag::in2(I)>
swap_ranges(Rng&& rng1, I first2);

// \ref{alg.transform}, transform
template <InputIterator I1, Sentinel<I1> S1, InputIterator I2, WeaklyIncrementable O,
class F, class Proj1 = identity, class Proj2 = identity>
requires Writable<O, indirect_result_of_t<F&(projected<I1, Proj1>, projected<I2, Proj2>)>>()
Expand All @@ -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)}.

0 comments on commit aced8dc

Please sign in to comment.