A new WG21 paper is available. A copy is linked below, and the paper will also appear in the next normal WG21 mailing. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.
Document number: N3729
Date: 2013-09-02
Invocation type traits
by Mike Spertus
Excerpt:
We propose a (compiler-supported) type trait
std::invocation_typewhose type typedef is the implied function type of the callable object when called with the given argument types.For example, if we define
Casstruct C { int operator()(double d, int i); int operator()(double d1, double d2); };
thenstd::invocation_type<C(int, int)>::typewould beint(double, int). More precisely the return type ofinvocation_type<Fn(ArgTypes...)>isresult_of<Fn(ArgTypes...)>and each argument type is the same as the formal parameter type matched in the call toFn. For more detailed information, see the use cases and wording below.

Add a Comment
Comments are closed.