29 template <
typename...>
32 template <
typename,
typename =
void>
33 constexpr auto equalityComparableToNullptr =
false;
36 constexpr auto equalityComparableToNullptr<T, Void<decltype (std::declval<T>() !=
nullptr)>> =
true;
51 template <
typename Callable,
typename... Args>
52 static void invoke (Callable&& fn, Args&&... args)
54 if constexpr (detail::equalityComparableToNullptr<Callable>)
56 JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE (
"-Waddress")
61 JUCE_END_IGNORE_WARNINGS_GCC_LIKE
69 template <
typename... Args>
78template <
typename A,
typename B>
82template <
typename Object,
typename OtherObject,
typename Member,
typename Other>
83[[nodiscard]] Object
withMember (Object copy, Member OtherObject::* member, Other&& value)
92template <
typename Functor,
typename Return,
typename... Args>
93static constexpr auto toFnPtr (Functor functor, Return (Functor::*) (Args...) const)
95 return static_cast<Return (*) (Args...)
> (functor);
101template <
typename Functor>
102static constexpr auto toFnPtr (Functor functor) {
return detail::toFnPtr (functor, &Functor::operator()); }
Object withMember(Object copy, Member OtherObject::*member, Other &&value)
Copies an object, sets one of the copy's members to the specified value, and then returns the copy.
Some helper methods for checking a callable object before invoking with the specified arguments.