#pragma once #include #include namespace clice { template struct fixed_string : std::array { template constexpr fixed_string(const char (&str)[M]) { for(std::size_t i = 0; i < N; ++i) { this->data()[i] = str[i]; } this->data()[N] = '\0'; } constexpr fixed_string(const char* str) { for(std::size_t i = 0; i < N; ++i) { this->data()[i] = str[i]; } this->data()[N] = '\0'; } constexpr auto size() const { return N; } constexpr operator std::string_view() const { return {this->data(), N}; } }; template fixed_string(const char (&)[M]) -> fixed_string; } // namespace clice