Please note that this is different from the call valid(). valid()indicates whether the future has a correct general state in general, however I want to know if the meaning is set for the future (i.e. through std::promise::set_value).
There is a method wait_for, however, I do not want the calling thread to block at all, I just want to check for the value. Theoretically, I could call wait_forzero duration, but I don’t know if this is really the preferred way to do this, and I'm not sure if the expected behavior occurs when calling wait_forwith zero duration.
source
share