22template <
typename R,
typename... Args>
33 std::is_invocable_r_v<R, F&&, Args...>
38 obj_ =
reinterpret_cast<void *
>( std::addressof( f ) );
39 callback_ = [] (
void *obj, Args... args ) -> R
42 *
reinterpret_cast<std::add_pointer_t<F>
>( obj ),
43 std::forward<Args>( args )...
53 std::is_invocable_r_v<R, F&&, Args...>
58 obj_ =
reinterpret_cast<void *
>( std::addressof( f ) );
59 callback_ = [] (
void *obj, Args... args ) -> R
62 *
reinterpret_cast<std::add_pointer_t<F>
>( obj ),
63 std::forward<Args>( args )...
71 std::swap( obj_, rhs.obj_ );
72 std::swap( callback_, rhs.callback_ );
75 R operator ()( Args... args )
const
77 return callback_( obj_, std::forward<Args>( args )... );
82 R (*callback_)(
void*, Args... ) =
nullptr;
85template <
typename R,
typename... Args>
Definition MRFunctional.h:15
constexpr FunctionRef() noexcept=delete
constexpr void swap(FunctionRef< R(Args...)> &lhs, FunctionRef< R(Args...)> &rhs) noexcept
Definition MRFunctional.h:86
constexpr void swap(FunctionRef &rhs) noexcept
Definition MRFunctional.h:69
only for bindings generation
Definition MRCameraOrientationPlugin.h:8