Skip to content

File include/brisk/core/internal/FixedString.hpp


FixedString class (Internal::FixedString)

template <size_t N> FixedString

A compile-time fixed-size string class.

This class provides a way to work with fixed-size strings during compile-time. The string's size is determined at compile time, and it is stored in an array of characters.
Template param N The size of the string (not including the null terminator).

FixedString<N> function (Internal::FixedString::FixedString<N>)

constexpr FixedString(const char (&str)[N + 1])

Constructs a FixedString from a string literal.

This constructor takes a string literal and initializes the FixedString with its content. The size of the string must match the template parameter N.
Param str A string literal to initialize the FixedString.

constexpr explicit FixedString(const char *str, int dummy)

Constructs a FixedString from a pointer to a character array.

This constructor is explicit and allows initialization from a character pointer. The size of the string must still match the template parameter N.
Param str A pointer to a null-terminated character array.
Param dummy A dummy parameter to disambiguate this constructor.

string function (Internal::FixedString::string)

constexpr std::string_view string() const

Returns a string view of the FixedString content.

This function provides a view of the string content as a std::string_view.
Returns A std::string_view representing the string content.

content variable (Internal::FixedString::content)

std::array<char, N> content

The underlying storage for the string content.

operator<=> function (Internal::FixedString::operator<=>)

auto operator<=>(const FixedString &) const noexcept =
    default

Compares two FixedStrings for ordering.

This operator is defaulted to provide a three-way comparison based on the lexicographical order of the string contents.
Param other The other FixedString to compare against.
Returns A comparison result.


<deduction guide for FixedString> function (Internal::<deduction guide for FixedString>)

template <size_t N>
FixedString(const char (&)[N])->FixedString<N - 1>

Deduction guide for creating FixedString from string literals.

This deduction guide allows the compiler to automatically deduce the template parameter N when initializing a FixedString with a string literal.
Param str A string literal.


Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/