Created on 2010-12-08.00:00:00 last changed 162 months ago
Proposed resolution:
The suggested wording changes are against the working draft N3242.
Change [refwrap] p. 2 as indicated:
2 reference_wrapper<T> has a weak result type (20.8.2). If T is a function type, result_type shall be a synonym for the return type of T.
[ 2011-02-23 Reflector discussion ]
Moved to Tentatively Ready after 5 votes.
Issue 1295 correctly removed function types and references to function types from the bullet 1 of [func.require] p. 3 because neither function types nor function references satisfy the requirements for a target object which is defined to be an object of a callable type. This has the effect that the reference in [refwrap] p. 2
reference_wrapper has a weak result type (20.8.2).
is insufficient as a reference to define the member type result_type when the template argument T is a function type.
There are basically two approaches to solve the problem:Extend the definition of a weak result type in [func.require] p. 3 to both function types and references thereof. This extension must be specified independend from the concept of a call wrapper, though.
Add one extra sentence to [refwrap] p. 2 that simply defines the member type result_type for reference_wrapper<T>, when T is a function type.
I checked the current usages of weak result type to have a base to argue for one or the other approach. It turns out, that there is no further reference to this definition in regard to function types or references thereof. The only other reference can be found in [func.bind.bind] p. 3, where g is required to be a class type.
History | |||
---|---|---|---|
Date | User | Action | Args |
2011-08-23 20:07:26 | admin | set | status: wp -> c++11 |
2011-04-11 11:23:23 | admin | set | status: voting -> wp |
2011-03-05 15:24:28 | admin | set | status: ready -> voting |
2011-02-23 18:50:30 | admin | set | messages: + msg5529 |
2011-02-23 18:50:30 | admin | set | status: new -> ready |
2010-12-08 20:35:42 | admin | set | messages: + msg5468 |
2010-12-08 00:00:00 | admin | create |