Skip to content

Commit 0ad5f46

Browse files
committed
Fix underlying flags size
1 parent e9eb45b commit 0ad5f46

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/flags19.lib/flags19/FlagsOf.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ using enum19::meta_enum_for;
1313
namespace details {
1414

1515
template<size_t maxBit> constexpr auto storageTypeForMaxBit() {
16-
if constexpr (maxBit <= sizeof(uint8_t)) {
16+
if constexpr (maxBit <= 8 * sizeof(uint8_t)) {
1717
return uint8_t{};
1818
}
19-
else if constexpr (maxBit <= sizeof(uint16_t)) {
19+
else if constexpr (maxBit <= 8 * sizeof(uint16_t)) {
2020
return uint16_t{};
2121
}
22-
else if constexpr (maxBit <= sizeof(uint32_t)) {
22+
else if constexpr (maxBit <= 8 * sizeof(uint32_t)) {
2323
return uint32_t{};
2424
}
25-
else if constexpr (maxBit <= sizeof(uint64_t)) {
25+
else if constexpr (maxBit <= 8 * sizeof(uint64_t)) {
2626
return uint64_t{};
2727
}
2828
else {
29-
static_assert(maxBit > sizeof(uint64_t), "not supported right now");
29+
static_assert(maxBit > 8 * sizeof(uint64_t), "not supported right now");
3030
}
3131
}
3232

0 commit comments

Comments
 (0)