#include <iostream>
#include <string_view>

#include "bitpat.h"

using namespace std;

namespace {

xstl::BitMatch32<string_view> bm = {
  {"0000????????????????????????0000", "this"},
  {"????????????????????????????1000", "that"},
  {"????????????????????????????????", "unknown"},
};

}  // namespace

int main(int argc, const char *argv[]) {
  constexpr xstl::BitPat32 bp = {"1???0100????11010000??10????????"};
  static_assert(bp == 0xb4ed02f8);
  static_assert(bp != 0x04ed02f8);
  cout << *bm.Find(0x02345670) << endl;
  cout << *bm.Find(0x12345678) << endl;
  cout << *bm.Find(0x90abcdef) << endl;
  return 0;
}
