8#ifndef INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_FUNCTIONAL_BIND_BACK_HPP_
9#define INCLUDE_GUARD_ARENE_BASE_ARENE_BASE_FUNCTIONAL_BIND_BACK_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"
31namespace bind_back_detail {
36template <std::
size_t NBound,
typename Indexes = std::make_index_sequence<NBound>>
37class bind_back_policy;
56 template <
typename FuncT,
typename BoundArgsTupleT,
typename... CallArgsT>
57 constexpr auto operator()(FuncT&& func, BoundArgsTupleT&& bound_args, CallArgsT&&... call_args)
const
68 return ::arene::base::invoke(
81template <
typename BoundFunc,
typename... BoundArgs>
83 : functional_detail::perfect_forward_call_wrapper<bind_back_policy<sizeof...(BoundArgs)>, BoundFunc, BoundArgs...> {
86 functional_detail::perfect_forward_call_wrapper<bind_back_policy<
sizeof...(BoundArgs)>, BoundFunc, BoundArgs...>;
89 using impl_type::impl_type;
90 using impl_type::operator();
127 template <
typename BoundFunc,
typename... BoundArgs>
128 constexpr auto operator()(BoundFunc&& bound_func, BoundArgs&&... bound_args)
const noexcept(
129 std::is_nothrow_constructible<std::decay_t<BoundFunc>, BoundFunc>::value &&
130 std::is_nothrow_constructible<std::tuple<std::decay_t<BoundArgs>...>, BoundArgs&&...>::value
133 std::is_constructible<std::decay_t<BoundFunc>, BoundFunc&&>::value,
134 "Bound function must be constructible from input."
137 std::is_move_constructible<std::decay_t<BoundFunc>>::value,
138 "Bound function must be move-constructible."
142 "Bound arguments must be capturable from input."
146 "Bound arguments must be move-constructible."
#define ARENE_CPP14_INLINE_VARIABLE(type, name)
Emulates C++17's inline variable declarations for function objects.
Definition cpp14_inline.hpp:69
Definition accumulate.hpp:37
constexpr auto invoke(F &&func, Args &&... args) noexcept(is_nothrow_invocable_v< F, Args... >) ->
Implementation of std::invoke from C++23: invokes the specified callable with the specified arguments...
Definition invoke.hpp:281
constexpr bool all_of_v
Trait which tests if every value in a parameter pack is true .
Definition accumulate.hpp:36
integer_sequence< size_t, Ints... > index_sequence
A helper alias template for integer_sequence<size_t, Ints>
Definition integer_sequence.hpp:218
::size_t size_t
A type suitable for holding the size of an object.
Definition cstddef.hpp:29
typename decay< Type >::type decay_t
A conversion equivalent to those performed when passing function arguments by value.
Definition decay.hpp:48
constexpr auto get(pair< T1, T2 > &values) noexcept -> tuple_element_t< I, pair< T1, T2 > > &
access an element of a pair
Definition pair.hpp:665
constexpr auto forward(remove_reference_t< T > &value) noexcept -> T &&
Cast a value to an rvalue if T is an rvalue or rvalue reference, otherwise forward an lvalue referenc...
Definition forward.hpp:24
Provides the all_of_v<bool...> trait.