29 using char_type = std::byte;
30 using int_type =
unsigned int;
35 static constexpr void assign(std::byte& r, std::byte
const& a)
noexcept
40 static constexpr bool eq(std::byte a, std::byte b)
noexcept
42 return static_cast<uint8_t
>(a) ==
static_cast<uint8_t
>(b);
45 static constexpr bool lt(std::byte a, std::byte b)
noexcept
47 return static_cast<uint8_t
>(a) <
static_cast<uint8_t
>(b);
50 static std::byte *assign(std::byte *p,
std::size_t count, char_type a)
noexcept
52 return static_cast<std::byte *
>(
std::memset(p,
static_cast<uint8_t
>(a), count));
55 static std::byte *move(std::byte *dest, std::byte
const *src,
std::size_t count)
noexcept
57 return static_cast<std::byte *
>(
std::memmove(dest, src, count));
60 static std::byte *copy(std::byte *dest, std::byte
const *src,
std::size_t count)
noexcept
62 return static_cast<std::byte *
>(
std::memcpy(dest, src, count));
65 static int compare(std::byte
const *a, std::byte
const *b,
std::size_t count)
noexcept
70 static std::size_t length(std::byte
const *s)
noexcept
72 return std::strlen(
reinterpret_cast<char const *
>(s));
75 static std::byte
const *find(std::byte
const *s,
std::size_t count, std::byte
const& ch)
noexcept
77 return static_cast<std::byte
const *
>(
std::memchr(
reinterpret_cast<char const *
>(s),
static_cast<uint8_t
>(ch), count));
80 static constexpr std::byte to_char_type(
unsigned int c)
noexcept
82 return static_cast<std::byte
>(
c);
85 static constexpr unsigned int to_int_type(std::byte
c)
noexcept
87 return static_cast<unsigned int>(
c);
90 static constexpr bool eq_int_type(
unsigned int c1,
unsigned int c2)
noexcept
95 static constexpr unsigned int eof()
noexcept
100 static constexpr unsigned int not_eof(
unsigned int e)
noexcept
102 return eq_int_type(e, eof()) ? 0 : e;