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
Priority: Not Prioritized
View other active issues in [func.require].
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.
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_typeis based on the typeTof the wrapper's target object (20.9.1):
if
Tis a pointer to function type,result_typeshall be a synonym for the return type ofT;if
Tis a pointer to member function,result_typeshall be a synonym for the return type ofT;if
Tis a class type and the qualified-idT::result_typeis valid and denotes a type (13.10.3 [temp.deduct])with a member type, thenresult_typeresult_typeshall be a synonym forT::result_type;otherwise
result_typeshall not be defined.
Change 22.10.6 [refwrap] p3+p4 as indicated:
-3- The template instantiation
reference_wrapper<T>shall define a nested type namedargument_typeas a synonym forT1only if the typeTis any of the following:
a function type or a pointer to function type taking one argument of type
T1a pointer to member function
R T0::fcv (where cv represents the member function_s cv-qualifiers); the typeT1is cvT0*a class type where the qualified-id
T::argument_typeis valid and denotes a type (13.10.3 [temp.deduct])with a member type; the typeargument_typeT1isT::argument_type.-4- The template instantiation
reference_wrapper<T>shall define two nested types namedfirst_argument_typeandsecond_argument_typeas synonyms forT1andT2, respectively, only if the typeTis any of the following:
a function type or a pointer to function type taking two arguments of types
T1andT2a pointer to member function
R T0::f(T2)cv (where cv represents the member function's cv-qualifiers); the typeT1is cvT0*a class type where the qualified-ids
T::first_argument_typeandT::second_argument_typeare both valid and both denote types (13.10.3 [temp.deduct])with member types; the typefirst_argument_typeandsecond_argument_typeT1isT::first_argument_type.and the typeT2isT::second_argument_type.