description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: result_of Class |
result_of Class |
02/21/2019 |
|
|
5374a096-4b4a-4712-aa97-6852c5cdd6be |
Determines the return type of the callable type that takes the specified argument types. Added in C++14, deprecated in C++17.
template<class>
struct result_of; // Causes a static assert
template <class Fn, class... ArgTypes>
struct result_of<Fn(ArgTypes...)>;
// Helper type
template<class T>
using result_of_t = typename result_of<T>::type;
Fn
The callable type to query.
ArgTypes
The types of the argument list to the callable type to query.
Use this template to determine at compile time the result type of Fn
(ArgTypes
), where Fn is a callable type, reference to function, or reference to callable type, invoked using an argument list of the types in ArgTypes. The type
member of the class template names the result type of decltype(std::invoke(declval<Fn>(), declval<ArgTypes>()...))
if the unevaluated expression std::invoke(declval<Fn>(), declval<ArgTypes>()...)
is well-formed. Otherwise, the class template has no member type
. The type Fn and all types in the parameter pack ArgTypes must be complete types, void
, or arrays of unknown bound. Deprecated in favor of invoke_result in C++17.
Header: <type_traits>
Namespace: std