Search code examples
c++futurec++-experimental

Should C++ std::future<T> method be named is_ready() or ready()?


Why is the experimental name is_ready() considered as an enhancement to std::future and not ready() which is more consistent with the STL coding style? Future already has a method called valid() which also doesn't have the is_ prefix.

Interestingly both N3721 and N3865 contain both names.


Solution

  • I suspect it's because of already existing enum constant std::future_status::ready. So is_ready() checks for the status ready. Although they both are in different naming scopes, I assume authors wish to avoid name intersection.