15 auto to_byte = [](
char c)->std::byte {
return static_cast<std::byte
>(c); };
17 constexpr auto mask0 = std::byte{0b10000000};
constexpr auto bit0 = std::byte{0b00000000};
18 constexpr auto mask1 = std::byte{0b11000000};
constexpr auto bit1 = std::byte{0b10000000};
19 constexpr auto mask2 = std::byte{0b11100000};
constexpr auto bit2 = std::byte{0b11000000};
20 constexpr auto mask3 = std::byte{0b11110000};
constexpr auto bit3 = std::byte{0b11100000};
21 constexpr auto mask4 = std::byte{0b11111000};
constexpr auto bit4 = std::byte{0b11110000};
23 unsigned int bits = 0;
24 std::vector<std::byte> buffer;
57 DIE(
"Implementation error?");
70 if(buffer.size() ==
bits)
77 ( std::to_integer<CodePointInt>(buffer[0] & ~
mask2) << 6) |
78 ( std::to_integer<CodePointInt>(buffer[1] & ~
mask1) << 0)
84 ( std::to_integer<CodePointInt>(buffer[0] & ~
mask3) << 12) |
85 ( std::to_integer<CodePointInt>(buffer[1] & ~
mask1) << 6 ) |
86 ( std::to_integer<CodePointInt>(buffer[2] & ~
mask1) << 0 )
92 ( std::to_integer<CodePointInt>(buffer[0] & ~
mask4) << 18) |
93 ( std::to_integer<CodePointInt>(buffer[1] & ~
mask1) << 12) |
94 ( std::to_integer<CodePointInt>(buffer[2] & ~
mask1) << 6 ) |
95 ( std::to_integer<CodePointInt>(buffer[3] & ~
mask1) << 0 )