stl_algobase.h (std::equal): avoid use of possibly-undefined operator != (one line patch).

2001-04-06  Joe Buck  <jbuck@welsh-buck.org>

        * stl_algobase.h (std::equal): avoid use of possibly-undefined
        operator != (one line patch).

From-SVN: r41170
This commit is contained in:
Benjamin Kosnik 2001-04-06 22:21:29 +00:00
parent a1fae79477
commit 14bc1c0e15
2 changed files with 10 additions and 1 deletions

View File

@ -1,3 +1,12 @@
2001-04-06 Gabriel Dos Reis <gdr@codesourcery.com>
* testsuite/25_algorithms/equal.cc: New test.
2001-04-06 Joe Buck <jbuck@welsh-buck.org>
* stl_algobase.h (std::equal): avoid use of possibly-undefined
operator != (one line patch).
2001-04-06 Benjamin Kosnik <bkoz@redhat.com>
* include/backward/backward_warning.h: Re-enable.

View File

@ -540,7 +540,7 @@ inline bool equal(_InputIter1 __first1, _InputIter1 __last1,
typename iterator_traits<_InputIter2>::value_type>);
for ( ; __first1 != __last1; ++__first1, ++__first2)
if (*__first1 != *__first2)
if (!(*__first1 == *__first2))
return false;
return true;
}