[#mp_units-basic_fixed_string-08-2constructor-01] = xref:mp_units.adoc[mp_units]::xref:mp_units/basic_fixed_string-08.adoc[basic_fixed_string]::basic_fixed_string :relfileprefix: ../../ :mrdocs: Constructors == Synopses Declared in `<mp‐units/ext/fixed_string.h>` Copy constructor [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] constexpr xref:mp_units/basic_fixed_string-08/2constructor-08.adoc[basic_fixed_string](xref:mp_units/basic_fixed_string-08.adoc[basic_fixed_string] const& other) noexcept = default; ---- [.small]#xref:mp_units/basic_fixed_string-08/2constructor-08.adoc[_» more..._]# Constructs the string from a null‐terminated character array literal [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] consteval explicit(false) xref:mp_units/basic_fixed_string-08/2constructor-0f.adoc[basic_fixed_string](CharT const(& txt)[]) noexcept; ---- [.small]#xref:mp_units/basic_fixed_string-08/2constructor-0f.adoc[_» more..._]# Constructs the string from exactly `N` individual characters [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<std::same_as<CharT>... Chars> requires (sizeof...(Chars) == N) && (... && !std::is_pointer_v<Chars>) [[nodiscard]] constexpr explicit xref:mp_units/basic_fixed_string-08/2constructor-0b.adoc[basic_fixed_string](Chars... chars) noexcept; ---- [.small]#xref:mp_units/basic_fixed_string-08/2constructor-0b.adoc[_» more..._]# Constructs the string from an input range of exactly `N` characters [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<std::ranges::input_range R> requires std::same_as<std::ranges::range_value_t<R>, CharT> [[nodiscard]] constexpr xref:mp_units/basic_fixed_string-08/2constructor-0c.adoc[basic_fixed_string]( std::from_range_t from_range_tag, R&& r); ---- [.small]#xref:mp_units/basic_fixed_string-08/2constructor-0c.adoc[_» more..._]# Constructs the string from a range of exactly `N` characters given by an iterator/sentinel pair [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::input_iterator It, std::sentinel_for<It> S> requires std::same_as<std::iter_value_t<It>, CharT> [[nodiscard]] constexpr xref:mp_units/basic_fixed_string-08/2constructor-0e.adoc[basic_fixed_string]( It begin, S end); ---- [.small]#xref:mp_units/basic_fixed_string-08/2constructor-0e.adoc[_» more..._]# == Return Value [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | 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 |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#