7#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_ALGORITHM_INPLACE_MERGE_HPP_
8#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_ALGORITHM_INPLACE_MERGE_HPP_
13#include "arene/base/algorithm/detail/bind_back_with_iterator.hpp"
14#include "arene/base/algorithm/detail/traits.hpp"
22#include "arene/base/stdlib_choice/declval.hpp"
23#include "arene/base/stdlib_choice/enable_if.hpp"
24#include "arene/base/stdlib_choice/is_copy_constructible.hpp"
25#include "arene/base/stdlib_choice/is_move_assignable.hpp"
26#include "arene/base/stdlib_choice/move.hpp"
42namespace algorithm_detail {
43namespace inplace_merge_detail {
47class inplace_merge_impl_fn {
91 class BidirectionalIt,
98 constexpr auto operator()(BidirectionalIt first, BidirectionalIt middle, BidirectionalIt last, Compare comp)
const
106 std::declval<bind_back_with_iterator<Compare, BidirectionalIt>>()
109 noexcept(arene::base::advance(
121 while ((left != middle) && (right != last)) {
125 not_fn(bind_back_with_iterator<Compare, BidirectionalIt>{comp, left})
127 if (right_end == right) {
131 left = rotate(left, right, right_end);
132 arene::base::advance(middle, block_size);
Provides a backport of C++17's constexpr std::advance.
#define ARENE_CPP14_INLINE_VARIABLE(type, name)
Emulates C++17's inline variable declarations for function objects.
Definition cpp14_inline.hpp:69
static constexpr value_type value
Definition integral_constant.hpp:34
Definition accumulate.hpp:37
constexpr auto find_if(Iterator first, Iterator last, Predicate pred) noexcept(denotes_nothrow_iterable_range_v< Iterator > &&base::is_nothrow_invocable_v< Predicate &, typename std::iterator_traits< Iterator >::reference >) -> Iterator
Returns an iterator to the first element in the range [first, last) that satisfies equality criteria:...
Definition find_if.hpp:42
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
constexpr bool denotes_nothrow_iterable_range_v
Check if an iterator/sentinel pair form an iterable range that can be iterated without throwing.
constexpr bool is_nothrow_invocable_v
Determine if a functor type is no-throw invocable with the specified argument types.
constexpr bool is_nothrow_equality_comparable_v
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 accumulate.hpp:36
constexpr auto move(T &&value) noexcept -> remove_reference_t< T > &&
Cast a value to an rvalue.
Definition move.hpp:30
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
auto declval() noexcept -> T &&
A dummy function that is declared but not defined, with a user-specified return type,...