template struct FixedString

Overview

#include <fixed_string.h>

template <std::size_t N>
struct FixedString {
    // fields

    static constexpr auto Length = N;
    char m_data[N] {};

    // construction

    FixedString(const char(&) str[N]);
    FixedString(const FixedString<N>& str);

    template <class T>
    FixedString(T str);

    FixedString();

    // methods

    constexpr operator auto () const;
    constexpr operator int () const;
    constexpr operator std::string_view () const;
    constexpr operator std::string () const;
    constexpr const char* data() const;

    template <std::size_t M>
    constexpr bool compare(const char(&) other[M]) const;

    constexpr bool compare(const char*const str) const;
    constexpr bool compare(const std::string_view& str) const;
};

Detailed Documentation

Methods

constexpr operator int () const

This is only here so that the CLang LSP doesn’t complain about template parameter deduction. Remove once this is implemented.