The behavior is undefined if any member function other than the destructor, themove-assignment operator, or valid is called on a future that does not refer toshared state (although implementations are encouraged to throw std::future_errorindicating no_state in this case). It is valid to move from a future object forwhich valid() is false.
On many platforms, a single CPU instruction obtains both the quotient and theremainder, and this function may leverage that, although compilers are generallyable to merge nearby / and % where suitable.