So in c++11 the Chrono Library provides, duration_cast
:
Computations are done in the widest type available and converted, as if by static_cast, to the result type only when finished
Returns the greatest duration t representable in ToDuration that is less or equal to d
So for all x
will the result of these 2 calls be equal:
chrono::duration_cast<chrono::seconds>(x)
chrono::floor<chrono::seconds>(x)
Aucun commentaire:
Enregistrer un commentaire