20template <std::
size_t N>
32 for (std::size_t i = 0; i < N; ++i) {
37 [[nodiscard]]
constexpr std::string_view view() const noexcept {
38 return std::string_view{
static_cast<const char*
>(
value), N - 1};
41 [[nodiscard]]
constexpr operator std::string_view() const noexcept {
46 [[nodiscard]]
static constexpr std::size_t size() noexcept {
50 [[nodiscard]]
static constexpr bool empty() noexcept {
54 template <std::
size_t M>
55 [[nodiscard]]
constexpr bool operator==(
const FixedString<M>& other)
const noexcept {
56 if constexpr (M != N) {
59 for (std::size_t i = 0; i < N; ++i) {
60 if (
value[i] != other.value[i]) {
Compile-time fixed-size string usable as a non-type template parameter.
Definition fixed_string.hpp:21
char value[N]
Character storage, including the trailing null terminator.
Definition fixed_string.hpp:23
constexpr FixedString() noexcept=default
Default-constructs an all-‘’\0'string.