30 using char_type = std::byte;
31 using int_type =
unsigned int;
36 constexpr static void assign(std::byte& r, std::byte
const& a)
noexcept
41 constexpr static bool eq(std::byte a, std::byte b)
noexcept
43 return static_cast<uint8_t
>(a) ==
static_cast<uint8_t
>(b);
46 constexpr static bool lt(std::byte a, std::byte b)
noexcept
48 return static_cast<uint8_t
>(a) <
static_cast<uint8_t
>(b);
51 static std::byte *assign(std::byte *p,
std::size_t count, char_type a)
noexcept
53 return static_cast<std::byte *
>(
std::memset(p,
static_cast<uint8_t
>(a), count));
56 static std::byte *move(std::byte *dest, std::byte
const *src,
std::size_t count)
noexcept
58 return static_cast<std::byte *
>(
std::memmove(dest, src, count));
61 static std::byte *copy(std::byte *dest, std::byte
const *src,
std::size_t count)
noexcept
63 return static_cast<std::byte *
>(
std::memcpy(dest, src, count));
66 static int compare(std::byte
const *a, std::byte
const *b,
std::size_t count)
noexcept
71 static std::size_t length(std::byte
const *s)
noexcept
73 return std::strlen(
reinterpret_cast<char const *
>(s));
76 static std::byte
const *find(std::byte
const *s,
std::size_t count, std::byte
const& ch)
noexcept
78 return static_cast<std::byte
const *
>(
std::memchr(
reinterpret_cast<char const *
>(s),
static_cast<uint8_t
>(ch), count));
81 constexpr static std::byte to_char_type(
unsigned int c)
noexcept
83 return static_cast<std::byte
>(c);
86 constexpr static unsigned int to_int_type(std::byte c)
noexcept
88 return static_cast<unsigned int>(c);
91 constexpr static bool eq_int_type(
unsigned int c1,
unsigned int c2)
noexcept
96 constexpr static unsigned int eof()
noexcept
101 constexpr static unsigned int not_eof(
unsigned int e)
noexcept
103 return eq_int_type(e, eof()) ? 0 : e;