carb::cpp::invoke_r

Defined in carb/cpp/Functional.h

template<typename R, typename Func, typename ...TArgs>
constexpr R carb::cpp::invoke_r(Func &&f, TArgs&&... args) noexcept(is_nothrow_invocable_r<R, Func, TArgs...>::value)

Invoke the function with the given arguments with the explicit return type R. This follows the same rules as carb::cpp::invoke().

This is equivalent to the C++23 std::invoke_r function. It lives here because people would expect an invoke_r function to live next to an invoke function.