Fix for mismatch to handle evil iterators which overload operator comma

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217903 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow 2014-09-16 20:40:05 +00:00
parent 270f8e01e8
commit d402a4da6b

View File

@ -1140,7 +1140,7 @@ pair<_InputIterator1, _InputIterator2>
mismatch(_InputIterator1 __first1, _InputIterator1 __last1, mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _BinaryPredicate __pred) _InputIterator2 __first2, _BinaryPredicate __pred)
{ {
for (; __first1 != __last1; ++__first1, ++__first2) for (; __first1 != __last1; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2)) if (!__pred(*__first1, *__first2))
break; break;
return pair<_InputIterator1, _InputIterator2>(__first1, __first2); return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
@ -1164,7 +1164,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _InputIterator2 __last2, _InputIterator2 __first2, _InputIterator2 __last2,
_BinaryPredicate __pred) _BinaryPredicate __pred)
{ {
for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2) for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2)
if (!__pred(*__first1, *__first2)) if (!__pred(*__first1, *__first2))
break; break;
return pair<_InputIterator1, _InputIterator2>(__first1, __first2); return pair<_InputIterator1, _InputIterator2>(__first1, __first2);