25 static constexpr size_t
29 for (; val[res] !=
'\0'; ++res)
35 compare(
const char* lhs,
const char* rhs, std::size_t count)
37 for (
size_t pos = 0; pos < count; ++pos)
39 if (lhs[pos] != rhs[pos])
40 return lhs[pos] - rhs[pos];
46using string_view = std::basic_string_view<char, constexpr_char_traits>;
53 res = res.substr(res.find(start_pattern) + start_pattern.size());
54 res = res.substr(0, res.find_first_of(
";]"));
55 res = res.substr(res.rfind(
"::"));
59static_assert(
get() ==
get() );
61using std::u16string_view;
66 u16string_view res = u
"x::";
67 u16string_view start_pattern = u
"x";
68 res = res.substr(res.find(start_pattern) + start_pattern.size());
69 res = res.substr(0, res.find_first_of(u
";]"));
70 res = res.substr(res.rfind(u
"::"));
76using std::u32string_view;
81 u32string_view res = U
"x::";
82 u32string_view start_pattern = U
"x";
83 res = res.substr(res.find(start_pattern) + start_pattern.size());
84 res = res.substr(0, res.find_first_of(U
";]"));
85 res = res.substr(res.rfind(U
"::"));
constexpr string_view get()
constexpr u32string_view get32()
std::basic_string_view< char, constexpr_char_traits > string_view
constexpr u16string_view get16()
static constexpr size_t length(const char *val)
static constexpr int compare(const char *lhs, const char *rhs, std::size_t count)