Commit e43b56eb authored by Max Kellermann's avatar Max Kellermann

Chrono: add template parameter to ToScale()

parent 0c2d767f
......@@ -57,9 +57,9 @@ public:
return count();
}
constexpr unsigned ToScale(unsigned base) const {
// TODO: case to 64 bit to avoid integer overflow?
return count() * base / 1000;
template<typename T=rep>
constexpr T ToScale(unsigned base) const {
return count() * T(base) / 1000;
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment