mp_units::basic_fixed_string::basic_fixed_string

Constructors

Synopses

Declared in <mp-units/ext/fixed_string.h>

Copy constructor

[[nodiscard]]
constexpr
basic_fixed_string(basic_fixed_string const& other) noexcept = default;
» more...

Constructs the string from a null-terminated character array literal

[[nodiscard]]
consteval
explicit(false)
basic_fixed_string(CharT const(& txt)[]) noexcept;
» more...

Constructs the string from exactly N individual characters

template<std::same_as<CharT>... Chars>
requires (sizeof...(Chars) == N) && (... && !std::is_pointer_v<Chars>)
[[nodiscard]]
constexpr
explicit
basic_fixed_string(Chars... chars) noexcept;
» more...

Constructs the string from an input range of exactly N characters

template<std::ranges::input_range R>
requires std::same_as<std::ranges::range_value_t<R>, CharT>
[[nodiscard]]
constexpr
basic_fixed_string(
    std::from_range_t from_range_tag,
    R&& r);
» more...

Constructs the string from a range of exactly N characters given by an iterator/sentinel pair

template<
    std::input_iterator It,
    std::sentinel_for<It> S>
requires std::same_as<std::iter_value_t<It>, CharT>
[[nodiscard]]
constexpr
basic_fixed_string(
    It begin,
    S end);
» more...

Return Value

NOTE

The return value should not be discarded.

Parameters

NameDescription
otherThe string to copy from
txtThe character array literal to copy from; must be null-terminated at index N
charsThe characters to store, in order
from_range_tagTag disambiguating this overload as taking a range
rThe range of characters to copy from
beginIterator to the first character
endSentinel marking the end of the character sequence