From d402a4da6bfdf4484afb6957661f1dbddbda2e5f Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 16 Sep 2014 20:40:05 +0000 Subject: [PATCH] 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 --- include/algorithm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/algorithm b/include/algorithm index 3ba104bf..dbe888f7 100644 --- a/include/algorithm +++ b/include/algorithm @@ -1140,7 +1140,7 @@ pair<_InputIterator1, _InputIterator2> mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred) { - for (; __first1 != __last1; ++__first1, ++__first2) + for (; __first1 != __last1; ++__first1, (void) ++__first2) if (!__pred(*__first1, *__first2)) break; return pair<_InputIterator1, _InputIterator2>(__first1, __first2); @@ -1164,7 +1164,7 @@ mismatch(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _BinaryPredicate __pred) { - for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2) + for (; __first1 != __last1 && __first2 != __last2; ++__first1, (void) ++__first2) if (!__pred(*__first1, *__first2)) break; return pair<_InputIterator1, _InputIterator2>(__first1, __first2);