Make reverse() call iter_swap like the standard says, instead of calling swap directly. No real change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@251836 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2330,7 +2330,7 @@ __reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirec
|
|||||||
{
|
{
|
||||||
if (__first == --__last)
|
if (__first == --__last)
|
||||||
break;
|
break;
|
||||||
swap(*__first, *__last);
|
_VSTD::iter_swap(__first, __last);
|
||||||
++__first;
|
++__first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2342,7 +2342,7 @@ __reverse(_RandomAccessIterator __first, _RandomAccessIterator __last, random_ac
|
|||||||
{
|
{
|
||||||
if (__first != __last)
|
if (__first != __last)
|
||||||
for (; __first < --__last; ++__first)
|
for (; __first < --__last; ++__first)
|
||||||
swap(*__first, *__last);
|
_VSTD::iter_swap(__first, __last);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class _BidirectionalIterator>
|
template <class _BidirectionalIterator>
|
||||||
|
|||||||
Reference in New Issue
Block a user