1273. future::valid should be callable on an invalid future

Section: 33.6.7 [futures.unique_future] Status: Resolved Submitter: Jonathan Wakely Opened: 2009-11-22 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [futures.unique_future].

View all issues with Resolved status.

Discussion:

33.6.7 [futures.unique_future]/3 says:

The effect of calling any member function other than the destructor or the move-assignment operator on a future object for which valid() == false is undefined.

This means calling future::valid() is undefined unless it will return true, so you can only use it if you know the answer!

[ 2009-12-08 Moved to Tentatively Ready after 5 positive votes on c++std-lib. ]

[ 2010 Pittsburgh: ]

Moved to NAD EditorialResolved. Rationale added below.

Rationale:

Solved by N3058.

Proposed resolution:

Change 33.6.7 [futures.unique_future]/3:

The effect of calling any member function other than the destructor, or the move-assignment operator, or valid, on a future object for which valid() == false is undefined.