Created on 2014-05-26.00:00:00 last changed 90 months ago
Proposed resolution:
This wording is relative to N4023.
Change Table 3, [meta.trans.other] in the Library TS as indicated:
Table 3 — Other type transformations Template Condition Comments … template <class Fn, class... ArgTypes>
struct invocation_type<Fn(ArgTypes...)>;Fn and all types in the parameter pack ArgTypes
shall be complete types, (possibly cv-qualified) void,
or arrays of unknown bound.The nested typedef invocation_type<Fn(ArgTypes...)>::type
shall be defined as follows. If
raw_invocation_type<Fn(ArgTypes...)>::type
does not exist, there shall be no member typedef type. Otherwise:
Let A1, A2, … denote ArgTypes...
Let R(T1, T2, …) denote
raw_invocation_type_t<Fn(ArgTypes...)>Then the member typedef type shall name the function
type R(U1, U2, …) where Ui is decay_t<Ai>
if declval<Ai>() is an rvalue otherwise Ti.If raw_invocation_type<Fn(ArgTypes...)>::type
is the function type R(T1, T2, …)
and Fn is a pointer to member type and T1 is
an rvalue reference, then R(decay<T1>::type,
T2, …).
Otherwise, raw_invocation_type<Fn(ArgTypes...)>::type.
[ 2013-06-21 Rapperswil ]
Accept for Fundamentals TS Working Paper
[ 2014-06-18, Rapperswil ]
Mike Spertus, Richard Smith, Jonathan Wakely, and Jeffrey Yasskin suggest improved wording.
Previous resolution [SUPERSEDED]:This wording is relative to N3908.
Change Table 3, [meta.trans.other] in the Library TS as indicated:
Table 3 — Other type transformations Template Condition Comments … template <class Fn, class... ArgTypes>
struct invocation_type<Fn(ArgTypes...)>;Fn and all types in the parameter pack ArgTypes
shall be complete types, (possibly cv-qualified) void,
or arrays of unknown bound.If A1, A2,... denotes ArgTypes... and
raw_invocation_type<Fn(ArgTypes...)>::type
is the function type R(T1, T2, ...) then let Ui be
decay<Ai>::type if Ai is an rvalue otherwise Ti.
IfandFn is a pointer to member type and T1 is
an rvalue reference, then let U1 beR(decay<T1>::type,.
T2, ...)
Otherwise, raw_invocation_type<Fn(ArgTypes...)>::type
The member typedef type shall equal R(U1, U2, ...).
Addresses: fund.ts
invocation_type falls short of its stated goals in the following case. Using the notation of Invocation type traits, consider
void f(int const& i); more_perfect_forwarding_async(f, int(7)); // Oops. Dangling reference because rvalue gone when async runs
This was always the advertised intent of the proposal, but while the language reflects this for the first parameter in the case of a member pointer, it failed to include corresponding language for other parameters.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-07-30 20:10:41 | admin | set | status: wp -> open |
2014-10-13 18:44:16 | admin | set | messages: + msg7152 |
2014-10-13 18:44:16 | admin | set | status: immediate -> wp |
2014-06-19 12:15:04 | admin | set | status: open -> immediate |
2014-06-18 21:12:29 | admin | set | messages: + msg7067 |
2014-06-18 21:12:29 | admin | set | status: new -> open |
2014-05-29 13:26:29 | admin | set | messages: + msg6978 |
2014-05-26 00:00:00 | admin | create |