future::valid
should be callable on an invalid futureSection: 32.10.7 [futures.unique.future] Status: Resolved Submitter: Jonathan Wakely Opened: 2009-11-22 Last modified: 2021-06-06
Priority: Not Prioritized
View all other issues in [futures.unique.future].
View all issues with Resolved status.
Discussion:
[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 whichvalid() == 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 [futures.unique_future]/3:
The effect of calling any member function other than the destructor, or the move-assignment operator, or
valid
, on afuture
object for whichvalid() == false
is undefined.