Title
Exceptions thrown during promise::set_value
Status
resolved
Section
[futures.promise]
Submitter
Jonathan Wakely

Created on 2009-12-18.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change [futures.promise]/18:

18 Throws: future_error if its associated state is already ready or, for the first version an exception thrown by the copy constructor of R, or for the second version an exception thrown by the move constructor of R.

Date: 2010-10-21.18:28:33

Rationale:

Solved by N3058.

Date: 2010-12-05.00:09:22

[ 2010 Pittsburgh: Moved to NAD EditorialResolved. Rationale added below. ]

Date: 2009-12-18.00:00:00

In [futures.promise]

Does promise<R>::set_value return normally if the copy/move constructor of R throws?

The exception could be caught and set using promise<R>::set_exception, or it could be allowed to leave the set_value call, but it's not clear which is intended. I suggest the exception should not be caught.

N.B. This doesn't apply to promise<R&>::set_value or promise<void>::set_value because they don't construct a new object.

History
Date User Action Args
2010-12-05 00:09:22adminsetstatus: nad editorial -> resolved
2010-10-21 18:28:33adminsetmessages: + msg1474
2010-10-21 18:28:33adminsetmessages: + msg1473
2010-10-21 18:28:33adminsetmessages: + msg1472
2009-12-18 00:00:00admincreate