You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As demonstrated by the date library, std::chrono operations compile down to simple numeric operations without any extra type information. This means calculations with duration<double, seconds::period> are the same as calculations with double.
As a benefit, we would get explicit temporal information in our timestep.
On a current project, I have a constexpr converting chrono types to double to pass through to Choreograph. Will be nice to skip that extra writing. Will, however, require explicitly defining the incoming time type.
The text was updated successfully, but these errors were encountered:
Alternatively, provide methods that perform the chrono conversion as needed (it might be annoying to always specify Seconds(1.5) rather than just pass in a number).
User-defined literals might alleviate, too, though their could be ambiguity with chrono literals. Consider sec and msec to disambiguate. Alternatively, defining the literal for double could cause our s suffix to take precedence.
As demonstrated by the date library,
std::chrono
operations compile down to simple numeric operations without any extra type information. This means calculations withduration<double, seconds::period>
are the same as calculations withdouble
.As a benefit, we would get explicit temporal information in our timestep.
On a current project, I have a constexpr converting chrono types to double to pass through to Choreograph. Will be nice to skip that extra writing. Will, however, require explicitly defining the incoming time type.
The text was updated successfully, but these errors were encountered: