27 using char_type = std::byte;
28 using int_type =
unsigned int;
33 static constexpr void assign(std::byte& r, std::byte
const& a)
noexcept
38 static constexpr bool eq(std::byte a, std::byte b)
noexcept
40 return static_cast<uint8_t
>(a) ==
static_cast<uint8_t
>(b);
43 static constexpr bool lt(std::byte a, std::byte b)
noexcept
45 return static_cast<uint8_t
>(a) <
static_cast<uint8_t
>(b);
48 static std::byte *assign(std::byte *p,
std::size_t count, char_type a)
noexcept
50 return static_cast<std::byte *
>(
std::memset(p,
static_cast<uint8_t
>(a), count));
53 static std::byte *move(std::byte *dest, std::byte
const *src,
std::size_t count)
noexcept
55 return static_cast<std::byte *
>(
std::memmove(dest, src, count));
58 static std::byte *copy(std::byte *dest, std::byte
const *src,
std::size_t count)
noexcept
60 return static_cast<std::byte *
>(
std::memcpy(dest, src, count));
63 static int compare(std::byte
const *a, std::byte
const *b,
std::size_t count)
noexcept
68 static std::size_t length(std::byte
const *s)
noexcept
70 return std::strlen(
reinterpret_cast<char const *
>(s));
73 static std::byte
const *find(std::byte
const *s,
std::size_t count, std::byte
const& ch)
noexcept
75 return static_cast<std::byte
const *
>(
std::memchr(
reinterpret_cast<char const *
>(s),
static_cast<uint8_t
>(ch), count));
78 static constexpr std::byte to_char_type(
unsigned int c)
noexcept
80 return static_cast<std::byte
>(
c);
83 static constexpr unsigned int to_int_type(std::byte
c)
noexcept
85 return static_cast<unsigned int>(
c);
88 static constexpr bool eq_int_type(
unsigned int c1,
unsigned int c2)
noexcept
93 static constexpr unsigned int eof()
noexcept
98 static constexpr unsigned int not_eof(
unsigned int e)
noexcept
100 return eq_int_type(e, eof()) ? 0 : e;