[libcxx] r251836 - Make reverse() call iter_swap like the standard says, instead of calling swap directly. No real change.
Marshall Clow via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 2 13:34:25 PST 2015
Author: marshall
Date: Mon Nov 2 15:34:25 2015
New Revision: 251836
URL: http://llvm.org/viewvc/llvm-project?rev=251836&view=rev
Log:
Make reverse() call iter_swap like the standard says, instead of calling swap directly. No real change.
Modified:
libcxx/trunk/include/algorithm
Modified: libcxx/trunk/include/algorithm
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/algorithm?rev=251836&r1=251835&r2=251836&view=diff
==============================================================================
--- libcxx/trunk/include/algorithm (original)
+++ libcxx/trunk/include/algorithm Mon Nov 2 15:34:25 2015
@@ -2330,7 +2330,7 @@ __reverse(_BidirectionalIterator __first
{
if (__first == --__last)
break;
- swap(*__first, *__last);
+ _VSTD::iter_swap(__first, __last);
++__first;
}
}
@@ -2342,7 +2342,7 @@ __reverse(_RandomAccessIterator __first,
{
if (__first != __last)
for (; __first < --__last; ++__first)
- swap(*__first, *__last);
+ _VSTD::iter_swap(__first, __last);
}
template <class _BidirectionalIterator>
More information about the cfe-commits
mailing list