aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/libstdc++-v3/include/debug/functions.h
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-06-18 13:00:04 -0700
committerPavel Chupin <pavel.v.chupin@intel.com>2014-06-19 22:38:42 +0400
commitf190d6284359da8ae8694b2d2e14b01602a959ed (patch)
treed4e0548e7cec02d60b1082368032e66a1c509a02 /gcc-4.8/libstdc++-v3/include/debug/functions.h
parent4ff2f42147bc128ce38789071d98e55844cd3a5e (diff)
downloadtoolchain_gcc-f190d6284359da8ae8694b2d2e14b01602a959ed.tar.gz
toolchain_gcc-f190d6284359da8ae8694b2d2e14b01602a959ed.tar.bz2
toolchain_gcc-f190d6284359da8ae8694b2d2e14b01602a959ed.zip
Merge GCC 4.8.3
Change-Id: I0abe59f7705b3eccc6b2f123af75b2e30917696a
Diffstat (limited to 'gcc-4.8/libstdc++-v3/include/debug/functions.h')
-rw-r--r--gcc-4.8/libstdc++-v3/include/debug/functions.h120
1 files changed, 10 insertions, 110 deletions
diff --git a/gcc-4.8/libstdc++-v3/include/debug/functions.h b/gcc-4.8/libstdc++-v3/include/debug/functions.h
index 3f1609818..113c996a6 100644
--- a/gcc-4.8/libstdc++-v3/include/debug/functions.h
+++ b/gcc-4.8/libstdc++-v3/include/debug/functions.h
@@ -345,11 +345,13 @@ namespace __gnu_debug
return __check_sorted_set_aux(__first, __last, __pred, _SameType());
}
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 270. Binary search requirements overly strict
+ // Determine if a sequence is partitioned w.r.t. this element.
template<typename _ForwardIterator, typename _Tp>
inline bool
- __check_partitioned_lower_aux(_ForwardIterator __first,
- _ForwardIterator __last, const _Tp& __value,
- std::forward_iterator_tag)
+ __check_partitioned_lower(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __value)
{
while (__first != __last && *__first < __value)
++__first;
@@ -362,38 +364,11 @@ namespace __gnu_debug
return __first == __last;
}
- // For performance reason, as the iterator range has been validated, check on
- // random access safe iterators is done using the base iterator.
- template<typename _Iterator, typename _Sequence, typename _Tp>
- inline bool
- __check_partitioned_lower_aux(
- const _Safe_iterator<_Iterator, _Sequence>& __first,
- const _Safe_iterator<_Iterator, _Sequence>& __last,
- const _Tp& __value,
- std::random_access_iterator_tag __tag)
- {
- return __check_partitioned_lower_aux(__first.base(), __last.base(),
- __value, __tag);
- }
-
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 270. Binary search requirements overly strict
- // Determine if a sequence is partitioned w.r.t. this element.
template<typename _ForwardIterator, typename _Tp>
inline bool
- __check_partitioned_lower(_ForwardIterator __first,
+ __check_partitioned_upper(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value)
{
- return __check_partitioned_lower_aux(__first, __last, __value,
- std::__iterator_category(__first));
- }
-
- template<typename _ForwardIterator, typename _Tp>
- inline bool
- __check_partitioned_upper_aux(_ForwardIterator __first,
- _ForwardIterator __last, const _Tp& __value,
- std::forward_iterator_tag)
- {
while (__first != __last && !(__value < *__first))
++__first;
if (__first != __last)
@@ -405,35 +380,12 @@ namespace __gnu_debug
return __first == __last;
}
- // For performance reason, as the iterator range has been validated, check on
- // random access safe iterators is done using the base iterator.
- template<typename _Iterator, typename _Sequence, typename _Tp>
- inline bool
- __check_partitioned_upper_aux(
- const _Safe_iterator<_Iterator, _Sequence>& __first,
- const _Safe_iterator<_Iterator, _Sequence>& __last,
- const _Tp& __value,
- std::random_access_iterator_tag __tag)
- {
- return __check_partitioned_upper_aux(__first.base(), __last.base(),
- __value, __tag);
- }
-
- template<typename _ForwardIterator, typename _Tp>
- inline bool
- __check_partitioned_upper(_ForwardIterator __first,
- _ForwardIterator __last, const _Tp& __value)
- {
- return __check_partitioned_upper_aux(__first, __last, __value,
- std::__iterator_category(__first));
- }
-
+ // Determine if a sequence is partitioned w.r.t. this element.
template<typename _ForwardIterator, typename _Tp, typename _Pred>
inline bool
- __check_partitioned_lower_aux(_ForwardIterator __first,
+ __check_partitioned_lower(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value,
- _Pred __pred,
- std::forward_iterator_tag)
+ _Pred __pred)
{
while (__first != __last && bool(__pred(*__first, __value)))
++__first;
@@ -446,39 +398,12 @@ namespace __gnu_debug
return __first == __last;
}
- // For performance reason, as the iterator range has been validated, check on
- // random access safe iterators is done using the base iterator.
- template<typename _Iterator, typename _Sequence,
- typename _Tp, typename _Pred>
- inline bool
- __check_partitioned_lower_aux(
- const _Safe_iterator<_Iterator, _Sequence>& __first,
- const _Safe_iterator<_Iterator, _Sequence>& __last,
- const _Tp& __value, _Pred __pred,
- std::random_access_iterator_tag __tag)
- {
- return __check_partitioned_lower_aux(__first.base(), __last.base(),
- __value, __pred, __tag);
- }
-
- // Determine if a sequence is partitioned w.r.t. this element.
template<typename _ForwardIterator, typename _Tp, typename _Pred>
inline bool
- __check_partitioned_lower(_ForwardIterator __first,
+ __check_partitioned_upper(_ForwardIterator __first,
_ForwardIterator __last, const _Tp& __value,
_Pred __pred)
{
- return __check_partitioned_lower_aux(__first, __last, __value, __pred,
- std::__iterator_category(__first));
- }
-
- template<typename _ForwardIterator, typename _Tp, typename _Pred>
- inline bool
- __check_partitioned_upper_aux(_ForwardIterator __first,
- _ForwardIterator __last, const _Tp& __value,
- _Pred __pred,
- std::forward_iterator_tag)
- {
while (__first != __last && !bool(__pred(__value, *__first)))
++__first;
if (__first != __last)
@@ -490,31 +415,6 @@ namespace __gnu_debug
return __first == __last;
}
- // For performance reason, as the iterator range has been validated, check on
- // random access safe iterators is done using the base iterator.
- template<typename _Iterator, typename _Sequence,
- typename _Tp, typename _Pred>
- inline bool
- __check_partitioned_upper_aux(
- const _Safe_iterator<_Iterator, _Sequence>& __first,
- const _Safe_iterator<_Iterator, _Sequence>& __last,
- const _Tp& __value, _Pred __pred,
- std::random_access_iterator_tag __tag)
- {
- return __check_partitioned_upper_aux(__first.base(), __last.base(),
- __value, __pred, __tag);
- }
-
- template<typename _ForwardIterator, typename _Tp, typename _Pred>
- inline bool
- __check_partitioned_upper(_ForwardIterator __first,
- _ForwardIterator __last, const _Tp& __value,
- _Pred __pred)
- {
- return __check_partitioned_upper_aux(__first, __last, __value, __pred,
- std::__iterator_category(__first));
- }
-
// Helper struct to detect random access safe iterators.
template<typename _Iterator>
struct __is_safe_random_iterator