19template <
class R,
class...
Args>
39 callback_ = [](
void*
obj,
Args... args) ->
R {
41 *
reinterpret_cast<typename std::add_pointer<F>::type
>(
obj),
42 std::forward<Args>(args)...);
56 requires std::is_invocable_r_v<
R,
F&&,
Args...>
58 obj_ =
reinterpret_cast<void*
>(std::addressof(
f));
59 callback_ = [](
void*
obj,
Args... args) {
61 *
reinterpret_cast<typename std::add_pointer<F>::type
>(
obj),
62 std::forward<Args>(args)...);
72 std::swap(obj_,
rhs.obj_);
73 std::swap(callback_,
rhs.callback_);
80 return callback_(obj_, std::forward<Args>(args)...);
85 R (*callback_)(
void*,
Args...) =
nullptr;
91template <
typename R,
typename...
Args>
97template <
typename R,
typename...
Args>
constexpr function_ref< R(Args...)> & operator=(F &&f) noexcept
Definition FunctionRef.hpp:57
constexpr void swap(function_ref< R(Args...)> &rhs) noexcept
Definition FunctionRef.hpp:71
R operator()(Args... args) const
Definition FunctionRef.hpp:79
constexpr function_ref< R(Args...)> & operator=(const function_ref< R(Args...)> &rhs) noexcept=default
constexpr function_ref() noexcept=delete
Definition FunctionRef.hpp:17
Definition Expression.hpp:18
IntrusiveSharedPtr< T > AllocateIntrusiveShared(Alloc alloc, Args &&... args)
Definition IntrusiveSharedPtr.hpp:275
constexpr void swap(function_ref< R(Args...)> &lhs, function_ref< R(Args...)> &rhs) noexcept
Definition FunctionRef.hpp:92