Title
Missing preconditions for shared_future
Status
resolved
Section
[futures.shared.future]
Submitter
Alisdair Meredith

Created on 2010-01-23.00:00:00 last changed 162 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Insert the following extra paragraphs:

In [futures.shared_future]

shared_future();

4 Effects: constructs ...

Postcondition: valid() == false.

Throws: nothing.

void wait() const;

Requires: valid() == true.

22 Effects: if the associated ...

template <class Rep, class Period>
  bool wait_for(const chrono::duration<Rep, Period>& rel_time) const;

Requires: valid() == true.

23 Effects: if the associated ...

template <class Clock, class Duration>
  bool wait_until(const chrono::time_point<Clock, Duration>& abs_time) const;

Requires: valid() == true.

25 Effects: blocks until ...

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: 2010-01-28.00:00:00

[ 2010-01-28 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

Date: 2010-01-23.00:00:00

The revised futures package in the current working paper simplified the is_ready/has_exception/has_value set of APIs, replacing them with a single 'valid' method. This method is used in many places to signal pre- and post- conditions, but that edit is not complete. Each method on a shared_future that requires an associated state should have a pre-condition that valid() == true.

History
Date User Action Args
2010-12-05 00:09:22adminsetstatus: nad editorial -> resolved
2010-10-21 18:28:33adminsetmessages: + msg1527
2010-10-21 18:28:33adminsetmessages: + msg1526
2010-10-21 18:28:33adminsetmessages: + msg1525
2010-10-21 18:28:33adminsetmessages: + msg1524
2010-01-23 00:00:00admincreate