Skip to content

Commit 39e8f2a

Browse files
authored
[alg.is.permutation] Rephrase to simplify (#4071)
Defines "last2" and "pred" for the overloads with no such parameters so the remainder of the specification need not exhaustively describe each case.
1 parent e352fda commit 39e8f2a

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

source/algorithms.tex

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3965,6 +3965,11 @@
39653965
\end{itemdecl}
39663966

39673967
\begin{itemdescr}
3968+
\pnum
3969+
Let \tcode{last2} be \tcode{first2 + (last1 - first1)}
3970+
for the overloads with no parameter named \tcode{last2},
3971+
and let \tcode{pred} be \tcode{equal_to\{\}}
3972+
for the overloads with no parameter \tcode{pred}.
39683973

39693974
\pnum
39703975
\mandates
@@ -3974,20 +3979,14 @@
39743979
\expects
39753980
The comparison function is an equivalence relation.
39763981

3977-
\pnum
3978-
\remarks
3979-
If \tcode{last2} was not given in the argument list,
3980-
it denotes \tcode{first2 + (last1 - first1)} below.
3981-
39823982
\pnum
39833983
\returns
39843984
If \tcode{last1 - first1 != last2 - first2}, return \tcode{false}.
39853985
Otherwise return \tcode{true}
39863986
if there exists a permutation of the elements
3987-
in the range \range{first2}{first2 + (last1 - first1)},
3987+
in the range \range{first2}{last2},
39883988
beginning with \tcode{ForwardIterator2 begin},
3989-
such that \tcode{equal(first1, last1, begin)} returns \tcode{true} or
3990-
\tcode{equal(first1, last1, begin, pred)} returns \tcode{true};
3989+
such that \tcode{equal(first1, last1, begin, pred)} returns \tcode{true};
39913990
otherwise, returns \tcode{false}.
39923991

39933992
\pnum
@@ -3998,10 +3997,7 @@
39983997
\tcode{last1 - first1 != last2 - first2}.
39993998
Otherwise, exactly \tcode{last1 - first1} applications
40003999
of the corresponding predicate
4001-
if \tcode{equal(\brk{}first1, last1, first2, last2)} would return \tcode{true}
4002-
if \tcode{pred} was not given in the argument list or
4003-
\tcode{equal(first1, last1, first2, last2, pred)} would return \tcode{true}
4004-
if \tcode{pred} was given in the argument list;
4000+
if \tcode{equal(first1, last1, first2, last2, pred)} would return \tcode{true};
40054001
otherwise, at worst \bigoh{N^2}, where $N$ has the value \tcode{last1 - first1}.
40064002
\end{itemdescr}
40074003

0 commit comments

Comments
 (0)