stl_algobase.h (std::equal): avoid use of possibly-undefined operator != (one line...
authorBenjamin Kosnik <bkoz@gcc.gnu.org>
Fri, 6 Apr 2001 22:21:29 +0000 (22:21 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Fri, 6 Apr 2001 22:21:29 +0000 (22:21 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_algobase.h

index 2120684021f1149241bc853ca45ac2dbc597a90d..7cb306696802e1b582d1994a890ed5400f7f805a 100644 (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.
index df768c615ffae93d85a50fea7ad8aad95ea7ee5b..29bc953d6104a5be1a23426b707ace70f09c39d6 100644 (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;
 }