This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TS status.

2390. [fund.ts] Invocation types and rvalues

Section: 3.3.2 [fund.ts::meta.trans.other] Status: TS Submitter: Michael Spertus Opened: 2014-05-26 Last modified: 2017-07-30

Priority: Not Prioritized

View all other issues in [fund.ts::meta.trans.other].

View all issues with TS status.

Discussion:

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.

[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.

  1. 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
    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

Proposed resolution:

This wording is relative to N4023.

  1. 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 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.