8#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_FUNCTIONAL_BIND_FRONT_HPP_
9#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_FUNCTIONAL_BIND_FRONT_HPP_
15#include "arene/base/compiler_support/cpp14_inline.hpp"
16#include "arene/base/functional/invoke.hpp"
17#include "arene/base/functional/perfect_forward_call_wrapper.hpp"
18#include "arene/base/stdlib_choice/cstddef.hpp"
19#include "arene/base/stdlib_choice/decay.hpp"
20#include "arene/base/stdlib_choice/forward.hpp"
21#include "arene/base/stdlib_choice/integer_sequence.hpp"
22#include "arene/base/stdlib_choice/is_constructible.hpp"
23#include "arene/base/stdlib_choice/is_move_constructible.hpp"
24#include "arene/base/stdlib_choice/tuple.hpp"
25#include "arene/base/type_traits/all_of.hpp"
31namespace bind_front_detail {
36template <std::size_t NBound,
typename Indexes = std::make_index_sequence<NBound>>
37class bind_front_policy;
44template <std::size_t NBound, std::size_t... Is>
45class bind_front_policy<NBound, std::index_sequence<Is...>> {
56 template <
typename FuncT,
typename BoundArgsTupleT,
typename... CallArgsT>
57 constexpr auto operator()(FuncT&& func, BoundArgsTupleT&& bound_args, CallArgsT&&... call_args)
const
58 noexcept((
noexcept(::arene::base::invoke(
59 std::forward<FuncT>(func),
60 std::get<Is>(std::forward<BoundArgsTupleT>(bound_args))...,
61 std::forward<CallArgsT>(call_args)...
63 ->
decltype(::arene::base::invoke(
64 std::forward<FuncT>(func),
65 std::get<Is>(std::forward<BoundArgsTupleT>(bound_args))...,
66 std::forward<CallArgsT>(call_args)...
68 return ::arene::base::invoke(
69 std::forward<FuncT>(func),
70 std::get<Is>(std::forward<BoundArgsTupleT>(bound_args))...,
71 std::forward<CallArgsT>(call_args)...
81template <
typename BoundFunc,
typename... BoundArgs>
84 perfect_forward_call_wrapper<bind_front_policy<
sizeof...(BoundArgs)>, BoundFunc, BoundArgs...> {
87 functional_detail::perfect_forward_call_wrapper<bind_front_policy<
sizeof...(BoundArgs)>, BoundFunc, BoundArgs...>;
90 using impl_type::impl_type;
91 using impl_type::operator();
128 template <
typename BoundFunc,
typename... BoundArgs>
129 constexpr auto operator()(BoundFunc&& bound_func, BoundArgs&&... bound_args)
const noexcept(
130 std::is_nothrow_constructible<std::decay_t<BoundFunc>, BoundFunc>::value &&
131 std::is_nothrow_constructible<std::tuple<std::decay_t<BoundArgs>...>, BoundArgs&&...>::value
132 ) -> bind_front_detail::bind_front_t<std::decay_t<BoundFunc>, std::decay_t<BoundArgs>...> {
134 std::is_constructible<std::decay_t<BoundFunc>, BoundFunc&&>::value,
135 "Bound function must be constructible from input."
138 std::is_move_constructible<std::decay_t<BoundFunc>>::value,
139 "Bound function must be move-constructible."
142 ::arene::base::all_of_v<std::is_constructible<std::decay_t<BoundArgs>, BoundArgs&&>::value...>,
143 "Bound arguments must be capturable from input."
146 ::arene::base::all_of_v<std::is_move_constructible<std::decay_t<BoundArgs>>::value...>,
147 "Bound arguments must be move-constructible."
149 return bind_front_detail::bind_front_t<std::decay_t<BoundFunc>, std::decay_t<BoundArgs>...>{
150 std::forward<BoundFunc>(bound_func),
151 std::forward<BoundArgs>(bound_args)...,
Definition array_exceptions_disabled.cpp:11
ARENE_CPP14_INLINE_VARIABLE(bind_front_detail::bind_front_fn, bind_front)
Copyright 2026, Toyota Motor Corporation.
Definition array_exceptions_disabled.cpp:10