Title
Missing forwarding during std::function invocation
Status
c++11
Section
[func.wrap.func.inv]
Submitter
Daniel Krügler

Created on 2010-03-26.00:00:00 last changed 154 months ago

Messages

Date: 2010-11-23.13:22:14

Proposed resolution:

Change [func.wrap.func.inv]/1+2 as indicated:

R operator()(ArgTypes... args) const

1 Effects:: INVOKE(f, std::forward<ArgTypes>(args)...t1, t2, ..., tN, R) (20.8.2), where f is the target object (20.8.1) of *this and t1, t2, ..., tN are the values in args....

2 Returns: Nothing if R is void, otherwise the return value of INVOKE(f, std::forward<ArgTypes>(args)...t1, t2, ..., tN, R).

3 Throws: bad_function_call if !*this; otherwise, any exception thrown by the wrapped callable object.

Date: 2010-11-23.13:22:14

[ Adopted at 2010-11 Batavia ]

Date: 2010-10-21.19:06:53

[ Post-Rapperswil: ]

Moved to Tentatively Ready after 5 positive votes on c++std-lib.

Date: 2010-03-26.00:00:00

The current wording of [func.wrap.func.inv]/1:

R operator()(ArgTypes... args) const

Effects: INVOKE(f, t1, t2, ..., tN, R) (20.8.2), where f is the target object (20.8.1) of *this and t1, t2, ..., tN are the values in args....

uses an unclear relation between the actual args and the used variables ti. It should be made clear, that std::forward has to be used to conserve the expression lvalueness.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-11-23 13:22:14adminsetmessages: + msg5404
2010-11-14 13:10:57adminsetstatus: voting -> wp
2010-11-08 14:14:39adminsetstatus: ready -> voting
2010-10-21 19:06:53adminsetmessages: + msg4772
2010-10-21 19:06:53adminsetstatus: new -> ready
2010-10-21 18:28:33adminsetmessages: + msg1622
2010-03-26 00:00:00admincreate