6# pragma clang diagnostic push
7# pragma clang diagnostic ignored "-Wformat-nonliteral"
8# pragma clang diagnostic ignored "-Wold-style-cast"
10# pragma GCC diagnostic push
11# pragma GCC diagnostic ignored "-Wformat-nonliteral"
12# pragma GCC diagnostic ignored "-Wold-style-cast"
20 void * vptr = buf.
str;
21 size_t space = buf.
len;
22 char * ptr = (
char*) std::align(r.
alignment, r.len, vptr, space);
29 C4_CHECK(ptr >= buf.
begin() && ptr <= buf.
end());
30 size_t sz =
static_cast<size_t>(ptr - buf.
str) + r.len;
33 memcpy(ptr, r.buf, r.len);
41 C4_SUPPRESS_WARNING_GCC_WITH_PUSH(
"-Wcast-qual")
42 void * vptr = (
void*)buf.
str;
43 C4_SUPPRESS_WARNING_GCC_POP
44 size_t space = buf.
len;
45 char * ptr = (
char*) std::align(r->
alignment, r->len, vptr, space);
46 C4_CHECK(ptr !=
nullptr);
47 C4_CHECK(ptr >= buf.
begin() && ptr <= buf.
end());
48 C4_SUPPRESS_WARNING_GCC_PUSH
49 #if defined(__GNUC__) && __GNUC__ > 9
50 C4_SUPPRESS_WARNING_GCC(
"-Wanalyzer-null-argument")
52 memcpy(r->buf, ptr, r->len);
53 C4_SUPPRESS_WARNING_GCC_POP
61# pragma clang diagnostic pop
62#elif defined(__GNUC__)
63# pragma GCC diagnostic pop
bool from_chars(csubstr buf, uint8_t *v) noexcept
raw_wrapper_< cbyte > const_raw_wrapper
raw_wrapper_< byte > raw_wrapper
basic_substring< char > substr
a mutable string view
basic_substring< const char > csubstr
an immutable string view
size_t to_chars(substr buf, uint8_t v) noexcept
size_t len
the length of the substring
iterator begin() noexcept
C * str
a restricted pointer to the first character of the substring