1#ifndef CODEX_BIT_PATTERN_H
2#define CODEX_BIT_PATTERN_H
11 template<std::
size_t N>
13 for(
const auto *
c = pattern; *
c; ++
c) {
19 case '1': this->
expected |= 1; [[fallthrough]];
20 case '0': this->
mask |= 1;
break;
21 default:
throw std::domain_error(
"invalid input");
26 constexpr bool matches(std::unsigned_integral
auto v)
Definition bit_pattern.hpp:9
std::uint64_t mask
Definition bit_pattern.hpp:29
consteval BitPattern(const char(&pattern)[N])
Definition bit_pattern.hpp:12
constexpr bool matches(std::unsigned_integral auto v)
Definition bit_pattern.hpp:26
std::uint64_t expected
Definition bit_pattern.hpp:29
char c[2][6]
Definition std2.c:4