carb::cpp::is_invocable_r
Defined in carb/cpp/TypeTraits.h
-
template<typename R, typename Func, typename ...TArgs>
struct is_invocable_r : public detail::invocable_r_impl::invocable_t Check if invoking
Func
with theTArgs
pack will returnR
.Similar to is_invocable, but additionally checks that the result type is convertible to
R
and that the conversion does not bind a reference to a temporary object. IfR
isvoid
, the result can be any type (as any type can be converted tovoid
by discarding it). Ifvalue
istrue
, theninvoke_r<R>(func, args...)
is a valid expression.This is equivalent to the C++23 definition of
is_invocable_r
. The function was originally added in C++17, but the specification was altered in C++23 to avoid undefined behavior.