Add future::ready

This commit is contained in:
Nikita Lisitsa 2020-11-21 15:32:24 +03:00
parent ff5d778118
commit 5f91587a39

View file

@ -90,6 +90,11 @@ namespace psemek::util
state_->canceled = true;
}
bool ready() const
{
return wait_for(std::chrono::seconds{0});
}
private:
std::shared_ptr<detail::task_state<T>> state_;
std::future<T> f_;