7#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_ALGORITHM_REDUCE_HPP_
8#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_ALGORITHM_REDUCE_HPP_
16#include "arene/base/algorithm/detail/generalized_reduce.hpp"
17#include "arene/base/algorithm/detail/reduce_policy_movable_box.hpp"
18#include "arene/base/algorithm/detail/synthesize_range1_overload.hpp"
19#include "arene/base/algorithm/detail/traits.hpp"
22#include "arene/base/stdlib_choice/enable_if.hpp"
23#include "arene/base/stdlib_choice/is_constructible.hpp"
24#include "arene/base/stdlib_choice/is_move_constructible.hpp"
25#include "arene/base/stdlib_choice/move.hpp"
26#include "arene/base/stdlib_choice/plus.hpp"
37namespace algorithm_detail {
38namespace reduce_detail {
82 std::enable_if_t<std::is_move_constructible<Value>::value>,
103 constexpr auto operator()(
109 std::is_nothrow_constructible<
110 typename reduce_policy_movable_box<Value>::value_type,
116 reduce_policy_movable_box<Value>,
119 typename reduce_policy_movable_box<Value>::value_type,
124 using value_policy = reduce_policy_movable_box<Value>;
126 return value_policy::access(
127 generalized_reduce{}(
131 typename value_policy::value_type{
std::move(init)},
172 std::enable_if_t<std::is_move_constructible<Value>::value>,
193 constexpr auto operator()(
226 algorithm_detail::synthesize_range1_overload_t<algorithm_detail::reduce_detail::reduce_fn>,
#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 bool is_invocable_r_v
Determine if a functor type is invocable with the specified return and argument types.
constexpr bool is_nothrow_invocable_v
Determine if a functor type is no-throw invocable with the specified argument types.
typename iter_reference_detail::iter_reference_impl< Itr >::type iter_reference_t
Determins the reference type of the given iterator.
Definition iter_reference_t.hpp:47
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