This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.
std::function invocationSection: 22.10.17.3.5 [func.wrap.func.inv] Status: C++11 Submitter: Daniel Krügler Opened: 2010-03-26 Last modified: 2016-01-28
Priority: Not Prioritized
View all other issues in [func.wrap.func.inv].
View all issues with C++11 status.
Discussion:
The current wording of 22.10.17.3.5 [func.wrap.func.inv]/1:
R operator()(ArgTypes... args) constEffects:
INVOKE(f, t1, t2, ..., tN, R)(20.8.2), wherefis the target object (20.8.1) of*thisandt1, t2, ..., tNare the values inargs....
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.
[ Post-Rapperswil: ]
Moved to Tentatively Ready after 5 positive votes on c++std-lib.
[ Adopted at 2010-11 Batavia ]
Proposed resolution:
Change 22.10.17.3.5 [func.wrap.func.inv]/1+2 as indicated:
R operator()(ArgTypes... args) const1 Effects::
INVOKE(f, std::forward<ArgTypes>(args)...(20.8.2), wheret1, t2, ..., tN, R)fis the target object (20.8.1) of*thisand.t1, t2, ..., tNare the values inargs...2 Returns: Nothing if
Risvoid, otherwise the return value ofINVOKE(f, std::forward<ArgTypes>(args)....t1, t2, ..., tN, R)3 Throws:
bad_function_callif!*this; otherwise, any exception thrown by the wrapped callable object.