24template <std::
size_t N>
32 constexpr operator std::string_view()
const {
33 return std::string_view(
value, N - 1);
38 constexpr std::size_t
size()
const {
42 constexpr bool empty()
const {
return size() == 0; }
44 template <std::
size_t M>
46 return std::string_view(*
this) == std::string_view(other);
49 template <std::
size_t M>
51 return !(*
this == other);
56template <std::
size_t N>
58 return os << std::string_view(str);
63template <
char... Chars>
64constexpr auto operator""_fs() {
65 constexpr char str[] = {Chars...,
'\0'};
std::ostream & operator<<(std::ostream &os, const fixed_string< N > &str)
Compile-time string type that can be used as template non-type parameter in C++20.
constexpr const char * c_str() const
constexpr fixed_string(const char(&str)[N])
constexpr fixed_string(const fixed_string &)=default
constexpr bool operator==(const fixed_string< M > &other) const
constexpr bool empty() const
constexpr std::size_t size() const
constexpr bool operator!=(const fixed_string< M > &other) const