We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
smallest_type_for
1 parent 3c1abf2 commit 1a88495Copy full SHA for 1a88495
src/panko/core/bitfield.hh
@@ -44,10 +44,9 @@ namespace Panko::core {
44
using type = T;
45
};
46
47
- /* BUG(aki): I have no idea *why* this is not working properly but alas */
48
template<std::size_t bits>
49
using smallest_type_for = std::tuple_element_t<
50
- ((bits + 7) / 8), std::tuple<
+ ((bits + 7U) / 8U) - 1U, std::tuple<
51
std::uint8_t, /* <= 1 byte */
52
std::uint16_t, /* <= 2 bytes */
53
std::uint32_t, /* <= 3 bytes */
0 commit comments