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 the TArgs pack will return R.

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. If R is void, the result can be any type (as any type can be converted to void by discarding it). If value is true, then invoke_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.