Chrono: add template parameter to ToScale()
This commit is contained in:
parent
0c2d767f6f
commit
e43b56eb38
@ -57,9 +57,9 @@ public:
|
|||||||
return count();
|
return count();
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr unsigned ToScale(unsigned base) const {
|
template<typename T=rep>
|
||||||
// TODO: case to 64 bit to avoid integer overflow?
|
constexpr T ToScale(unsigned base) const {
|
||||||
return count() * base / 1000;
|
return count() * T(base) / 1000;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user