[ox/std] Fix onMask's default bits value to use the number of bits instead of bytes

This commit is contained in:
Gary Talent 2018-07-08 01:40:53 -05:00
parent 7b9c7ddde4
commit de2e1bd1d6

View File

@ -17,7 +17,7 @@ inline constexpr T rotateLeft(T i, int shift) {
}
template<typename T>
constexpr T onMask(int bits = sizeof(T)) {
constexpr T onMask(int bits = sizeof(T) * 8) {
T out = 0;
for (auto i = 0; i < bits; i++) {
out |= static_cast<T>(1) << i;