Skip to content

Commit 09cc8f8

Browse files
k-satodatkoeppe
authored andcommitted
Uniform notation of distance(first, last) to (last - first)
As allowed in 25.1 [algorithms.general] p12, to express the same things as same.
1 parent 0e66f35 commit 09cc8f8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

source/algorithms.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,11 +1192,11 @@
11921192
\complexity No applications of the corresponding predicate if \tcode{ForwardIterator1}
11931193
and \tcode{ForwardIter\-ator2} meet the requirements of random access iterators and
11941194
\tcode{last1 - first1 != last2 - first2}.
1195-
Otherwise, exactly \tcode{distance(first1, last1)} applications of the
1195+
Otherwise, exactly \tcode{last1 - first1} applications of the
11961196
corresponding predicate if \tcode{equal(\brk{}first1, last1, first2, last2)}
11971197
would return \tcode{true} if \tcode{pred} was not given in the argument list
11981198
or \tcode{equal(first1, last1, first2, last2, pred)} would return \tcode{true} if pred was given in the argument list; otherwise, at
1199-
worst \bigoh{N^2}, where $N$ has the value \tcode{distance(first1, last1)}.
1199+
worst \bigoh{N^2}, where $N$ has the value \tcode{last1 - first1}.
12001200
\end{itemdescr}
12011201

12021202
\rSec2[alg.search]{Search}
@@ -2433,7 +2433,7 @@
24332433
if there exists an integer
24342434
\tcode{n}
24352435
such that for all
2436-
\tcode{0 <= i < distance(start, finish)},
2436+
\tcode{0 <= i < (finish - start)},
24372437
\tcode{f(*(start + i))}
24382438
is true if and only if
24392439
\tcode{i < n}.
@@ -2659,7 +2659,7 @@
26592659

26602660
\begin{itemdescr}
26612661
\pnum
2662-
\returns If \tcode{distance(first, last) < 2}, returns
2662+
\returns If \tcode{(last - first) < 2}, returns
26632663
\tcode{last}. Otherwise, returns
26642664
the last iterator \tcode{i} in \crange{first}{last} for which the
26652665
range \range{first}{i} is sorted.
@@ -3530,7 +3530,7 @@
35303530

35313531
\begin{itemdescr}
35323532
\pnum
3533-
\returns If \tcode{distance(first, last) < 2}, returns
3533+
\returns If \tcode{(last - first) < 2}, returns
35343534
\tcode{last}. Otherwise, returns
35353535
the last iterator \tcode{i} in \crange{first}{last} for which the
35363536
range \range{first}{i} is a heap.
@@ -3794,7 +3794,7 @@
37943794
\complexity
37953795
At most
37963796
$max(\lfloor{\frac{3}{2}} (N-1)\rfloor, 0)$
3797-
applications of the corresponding predicate, where $N$ is \tcode{distance(first, last)}.
3797+
applications of the corresponding predicate, where $N$ is \tcode{last - first}.
37983798
\end{itemdescr}
37993799

38003800
\rSec2[alg.lex.comparison]{Lexicographical comparison}

0 commit comments

Comments
 (0)