The effect of calling any member function other than the destructor,
the move-assignment operator, the copy-assignment operator, or
valid() on a
shared_future object for which
valid() == false is undefined
. [
Note 2:
It is valid to copy or move from a
shared_future
object for which
valid() is
false. —
end note]
Recommended practice: Implementations should detect this case and throw an object of type
future_error with an error condition of
future_errc::no_state. namespace std {
template<class R>
class shared_future {
public:
shared_future() noexcept;
shared_future(const shared_future& rhs) noexcept;
shared_future(future<R>&&) noexcept;
shared_future(shared_future&& rhs) noexcept;
~shared_future();
shared_future& operator=(const shared_future& rhs) noexcept;
shared_future& operator=(shared_future&& rhs) noexcept;
see below get() const;
bool valid() const noexcept;
void wait() const;
template<class Rep, class Period>
future_status wait_for(const chrono::duration<Rep, Period>& rel_time) const;
template<class Clock, class Duration>
future_status wait_until(const chrono::time_point<Clock, Duration>& abs_time) const;
};
}