2387. More nested types that must be accessible and unambiguous

Section: 22.10.4 [func.require], 22.10.6 [refwrap] Status: C++17 Submitter: Jonathan Wakely Opened: 2014-05-23 Last modified: 2017-07-30 20:15:43 UTC

Priority: Not Prioritized

View all other issues in [func.require].

View all issues with C++17 status.

Discussion:

Further to 2299 and 2361, 22.10.4 [func.require] p3 and 22.10.6 [refwrap] p3 and p4 talk about member types without any mention of being accessible and unambiguous.

[2014-06-05 Daniel provides wording]

[2014-06-06 Library reflector vote]

The issue has been identified as Tentatively Ready based on six votes in favour.

Proposed resolution:

This wording is relative to N3936.

  1. Change 22.10.4 [func.require] p3 as indicated:

    -3- If a call wrapper (20.9.1) has a weak result type the type of its member type result_type is based on the type T of the wrapper's target object (20.9.1):

    • if T is a pointer to function type, result_type shall be a synonym for the return type of T;

    • if T is a pointer to member function, result_type shall be a synonym for the return type of T;

    • if T is a class type and the qualified-id T::result_type is valid and denotes a type (13.10.3 [temp.deduct])with a member type result_type, then result_type shall be a synonym for T::result_type;

    • otherwise result_type shall not be defined.

  2. Change 22.10.6 [refwrap] p3+p4 as indicated:

    -3- The template instantiation reference_wrapper<T> shall define a nested type named argument_type as a synonym for T1 only if the type T is any of the following:

    • a function type or a pointer to function type taking one argument of type T1

    • a pointer to member function R T0::f cv (where cv represents the member function_s cv-qualifiers); the type T1 is cv T0*

    • a class type where the qualified-id T::argument_type is valid and denotes a type (13.10.3 [temp.deduct])with a member type argument_type; the type T1 is T::argument_type.

    -4- The template instantiation reference_wrapper<T> shall define two nested types named first_argument_type and second_argument_type as synonyms for T1 and T2, respectively, only if the type T is any of the following:

    • a function type or a pointer to function type taking two arguments of types T1 and T2

    • a pointer to member function R T0::f(T2) cv (where cv represents the member function's cv-qualifiers); the type T1 is cv T0*

    • a class type where the qualified-ids T::first_argument_type and T::second_argument_type are both valid and both denote types (13.10.3 [temp.deduct])with member types first_argument_type and second_argument_type; the type T1 is T::first_argument_type. and the type T2 is T::second_argument_type.