Skip to content

Commit 3c21cfc

Browse files
jensmaurerzygoloid
authored andcommitted
[alg.shift] Avoid undefined iterator arithmetic on ForwardIterator.
Avoid using the undefined concept BidirectionalIterator.
1 parent d517b2a commit 3c21cfc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

source/algorithms.tex

+4-3
Original file line numberDiff line numberDiff line change
@@ -3578,7 +3578,7 @@
35783578

35793579
\pnum
35803580
\returns
3581-
\tcode{first + (last - first) - n}
3581+
\tcode{first + (last - first - n)}
35823582
if \tcode{n} is positive and \tcode{n < last - first},
35833583
otherwise \tcode{first} if \tcode{n} is positive, otherwise \tcode{last}.
35843584

@@ -3605,7 +3605,8 @@
36053605
The type of \tcode{*first} shall satisfy
36063606
the \tcode{MoveAssignable} requirements.
36073607
\tcode{ForwardIterator} shall meet
3608-
the \tcode{BidirectionalIterator} or \tcode{ValueSwappable} requirements.
3608+
the requirements of a bidirectional iterator\iref{bidirectional.iterators} or
3609+
the \tcode{ValueSwappable} requirements.
36093610

36103611
\pnum
36113612
\effects
@@ -3614,7 +3615,7 @@
36143615
from position \tcode{first + i} into \tcode{position first + n + i}
36153616
for each non-negative integer \tcode{i < (last - first) - n}.
36163617
In the first overload case, if \tcode{ForwardIterator} satisfies
3617-
the \tcode{BidirectionalIterator} requirements,
3618+
the requirements of a bidirectional iterator,
36183619
does so in order starting
36193620
from \tcode{i = (last - first) - n - 1} and proceeding to \tcode{i = 0}.
36203621

0 commit comments

Comments
 (0)