re PR libstdc++/27162 (search_n uses == when it should use binary_pred)
authorDouglas Gregor <dgregor@cs.indiana.edu>
Fri, 14 Apr 2006 17:35:06 +0000 (17:35 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 14 Apr 2006 17:35:06 +0000 (17:35 +0000)
2006-04-14  Douglas Gregor  <dgregor@cs.indiana.edu>

PR libstdc++/27162
* include/bits/stl_algo.h (__search_n(,,,, _BinaryPredicate,
std::forward_iterator_tag)): Use __binary_pred, not ==.

From-SVN: r112957

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

index 2fcdcfaae4e694714e118060632b118e7420b270..93172b64246c1ec8939185b4ddd40777d9cb5c30 100644 (file)
@@ -1,3 +1,9 @@
+2006-04-14  Douglas Gregor  <dgregor@cs.indiana.edu>
+
+       PR libstdc++/27162
+       * include/bits/stl_algo.h (__search_n(,,,, _BinaryPredicate,
+       std::forward_iterator_tag)): Use __binary_pred, not ==.
+
 2006-04-10  Matthias Klose  <doko@debian.org>
 
        * testsuite/lib/libstdc++.exp (libstdc++_init): Recognize multilib
index 7c54f50b4f76d532e36c645f715492da5f2f4879..8da0613d87de959a37e8491bfe837fe0a6a2a949 100644 (file)
@@ -759,7 +759,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
            __n = __count;
          _ForwardIterator __i = __first;
          ++__i;
-         while (__i != __last && __n != 1 && *__i == __val)
+         while (__i != __last && __n != 1 && __binary_pred(*__i, __val))
            {
              ++__i;
              --__n;