9 static constexpr int size() {
return 64; }
11 constexpr const char& operator[](
int i)
const {
return arr[i]; }
12 constexpr char& operator[](
int i) {
return arr[i]; }
14 friend constexpr small_string operator+(small_string lhs, small_string rhs)
16 bool past_lhs =
false;
18 for(
int i = 0; i < small_string::size(); i++)
23 for(
int k = 0; k < small_string::size(); k++)
25 if(i + k > small_string::size())
27 throw std::runtime_error(
"string too long");
37 template <std::
size_t N>
38 friend constexpr small_string operator+(small_string lhs,
const char (&rhs)[N])
40 bool past_lhs =
false;
42 for(
int i = 0; i < size(); i++)
46 if(i + N > small_string::size())
48 throw std::runtime_error(
"string too long");
51 for(
int k = 0; k < N; k++)
61constexpr small_string to_lower(std::string_view arr)
63 if(arr.size() > small_string::size())
64 throw std::runtime_error(
"string too long");
68 for(; i < arr.size(); i++)
71 if(in <=
'Z' && in >=
'A')
72 s[i] = in - (
'Z' -
'z');