16 static constexpr bool enable_one_arg_constructor =
18 || std::is_base_of_v<function_invoke, std::remove_cvref_t<Fn>>)
19 && !ll::traits::is_specialization_of_v<std::remove_cvref_t<Fn>, std::in_place_type_t>
20 && base::template is_callable_from<std::decay_t<Fn>>;
22 template <
class Fn,
class... Xs>
23 static constexpr bool enable_in_place_constructor =
24 std::is_constructible_v<std::decay_t<Fn>, Xs...> && base::template is_callable_from<std::decay_t<Fn>>;
26 template <
class Fn,
class U,
class... Xs>
27 static constexpr bool enable_in_place_list_constructor =
28 std::is_constructible_v<std::decay_t<Fn>, std::initializer_list<U>&, Xs...>
29 && base::template is_callable_from<std::decay_t<Fn>>;
35 requires enable_one_arg_constructor<F>
37 using Fn = std::decay_t<F>;
38 static_assert(std::is_constructible_v<Fn, F>);
39 if constexpr (std::is_member_pointer_v<Fn> || std::is_pointer_v<Fn> ||
requires(F e) {
40 { e ==
nullptr } -> std::same_as<bool>;
43 this->construct_empty();
47 using FnInvQuals = base::template FnInvQuals<Fn>;
48 this->
template construct_target<Fn, FnInvQuals>(std::forward<F>(f));
51 template <
class F,
class... Xs>
52 requires enable_in_place_constructor<F, Xs...>
54 using Fn = std::decay_t<F>;
55 static_assert(std::is_same_v<Fn, F>);
56 using FnInvQuals = base::template FnInvQuals<Fn>;
57 this->
template construct_target<Fn, FnInvQuals>(std::forward<Xs>(args)...);
60 template <
class F,
class U,
class... Xs>
61 requires enable_in_place_list_constructor<F, U, Xs...>
62 explicit function_invoke(std::in_place_type_t<F>, std::initializer_list<U> l, Xs&&... args) {
63 using Fn = std::decay_t<F>;
64 static_assert(std::is_same_v<Fn, F>);
65 using FnInvQuals = base::template FnInvQuals<Fn>;
66 this->
template construct_target<Fn, FnInvQuals>(l, std::forward<Xs>(args)...);
72 other = std::move(*
this);
73 *
this = std::move(tmp);