+2003-09-29 Paolo Carlini <pcarlini@unitus.it>
+
+ * include/bits/stl_algo.h (search_n): Improve the previous
+ fix as suggested by Martin.
+
2003-09-29 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/12296
else {
__first = std::find(__first, __last, __val);
while (__first != __last) {
- typename iterator_traits<_ForwardIterator>::difference_type __n = __count - 1;
+ typename iterator_traits<_ForwardIterator>::difference_type __n = __count;
+ --__n;
_ForwardIterator __i = __first;
++__i;
while (__i != __last && __n != 0 && *__i == __val) {
++__first;
}
while (__first != __last) {
- typename iterator_traits<_ForwardIterator>::difference_type __n = __count - 1;
+ typename iterator_traits<_ForwardIterator>::difference_type __n = __count;
+ --__n;
_ForwardIterator __i = __first;
++__i;
while (__i != __last && __n != 0 && __binary_pred(*__i, __val)) {