No, I do not think this is possible. I will also try to think about your design, and if such a check is really necessary, perhaps you are looking for something like intermittent streams from boost.
However, you can use std::async - which I would do anyway, and then rely on the std::future functions. You can
Namely, you can call std::future::wait_for with something like std::chrono::seconds(0) . This gives you a zero cost check and allows you to compare the std::future_status returned by wait_for .
auto f = std::async(foo); ... auto status = f.wait_for(std::chrono::seconds(0)); if(status == std::future_status::timeout) { // still computing } else if(status == std::future_status::ready) { // finished computing } else { // There is still std::future_status::defered }
source share