5#ifndef INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_INTERNAL_PARTITION_POINT_HPP_
6#define INCLUDE_GUARD_ARENE_BASE_STDLIB_INCLUDE_STDLIB_DETAIL_INTERNAL_PARTITION_POINT_HPP_
8#include "arene/base/algorithm/detail/traits.hpp"
39 class ForwardIterator,
45 arene::base::algorithm_detail::iter_reference_t<ForwardIterator>>>> =
nullptr>
46constexpr auto partition_point(ForwardIterator first, ForwardIterator last, UnaryPred pred)
noexcept(
51 noexcept(pred(*first))
53 using difference_type = arene::base::algorithm_detail::iter_difference_t<ForwardIterator>;
54 constexpr difference_type two{2};
59 auto length = distance(first, last);
60 while (length > difference_type{}) {
61 auto const half = length / two;
62 auto const middle = next(first, half);
66 length -= (half + difference_type{1});
Public export header for the constraints subpackage.
constexpr bool is_predicate_v
backport for the C++20 predicate concept
ARENE_NODISCARD constexpr auto next(Iterator itr, typename std::iterator_traits< Iterator >::difference_type steps=1) noexcept(noexcept(::arene::base::advance(itr, steps))) -> Iterator
Produces the Nth successor (or predecessor if steps is negative) of an iterator.
Definition next.hpp:38
constexpr auto distance(Iterator first, Iterator last) noexcept(noexcept(distance_impl::do_distance(first, last, typename std::iterator_traits< Iterator >::iterator_category{}))) -> typename std::iterator_traits< Iterator >::difference_type
Find the number of elements between first and last.
Definition distance.hpp:79
typename constraints_impl::constraints< EnableIfs... >::type constraints
Helper used to express template constraints in a consistent way using std::enable_if_t.
Definition constraints.hpp:51
Definition internal_named_requirements.hpp:19
constexpr auto partition_point(ForwardIterator first, ForwardIterator last, UnaryPred pred) noexcept(std::is_nothrow_move_constructible_v< ForwardIterator > and//std::is_nothrow_move_assignable_v< ForwardIterator >and//noexcept(arene::base::distance(first, last)) and//noexcept(arene::base::next(first)) and//noexcept(pred(*first))) -> ForwardIterator
locates the partition point of a range partitioned with respect to an unary predicate
Definition internal_partition_point.hpp:46
typename enable_if< Condition, Type >::type enable_if_t
Type alias to support constraining templates. Is an alias for the specified type if the Condition is ...
Definition enable_if.hpp:41
constexpr bool is_nothrow_move_constructible_v
Type trait to detect if an instance of T is move constructible without throwing.
constexpr bool is_nothrow_move_assignable_v
Type trait to detect if an instance of T is move assignable without throwing.