We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c764963 commit 976727fCopy full SHA for 976727f
source/iterators.tex
@@ -1131,12 +1131,10 @@
1131
\begin{codeblock}
1132
template<class BI>
1133
void reverse(BI first, BI last) {
1134
- typename iterator_traits<BI>::difference_type n =
1135
- distance(first, last);
+ typename iterator_traits<BI>::difference_type n = distance(first, last);
1136
--n;
1137
- while(n > 0) {
1138
- typename iterator_traits<BI>::value_type
1139
- tmp = *first;
+ while (n > 0) {
+ typename iterator_traits<BI>::value_type tmp = *first;
1140
*first++ = *--last;
1141
*last = tmp;
1142
n -= 2;
0 commit comments