-
Notifications
You must be signed in to change notification settings - Fork 20
Description
The description of the unwrapping constructor has some terms that are not defined, e.g. unwrapping the inner future. This need additional wording.
future(future<future<R>>&& rhs) noexcept;
Effects:
Constructs a future object by moving the instance referred to by rhs and unwrapping the inner future.
What about changing the effect to
Constructs a future object by moving the instance referred to by rhs. This future will be ready when the outer an inner futures will be ready. When the outer future is ready, it could happen that the inner future is invalid. In this case the inner future is forced to a valid state making it ready with an exception of type std::future_error
, with an error code of std::future_errc::broken_promise
.
BTW, the post-condition states:
Postconditions:
valid() returns the same value as rhs.valid() prior to the constructor invocation.
I wonder if the constructed future shouldn't be always valid.