19template <
class R,
class... Args>
40 std::is_invocable_r_v<R, F &&, Args...>)
42 : obj_(const_cast<
void*>(
43 reinterpret_cast<const
void*>(
std::addressof(f)))) {
44 callback_ = [](
void* obj, Args... args) -> R {
46 *
reinterpret_cast<typename std::add_pointer<F>::type
>(obj),
47 std::forward<Args>(args)...);
67 requires std::is_invocable_r_v<R, F&&, Args...>
69 obj_ =
reinterpret_cast<void*
>(std::addressof(f));
70 callback_ = [](
void* obj, Args... args) {
72 *
reinterpret_cast<typename std::add_pointer<F>::type
>(obj),
73 std::forward<Args>(args)...);
96 return callback_(obj_, std::forward<Args>(args)...);
100 void* obj_ =
nullptr;
101 R (*callback_)(
void*, Args...) =
nullptr;
107template <
typename R,
typename... Args>
113template <
typename R,
typename... Args>
constexpr function_ref() noexcept=delete
constexpr function_ref< R(Args...)> & operator=(const function_ref< R(Args...)> &rhs) noexcept=default
Makes *this refer to the same callable as rhs.
constexpr function_ref< R(Args...)> & operator=(F &&f) noexcept
Makes *this refer to f.
Definition function_ref.hpp:68
R operator()(Args... args) const
Call the stored callable with the given arguments.
Definition function_ref.hpp:95
constexpr void swap(function_ref< R(Args...)> &rhs) noexcept
Swaps the referred callables of *this and rhs.
Definition function_ref.hpp:84
Definition function_ref.hpp:13
Definition expression_graph.hpp:11
function_ref(R(*)(Args...)) -> function_ref< R(Args...)>
constexpr void swap(function_ref< R(Args...)> &lhs, function_ref< R(Args...)> &rhs) noexcept
Swaps the referred callables of lhs and rhs.
Definition function_ref.hpp:108
Definition PointerIntPair.h:280
WPI_BASIC_JSON_TPL_DECLARATION void swap(wpi::WPI_BASIC_JSON_TPL &j1, wpi::WPI_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) is_nothrow_move_constructible< wpi::WPI_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression, cppcoreguidelines-noexcept-swap, performance-noexcept-swap) is_nothrow_move_assignable< wpi::WPI_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects
Definition json.h:5258
typename std::decay< T >::type decay_t
Definition base.h:326