mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-10-04 13:41:02 +00:00
Release Cosmopolitan v3.6.0
This release is an atomic upgrade to GCC 14.1.0 with C23 and C++23
This commit is contained in:
parent
62ace3623a
commit
5660ec4741
1585 changed files with 117353 additions and 271644 deletions
34
third_party/libcxx/__algorithm/partition_point.h
vendored
34
third_party/libcxx/__algorithm/partition_point.h
vendored
|
@ -21,26 +21,22 @@
|
|||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template<class _ForwardIterator, class _Predicate>
|
||||
template <class _ForwardIterator, class _Predicate>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
|
||||
partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred)
|
||||
{
|
||||
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
|
||||
difference_type __len = _VSTD::distance(__first, __last);
|
||||
while (__len != 0)
|
||||
{
|
||||
difference_type __l2 = _VSTD::__half_positive(__len);
|
||||
_ForwardIterator __m = __first;
|
||||
_VSTD::advance(__m, __l2);
|
||||
if (__pred(*__m))
|
||||
{
|
||||
__first = ++__m;
|
||||
__len -= __l2 + 1;
|
||||
}
|
||||
else
|
||||
__len = __l2;
|
||||
}
|
||||
return __first;
|
||||
partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) {
|
||||
typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
|
||||
difference_type __len = std::distance(__first, __last);
|
||||
while (__len != 0) {
|
||||
difference_type __l2 = std::__half_positive(__len);
|
||||
_ForwardIterator __m = __first;
|
||||
std::advance(__m, __l2);
|
||||
if (__pred(*__m)) {
|
||||
__first = ++__m;
|
||||
__len -= __l2 + 1;
|
||||
} else
|
||||
__len = __l2;
|
||||
}
|
||||
return __first;
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue