3 ms·
A generic type would be useful then: type DurationSeconds<Value> where Value: Numeric { ... } DurationSeconds<UInt32> DurationSeconds<Float64>
by valleyer 5y ago
A generic type would be useful then:
type DurationSeconds<Value> where Value: Numeric { ... }
DurationSeconds<UInt32>
DurationSeconds<Float64>
- account42 5y agoThis is exactly what C++ 11 did with std::chrono [0] except it goes one step further and makes the period generic too. [0] https://en.cppreference.com/w/cpp/chrono/duration https://en.cppreference.com/w/cpp/chrono/duration