Title
Should bind()'s returned functor have a nofail copy ctor when bind() is nofail?
Status
resolved
Section
[func.bind.bind]
Submitter
Stephan T. Lavavej

Created on 2008-02-08.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Add a new sentence to the end of paragraphs 2 and 4 of [func.bind.bind]:

-2- Returns: A forwarding call wrapper g with a weak result type (20.6.2). The effect of g(u1, u2, ..., uM) shall be INVOKE(f, v1, v2, ..., vN, Callable<F cv,V1, V2, ..., VN>::result_type), where cv represents the cv-qualifiers of g and the values and types of the bound arguments v1, v2, ..., vN are determined as specified below. The copy constructor and move constructor of the forwarding call wrapper shall throw an exception if and only if the corresponding constructor of F or any of the types in BoundArgs... throw an exception.

...

-5- Returns: A forwarding call wrapper g with a nested type result_type defined as a synonym for R. The effect of g(u1, u2, ..., uM) shall be INVOKE(f, v1, v2, ..., vN, R), where the values and types of the bound arguments v1, v2, ..., vN are determined as specified below. The copy constructor and move constructor of the forwarding call wrapper shall throw an exception if and only if the corresponding constructor of F or any of the types in BoundArgs... throw an exception.

Date: 2010-10-21.18:28:33

Rationale:

This issue is solved as proposed by 817.

Date: 2010-02-11.00:00:00

[ 2010-02-11 Moved from Ready to Tentatively NAD Editorial, rationale added below. ]

Date: 2010-10-21.18:28:33

[ 2009-10 Santa Cruz: ]

Move to Ready. Decoupling from issue 817.

Date: 2010-10-21.18:28:33

[ 2009-07 Frankfurt: ]

Related to 817 (see below). Leave Open.

Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

Part of all of this issue appears to be rendered moot by the proposed resolution to issue 817 (q.v.). We recommend the issues be considered simultaneously (or possibly even merged) to ensure there is no overlap. Move to Open, and likewise for issue 817.

Date: 2010-10-21.18:28:33

[ Post Summit, Anthony provided wording. ]

Date: 2010-10-21.18:28:33

[ San Francisco: ]

Howard to provide wording.

Date: 2010-10-21.18:28:33

[ Howard adds: ]

tuple construction should probably have a similar guarantee.

Date: 2008-02-08.00:00:00

Library Issue 527 notes that bind(f, t1, ..., tN) should be nofail when f, t1, ..., tN have nofail copy ctors.

However, no guarantees are provided for the copy ctor of the functor returned by bind(). (It's guaranteed to have a copy ctor, which can throw implementation-defined exceptions: bind() returns a forwarding call wrapper, TR1 3.6.3/2. A forwarding call wrapper is a call wrapper, TR1 3.3/4. Every call wrapper shall be CopyConstructible, TR1 3.3/4. Everything without an exception-specification may throw implementation-defined exceptions unless otherwise specified, C++03 17.4.4.8/3.)

Should the nofail guarantee requested by Library Issue 527 be extended to cover both calling bind() and copying the returned functor?

History
Date User Action Args
2010-11-19 19:04:45adminsetstatus: nad editorial -> resolved
2010-10-21 18:28:33adminsetmessages: + msg3895
2010-10-21 18:28:33adminsetmessages: + msg3894
2010-10-21 18:28:33adminsetmessages: + msg3893
2010-10-21 18:28:33adminsetmessages: + msg3892
2010-10-21 18:28:33adminsetmessages: + msg3891
2010-10-21 18:28:33adminsetmessages: + msg3890
2010-10-21 18:28:33adminsetmessages: + msg3889
2010-10-21 18:28:33adminsetmessages: + msg3888
2010-10-21 18:28:33adminsetmessages: + msg3887
2008-02-08 00:00:00admincreate