Constructors

Synopses

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

Copy constructor

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

Constructs the string from a null‐terminated character array literal

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

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;

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);

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);

Return Value

Note

The return value should not be discarded.

Parameters

Name

Description

other

The string to copy from

txt

The character array literal to copy from; must be null‐terminated at index N

chars

The characters to store, in order

from_range_tag

Tag disambiguating this overload as taking a range

r

The range of characters to copy from

begin

Iterator to the first character

end

Sentinel marking the end of the character sequence

Created with MrDocs