2007-04-13 Paolo Carlini <pcarlini@suse.de>
+ PR libstdc++/31556
+ * include/bits/stl_algobase.h (equal(_InputIterator1, _InputIterator1,
+ _InputIterator2, _BinaryPredicate), mismatch(_InputIterator1,
+ _InputIterator1, _InputIterator2, _BinaryPredicate)): Convert
+ predicate return to bool.
+ * include/bits/stl_algo.h (__find_if(_InputIterator, _InputIterator,
+ _Predicate, input_iterator_tag), search(_ForwardIterator1,
+ _ForwardIterator1, _ForwardIterator2, _ForwardIterator2,
+ _BinaryPredicate), __search_n(_ForwardIterator, _ForwardIterator,
+ _Integer, const _Tp&, _BinaryPredicate, std::forward_iterator_tag),
+ __search_n(_RandomAccessIter, _RandomAccessIter, _Integer, const _Tp&,
+ _BinaryPredicate, std::random_access_iterator_tag),
+ search_n(_ForwardIterator, _ForwardIterator, _Integer, const _Tp&,
+ _BinaryPredicate), remove_copy_if(_InputIterator, _InputIterator,
+ _OutputIterator, _Predicate), __unique_copy(_ForwardIterator,
+ _ForwardIterator, _OutputIterator, _BinaryPredicate,
+ forward_iterator_tag, output_iterator_tag),
+ __unique_copy(_InputIterator, _InputIterator, _OutputIterator,
+ _BinaryPredicate, input_iterator_tag, output_iterator_tag),
+ __unique_copy(_InputIterator, _InputIterator, _OutputIterator,
+ _BinaryPredicate, input_iterator_tag, output_iterator_tag),
+ __unique_copy(_InputIterator, _InputIterator, _ForwardIterator,
+ _BinaryPredicate, input_iterator_tag, forward_iterator_tag),
+ unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate),
+ __partition(_BidirectionalIterator, _BidirectionalIterator, _Predicate,
+ bidirectional_iterator_tag), binary_search(_ForwardIterator,
+ _ForwardIterator, const _Tp&, _Compare),
+ next_permutation(_BidirectionalIterator, _BidirectionalIterator,
+ _Compare), prev_permutation(_BidirectionalIterator,
+ _BidirectionalIterator, _Compare)): Likewise.
+
+2007-04-13 Paolo Carlini <pcarlini@suse.de>
+
PR libstdc++/31554
* include/bits/stl_algo.h (stable_partition): Convert __buf.size()
to _DistanceType.
__find_if(_InputIterator __first, _InputIterator __last,
_Predicate __pred, input_iterator_tag)
{
- while (__first != __last && !__pred(*__first))
+ while (__first != __last && !bool(__pred(*__first)))
++__first;
return __first;
}
++__tmp;
if (__tmp == __last2)
{
- while (__first1 != __last1 && !__predicate(*__first1, *__first2))
+ while (__first1 != __last1
+ && !bool(__predicate(*__first1, *__first2)))
++__first1;
return __first1;
}
break;
++__first1;
}
- while (__first1 != __last1 && !__predicate(*__first1, *__first2))
+ while (__first1 != __last1 &&
+ !bool(__predicate(*__first1, *__first2)))
++__first1;
if (__first1 == __last1)
return __last1;
_Integer __count, const _Tp& __val,
_BinaryPredicate __binary_pred, std::forward_iterator_tag)
{
- while (__first != __last && !__binary_pred(*__first, __val))
+ while (__first != __last && !bool(__binary_pred(*__first, __val)))
++__first;
while (__first != __last)
__n = __count;
_ForwardIterator __i = __first;
++__i;
- while (__i != __last && __n != 1 && __binary_pred(*__i, __val))
+ while (__i != __last && __n != 1 && bool(__binary_pred(*__i, __val)))
{
++__i;
--__n;
if (__i == __last)
return __last;
__first = ++__i;
- while (__first != __last && !__binary_pred(*__first, __val))
+ while (__first != __last
+ && !bool(__binary_pred(*__first, __val)))
++__first;
}
return __last;
{
// __lookAhead here is always pointing to the last element of next
// possible match.
- while (!__binary_pred(*__lookAhead, __val)) // the skip loop...
+ while (!bool(__binary_pred(*__lookAhead, __val))) // the skip loop...
{
if (__tailSize < __pattSize)
return __last; // Failure
return __first;
if (__count == 1)
{
- while (__first != __last && !__binary_pred(*__first, __val))
+ while (__first != __last && !bool(__binary_pred(*__first, __val)))
++__first;
return __first;
}
__glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first)
- if (!__pred(*__first))
+ if (!bool(__pred(*__first)))
{
*__result = *__first;
++__result;
_ForwardIterator __next = __first;
*__result = *__first;
while (++__next != __last)
- if (!__binary_pred(*__first, *__next))
+ if (!bool(__binary_pred(*__first, *__next)))
{
__first = __next;
*++__result = *__first;
typename iterator_traits<_InputIterator>::value_type __value = *__first;
*__result = __value;
while (++__first != __last)
- if (!__binary_pred(__value, *__first))
+ if (!bool(__binary_pred(__value, *__first)))
{
__value = *__first;
*++__result = __value;
*__result = *__first;
while (++__first != __last)
- if (!__binary_pred(*__result, *__first))
+ if (!bool(__binary_pred(*__result, *__first)))
*++__result = *__first;
return ++__result;
}
_ForwardIterator __dest = __first;
++__first;
while (++__first != __last)
- if (!__binary_pred(*__dest, *__first))
+ if (!bool(__binary_pred(*__dest, *__first)))
*++__dest = *__first;
return ++__dest;
}
while (true)
if (__first == __last)
return __first;
- else if (!__pred(*__last))
+ else if (!bool(__pred(*__last)))
--__last;
else
break;
__glibcxx_requires_partitioned_pred(__first, __last, __val, __comp);
_ForwardIterator __i = std::lower_bound(__first, __last, __val, __comp);
- return __i != __last && !__comp(__val, *__i);
+ return __i != __last && !bool(__comp(__val, *__i));
}
// Set algorithms: includes, set_union, set_intersection, set_difference,
if (__first == __last) return __first;
_ForwardIterator __result = __first;
while (++__first != __last)
- if (__comp(*__result, *__first)) __result = __first;
+ if (__comp(*__result, *__first))
+ __result = __first;
return __result;
}
if (__comp(*__i, *__ii))
{
_BidirectionalIterator __j = __last;
- while (!__comp(*__i, *--__j))
+ while (!bool(__comp(*__i, *--__j)))
{}
std::iter_swap(__i, __j);
std::reverse(__ii, __last);
if (__comp(*__ii, *__i))
{
_BidirectionalIterator __j = __last;
- while (!__comp(*--__j, *__i))
+ while (!bool(__comp(*--__j, *__i)))
{}
std::iter_swap(__i, __j);
std::reverse(__ii, __last);