+ template<typename _ForwardIterator, typename _Tp>
+ inline bool
+ __check_partitioned_lower_aux(_ForwardIterator __first,
+ _ForwardIterator __last, const _Tp& __value,
+ std::forward_iterator_tag)
+ {
+ while (__first != __last && *__first < __value)
+ ++__first;
+ if (__first != __last)
+ {
+ ++__first;
+ while (__first != __last && !(*__first < __value))
+ ++__first;
+ }
+ 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);
+ }
+