Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::inline_string< MaxSize > Class Template Reference

A string type with a fixed maximum capacity, where the data is stored internally without allocations. More...

Inheritance diagram for arene::base::inline_string< MaxSize >:
Inheritance graph

Public Member Functions

constexpr inline_string () noexcept=default
 Default-construct an empty string.
 
template<std::size_t N>
constexpr inline_string (detail::character const (&str)[N]) noexcept
 Construct from the source string literal.
 
constexpr inline_string (detail::raw_c_string const str) noexcept
 Construct from the provided NUL-terminated string.
 
constexpr inline_string (inline_string &&)=default
 Default move construction.
 
constexpr inline_string (inline_string const &)=default
 Default copy construction.
 
template<size_type OtherMaxLength, constraints< std::enable_if_t<(OtherMaxLength<=MaxSize)> > = nullptr>
constexpr inline_string (inline_string< OtherMaxLength > const &other) noexcept
 Implicit conversion from another inline_string which can provably fit in this inline_string.
 
template<size_type OtherMaxLength, constraints< std::enable_if_t<(OtherMaxLength > MaxSize)>>
constexpr inline_string (inline_string< OtherMaxLength > const &other) noexcept
 Explicit conversion from another inline_string which cannot provably fit in this inline_string.
 
template<typename InputIterator, constraints< std::enable_if_t< is_input_iterator_v< InputIterator > > > = nullptr>
constexpr inline_string (InputIterator const first, InputIterator const last) noexcept(denotes_nothrow_iterable_range_v< InputIterator >)
 Construction from a sequence of characters represented as a pair of iterators.
 
constexpr inline_string (size_type len, detail::character chr) noexcept
 Construct a pre-filled inline_string of a given length.
 
constexpr inline_string (string_view const str) noexcept
 Construct from the provided string_view.
 
 ~inline_string ()=default
 Use the default destructor.
 
constexpr auto append (detail::character rhs) noexcept -> inline_string &
 Append a character to the current string.
 
constexpr auto append (detail::raw_c_string rhs, size_type count) noexcept -> inline_string &
 Append a string specified as pointer and length to the current string.
 
constexpr auto append (size_type count, detail::character chr) noexcept -> inline_string &
 Append the specified number of copies of a character to the string.
 
constexpr auto append (std::initializer_list< detail::character > rhs) noexcept -> inline_string &
 Append a series of characters from an initializer list to the string.
 
constexpr auto append (string_view rhs) noexcept -> inline_string &
 Append a string to the current string.
 
constexpr auto append (string_view rhs, size_type pos) noexcept -> inline_string &
 Append a substring of a string to the current string.
 
constexpr auto append (string_view rhs, size_type pos, size_type count) noexcept -> inline_string &
 Append a substring of a string to the current string.
 
constexpr auto assign (detail::character chr) noexcept -> inline_string &
 Assign from a single character.
 
constexpr auto assign (detail::raw_c_string str, size_type count) noexcept -> inline_string &
 Assign from a string specified as pointer and length to the current string.
 
constexpr auto assign (size_type count, detail::character chr) noexcept -> inline_string &
 Assign repeated copies of a single character.
 
constexpr auto assign (std::initializer_list< detail::character > str) noexcept -> inline_string &
 Assign from an initializer list of characters.
 
constexpr auto assign (string_view str) noexcept -> inline_string &
 Assign from a string_view.
 
constexpr auto assign (string_view str, size_type pos) noexcept -> inline_string &
 Assign from a string_view.
 
constexpr auto assign (string_view str, size_type pos, size_type count) noexcept -> inline_string &
 Assign from a substring of a string_view starting at the specified position, with the specified max length.
 
ARENE_NODISCARD constexpr auto back () const noexcept -> detail::character const &
 Get the last character in the string.
 
ARENE_NODISCARD constexpr auto back () noexcept -> detail::character &
 Get the last character in the string.
 
ARENE_NODISCARD constexpr auto begin () const noexcept -> const_iterator
 Iterator to the first position in the string.
 
ARENE_NODISCARD constexpr auto begin () noexcept -> iterator
 Iterator to the first position in the string.
 
ARENE_NODISCARD constexpr auto c_str () const noexcept -> detail::raw_c_string
 Return a pointer to the NUL-terminated string held in *this.
 
ARENE_NODISCARD constexpr auto cbegin () const noexcept -> const_iterator
 Iterator to the first position in the string.
 
ARENE_NODISCARD constexpr auto cend () const noexcept -> const_iterator
 Return an iterator to one-past-the-last position in the string.
 
constexpr void clear () noexcept
 Clear the string, so it is empty.
 
ARENE_NODISCARD constexpr auto compare (size_type pos, size_type count, string_view other) const noexcept -> integral_comparison_result
 Compare a substring against another string, to see if it is less than, equal to or greater than the other.
 
ARENE_NODISCARD constexpr auto compare (size_type pos, size_type count, string_view other, size_type pos2) const noexcept -> integral_comparison_result
 Compare a substring against a substring of another string, to see if it is less than, equal to or greater than the other.
 
ARENE_NODISCARD constexpr auto compare (size_type pos, size_type length1, detail::raw_c_string other, size_type length2) const noexcept -> integral_comparison_result
 Compare a substring against another string, to see if it is less than, equal to or greater than the other.
 
ARENE_NODISCARD constexpr auto compare (size_type pos, size_type length1, string_view other, size_type pos2, size_type length2) const noexcept -> integral_comparison_result
 Compare a substring against a substring of another string, to see if it is less than, equal to or greater than the other.
 
ARENE_NODISCARD constexpr auto compare (string_view other) const noexcept -> integral_comparison_result
 Compare against another string, to see if it is less than, equal to or greater than the other.
 
constexpr auto copy (detail::character *str, size_type count) const -> size_type
 Copy the string into the specified buffer up to the specified maximum length.
 
constexpr auto copy (detail::character *str, size_type count, size_type pos) const -> size_type
 Copy the substring starting at the specified position into the specified buffer up to the specified maximum length.
 
ARENE_NODISCARD auto crbegin () const noexcept -> const_reverse_iterator
 Return an iterator to the start of the reversed string.
 
ARENE_NODISCARD auto crend () const noexcept -> const_reverse_iterator
 Return an iterator to the end of the reversed string.
 
ARENE_NODISCARD constexpr auto data () const noexcept -> detail::raw_c_string
 Return a pointer to the NUL-terminated string held in *this.
 
ARENE_NODISCARD constexpr auto data () noexcept -> detail::character *
 Return a pointer to the NUL-terminated string held in *this.
 
ARENE_NODISCARD constexpr auto empty () const noexcept -> bool
 Check if the string is empty.
 
ARENE_NODISCARD constexpr auto end () const noexcept -> const_iterator
 Return an iterator to one-past-the-last position in the string.
 
ARENE_NODISCARD constexpr auto end () noexcept -> iterator
 The one-past-the-last position in the string.
 
ARENE_NODISCARD constexpr auto ends_with (detail::character chr) const noexcept -> bool
 Check if the string ends with a character.
 
ARENE_NODISCARD constexpr auto ends_with (string_view str) const noexcept -> bool
 Check if the string ends with another string.
 
constexpr auto erase () noexcept -> inline_string &
 Erase all the characters in the string.
 
constexpr auto erase (const_iterator first, const_iterator last) noexcept -> iterator
 Erase the characters in the specified range.
 
constexpr auto erase (const_iterator pos) noexcept -> iterator
 Erase the character at the specified range.
 
constexpr auto erase (size_type pos) -> inline_string &
 Erase characters from the string starting at the specified position to the end of the string.
 
constexpr auto erase (size_type pos, size_type count) noexcept -> inline_string &
 Erase the specified number of characters in the string starting at the specified position.
 
ARENE_NODISCARD constexpr auto find (detail::character chr) const noexcept -> size_type
 Find the earliest position of the specified character within the string.
 
ARENE_NODISCARD constexpr auto find (detail::character chr, size_type pos) const noexcept -> size_type
 Find the earliest position of the specified character within the string, starting at the specified position.
 
ARENE_NODISCARD constexpr auto find (detail::raw_c_string str) const noexcept -> size_type
 Find the earliest position of the given substring within the string.
 
ARENE_NODISCARD constexpr auto find (detail::raw_c_string str, size_type pos) const noexcept -> size_type
 Find the earliest position of the given substring within the string, starting at the specified position.
 
ARENE_NODISCARD constexpr auto find (detail::raw_c_string str, size_type pos, size_type count) const noexcept -> size_type
 Find the earliest position of the n character string starting at str within the string, starting at the specified position.
 
ARENE_NODISCARD constexpr auto find (string_view str, size_type pos=0U) const noexcept -> size_type
 Find the earliest position of the given substring within the string, starting at the specified position.
 
ARENE_NODISCARD constexpr auto find_first_not_of (detail::character chr) const noexcept -> size_type
 Find the earliest position such that the character at that position is the provided character.
 
ARENE_NODISCARD constexpr auto find_first_not_of (detail::character chr, size_type pos) const noexcept -> size_type
 Find the earliest position from the provided start position onwards such that the character at that position is not the provided character.
 
ARENE_NODISCARD constexpr auto find_first_not_of (detail::raw_c_string str) const noexcept -> size_type
 Find the earliest position such that the character at that position is not one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_first_not_of (detail::raw_c_string str, size_type pos) const noexcept -> size_type
 Find the earliest position from the provided start position onwards such that the character at that position is not one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_first_not_of (detail::raw_c_string str, size_type pos, size_type count) const noexcept -> size_type
 Find the earliest position from the provided start position onwards such that the character at that position is not one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_first_not_of (string_view str) const noexcept -> size_type
 Find the earliest position such that the character at that position is not one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_first_not_of (string_view str, size_type pos) const noexcept -> size_type
 Find the earliest position from the provided start position onwards such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_first_of (detail::character chr) const noexcept -> size_type
 Find the earliest position such that the character at that position is the provided character.
 
ARENE_NODISCARD constexpr auto find_first_of (detail::character chr, size_type pos) const noexcept -> size_type
 Find the earliest position from the provided start position onwards such that the character at that position is the provided character.
 
ARENE_NODISCARD constexpr auto find_first_of (detail::raw_c_string str) const noexcept -> size_type
 Find the earliest position such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_first_of (detail::raw_c_string str, size_type pos) const noexcept -> size_type
 Find the earliest position from the provided start position onwards such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_first_of (detail::raw_c_string str, size_type pos, size_type count) const noexcept -> size_type
 Find the earliest position from the provided start position onwards such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_first_of (string_view str) const noexcept -> size_type
 Find the earliest position such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_first_of (string_view str, size_type pos) const noexcept -> size_type
 Find the earliest position from the provided start position onwards such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_last_not_of (detail::character chr) const noexcept -> size_type
 Find the latest position such that the character at that position is not the provided character.
 
ARENE_NODISCARD constexpr auto find_last_not_of (detail::character chr, size_type pos) const noexcept -> size_type
 Find the latest position from the provided start position backwards such that the character at that position is not the provided character.
 
ARENE_NODISCARD constexpr auto find_last_not_of (detail::raw_c_string str) const noexcept -> size_type
 Find the latest position such that the character at that position is not one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_last_not_of (detail::raw_c_string str, size_type pos) const noexcept -> size_type
 Find the latest position from the provided start position backwards such that the character at that position is not one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_last_not_of (detail::raw_c_string str, size_type pos, size_type count) const noexcept -> size_type
 Find the latest position from the provided start position backwards such that the character at that position is not one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_last_not_of (string_view str) const noexcept -> size_type
 Find the latest position such that the character at that position is not one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_last_not_of (string_view str, size_type pos) const noexcept -> size_type
 Find the latest position from the provided start position backwards such that the character at that position is not one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_last_of (detail::character chr) const noexcept -> size_type
 Find the latest position such that the character at that position is the provided character.
 
ARENE_NODISCARD constexpr auto find_last_of (detail::character chr, size_type pos) const noexcept -> size_type
 Find the latest position from the provided start position backwards such that the character at that position is the provided character.
 
ARENE_NODISCARD constexpr auto find_last_of (detail::raw_c_string str) const noexcept -> size_type
 Find the last position such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_last_of (detail::raw_c_string str, size_type pos) const noexcept -> size_type
 Find the last position from the provided start position backwards such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_last_of (detail::raw_c_string str, size_type pos, size_type count) const noexcept -> size_type
 Find the latest position from the provided start position backwards such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_last_of (string_view str) const noexcept -> size_type
 Find the last position such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto find_last_of (string_view str, size_type pos) const noexcept -> size_type
 Find the last position from the provided start position backwards such that the character at that position is one of those in the provided string.
 
ARENE_NODISCARD constexpr auto front () const noexcept -> detail::character const &
 Get the first character in the string.
 
ARENE_NODISCARD constexpr auto front () noexcept -> detail::character &
 Get the first character in the string.
 
constexpr auto insert (const_iterator pos, detail::character chr) noexcept -> iterator
 Insert the specified character starting at position pos.
 
template<typename InputIterator, constraints< std::enable_if_t< base::is_input_iterator_v< InputIterator > > > = nullptr>
constexpr auto insert (const_iterator pos, InputIterator first, InputIterator last) noexcept(denotes_nothrow_iterable_range_v< InputIterator >) -> iterator
 Insert a series of characters from an iterator range into the string at the specified position.
 
constexpr auto insert (const_iterator pos, size_type count, detail::character chr) noexcept -> iterator
 Insert count copies of a character into the string at the specified position.
 
constexpr auto insert (const_iterator pos, std::initializer_list< detail::character > chars) noexcept -> iterator
 Insert a series of characters into the string at the specified position.
 
constexpr auto insert (size_type pos, detail::raw_c_string str, size_type count) noexcept -> inline_string &
 Insert the string of count characters starting at str at pos.
 
constexpr auto insert (size_type pos, size_type count, detail::character chr) noexcept -> inline_string &
 Insert count copies of the specified character starting at position pos.
 
constexpr auto insert (size_type pos, string_view str) noexcept -> inline_string &
 Insert the supplied string at the specified position.
 
constexpr auto insert (size_type pos1, string_view str, size_type pos2) noexcept -> inline_string &
 Insert the substring of the supplied string starting from pos2 at pos1.
 
constexpr auto insert (size_type pos1, string_view str, size_type pos2, size_type length2) noexcept -> inline_string &
 Insert the substring of the supplied string of max length length2 starting from pos2 at pos1.
 
ARENE_NODISCARD constexpr operator null_terminated_string_view () const noexcept
 Convert to null terminated string view.
 
ARENE_NODISCARD constexpr operator string_view () const noexcept
 Convert to string view.
 
constexpr auto operator+= (detail::character rhs) noexcept -> inline_string &
 Append a character to the current string.
 
constexpr auto operator+= (std::initializer_list< detail::character > rhs) noexcept -> inline_string &
 Append a series of characters from an initializer list to the string.
 
constexpr auto operator+= (string_view rhs) noexcept -> inline_string &
 Append a string to the current string.
 
constexpr auto operator= (detail::character chr) noexcept -> inline_string &
 Assign from a single character.
 
constexpr auto operator= (detail::raw_c_string str) noexcept -> inline_string &
 Assign from a nul-terminated string.
 
constexpr auto operator= (inline_string &&) -> inline_string &=default
 Default move assignment.
 
constexpr auto operator= (inline_string const &) -> inline_string &=default
 Default copy assignment.
 
template<std::size_t OtherMaxLength>
constexpr auto operator= (inline_string< OtherMaxLength > const &other) noexcept -> inline_string &
 Assign from another string.
 
constexpr auto operator= (std::initializer_list< detail::character > str) noexcept -> inline_string &
 Assign from an initializer list.
 
constexpr auto operator= (string_view str) noexcept -> inline_string &
 Assign from a string_view.
 
ARENE_NODISCARD constexpr auto operator[] (size_type index) const noexcept -> detail::character const &
 Retrieve the index -th character in the string.
 
ARENE_NODISCARD constexpr auto operator[] (size_type index) noexcept -> detail::character &
 Retrieve the index -th character in the string.
 
constexpr void pop_back () noexcept
 Remove the last character.
 
constexpr void push_back (detail::character rhs) noexcept
 Append a character to the current string.
 
ARENE_NODISCARD auto rbegin () const noexcept -> const_reverse_iterator
 Return an iterator to the start of the reversed string.
 
ARENE_NODISCARD constexpr auto rbegin () noexcept -> reverse_iterator
 Return an iterator to the start of the reversed string.
 
ARENE_NODISCARD auto rend () const noexcept -> const_reverse_iterator
 Return an iterator to the end of the reversed string.
 
ARENE_NODISCARD constexpr auto rend () noexcept -> reverse_iterator
 Return an iterator to the end of the reversed string.
 
constexpr auto replace (const_iterator first, const_iterator last, detail::raw_c_string str, size_type count) noexcept -> inline_string &
 Replace a substring with a c-string.
 
template<typename InputIterator, constraints< std::enable_if_t< base::is_input_iterator_v< InputIterator > >, std::enable_if_t<!base::is_random_access_iterator_v< InputIterator > > > = nullptr>
constexpr auto replace (const_iterator first, const_iterator last, InputIterator first2, InputIterator last2) noexcept(denotes_nothrow_iterable_range_v< InputIterator >) -> inline_string &
 Replace a substring with another substring.
 
template<typename RandomAccessIterator, constraints< std::enable_if_t< base::is_random_access_iterator_v< RandomAccessIterator > > > = nullptr>
constexpr auto replace (const_iterator first, const_iterator last, RandomAccessIterator first2, RandomAccessIterator last2) noexcept(denotes_nothrow_iterable_range_v< RandomAccessIterator >) -> inline_string &
 Replace a substring with another substring.
 
constexpr auto replace (const_iterator first, const_iterator last, size_type count, detail::character chr) noexcept -> inline_string &
 Replace a substring with repeated copies of a character.
 
constexpr auto replace (const_iterator first, const_iterator last, std::initializer_list< detail::character > chars) noexcept -> inline_string &
 Replace a substring with a sequence of characters.
 
constexpr auto replace (const_iterator first, const_iterator last, string_view str) noexcept -> inline_string &
 Replace a substring with another string.
 
constexpr auto replace (const_iterator first, const_iterator last, string_view str, size_type pos) noexcept -> inline_string &
 Replace a substring with another substring.
 
constexpr auto replace (const_iterator first, const_iterator last, string_view str, size_type pos, size_type count) noexcept -> inline_string &
 Replace a substring with another substring.
 
constexpr auto replace (size_type pos, size_type count, detail::raw_c_string str, size_type count2) noexcept -> inline_string &
 Replace a substring with a c-string.
 
constexpr auto replace (size_type pos, size_type count, size_type count2, detail::character chr) noexcept -> inline_string &
 Replace a substring with repeated copies of a given character.
 
constexpr auto replace (size_type pos, size_type count, string_view str) noexcept -> inline_string &
 Replace a substring with another string.
 
constexpr auto replace (size_type pos, size_type count, string_view str, size_type pos2) noexcept -> inline_string &
 Replace a substring with another substring.
 
constexpr auto replace (size_type pos, size_type count, string_view str, size_type pos2, size_type count2) noexcept -> inline_string &
 Replace a substring with another substring.
 
constexpr void resize (size_type new_size, detail::character new_char='\0') noexcept
 Resize the string. If the new size is larger than the old size, appending copies of new_char to make the string the required length.
 
ARENE_NODISCARD constexpr auto rfind (detail::character chr) const noexcept -> size_type
 Find the latest position of the specified character within the string.
 
ARENE_NODISCARD constexpr auto rfind (detail::character chr, size_type pos) const noexcept -> size_type
 Find the latest position of the specified character within the string, starting at the specified position.
 
ARENE_NODISCARD constexpr auto rfind (detail::raw_c_string str) const noexcept -> size_type
 Find the latest position of the given substring within the string.
 
ARENE_NODISCARD constexpr auto rfind (detail::raw_c_string str, size_type pos) const noexcept -> size_type
 Find the latest position of the given substring within the string, starting at the specified position.
 
ARENE_NODISCARD constexpr auto rfind (detail::raw_c_string str, size_type pos, size_type count) const noexcept -> size_type
 Find the latest position of the n character string starting at str within the string, starting at the specified position.
 
ARENE_NODISCARD constexpr auto rfind (string_view str) const noexcept -> size_type
 Find the latest position of the given substring within the string.
 
ARENE_NODISCARD constexpr auto rfind (string_view str, size_type pos) const noexcept -> size_type
 Find the latest position of the given substring within the string, starting at the specified position.
 
ARENE_NODISCARD constexpr auto starts_with (detail::character chr) const noexcept -> bool
 Check if the string starts with a character.
 
ARENE_NODISCARD constexpr auto starts_with (string_view str) const noexcept -> bool
 Check if the string starts with another string.
 
ARENE_NODISCARD constexpr auto substr () const noexcept -> inline_string
 Produce a copy of the string.
 
ARENE_NODISCARD constexpr auto substr (size_type pos) const noexcept -> inline_string
 Produce substring of the string starting at an offset.
 
ARENE_NODISCARD constexpr auto substr (size_type pos, size_type n) const noexcept -> inline_string
 Produce a substring of the string with an offset and length.
 

Static Public Member Functions

static constexpr auto capacity () -> std::size_t
 The maximum length of the string.
 
template<std::size_t OtherMaxLength>
static ARENE_NODISCARD constexpr auto fast_inequality_check (inline_string const &lhs, inline_string< OtherMaxLength > const &rhs) noexcept -> inequality_heuristic
 Determine if two strings are definitely not equal.
 
static ARENE_NODISCARD constexpr auto fast_inequality_check (inline_string const &lhs, string_view rhs) noexcept -> inequality_heuristic
 Determine if two strings are definitely not equal.
 
static constexpr auto max_size () -> std::size_t
 The maximum length of the string.
 
static ARENE_NODISCARD constexpr auto three_way_compare (inline_string const &lhs, detail::raw_c_string rhs) noexcept -> strong_ordering
 Compare two strings for lexicographical ordering.
 
template<std::size_t OtherMaxLength>
static ARENE_NODISCARD constexpr auto three_way_compare (inline_string const &lhs, inline_string< OtherMaxLength > const &rhs) noexcept -> strong_ordering
 Compare two strings for lexicographical ordering.
 
static ARENE_NODISCARD constexpr auto three_way_compare (inline_string const &lhs, null_terminated_string_view rhs) noexcept -> strong_ordering
 Compare two strings for lexicographical ordering.
 
static ARENE_NODISCARD constexpr auto three_way_compare (inline_string const &lhs, string_view rhs) noexcept -> strong_ordering
 Compare two strings for lexicographical ordering.
 
template<size_type OtherMaxSize, constraints< std::enable_if_t<(OtherMaxSize<=MaxSize)> > = nullptr>
static constexpr auto try_construct (inline_string< OtherMaxSize > const &str) noexcept -> optional< inline_string >
 Attempt to construct from another inline_string with a capacity that is less than or equal to the capacity of this.
 
template<size_type OtherMaxSize, constraints< std::enable_if_t<(OtherMaxSize > MaxSize)>>
static constexpr auto try_construct (inline_string< OtherMaxSize > const &str) noexcept -> optional< inline_string >
 Attempt to construct from another inline_string with a larger capacity.
 
template<typename InputIterator, constraints< std::enable_if_t< is_input_iterator_v< InputIterator > > > = nullptr>
static constexpr auto try_construct (InputIterator first, InputIterator last) noexcept(denotes_nothrow_iterable_range_v< InputIterator >) -> optional< inline_string >
 Attempt to construct from a sequence of characters.
 
static constexpr auto try_construct (string_view const str) noexcept -> optional< inline_string >
 Attempt to construct from a string_view .
 

Static Public Attributes

static constexpr size_type npos {string_view::npos}
 Special marker for element not in string.
 

Friends

template<std::size_t OtherMaxLength>
ARENE_NODISCARD friend constexpr auto operator+ (inline_string const &lhs, inline_string< OtherMaxLength > const &rhs) noexcept -> inline_string< MaxSize+OtherMaxLength >
 Concatenate two strings.
 
ARENE_NODISCARD friend constexpr auto operator+ (inline_string const &lhs, string_view const rhs) noexcept -> inline_string
 Concatenate two strings.
 
ARENE_NODISCARD friend constexpr auto operator+ (string_view const lhs, inline_string const &rhs) noexcept -> inline_string
 Concatenate two strings.
 

Detailed Description

template<std::size_t MaxSize>
class arene::base::inline_string< MaxSize >

A string type with a fixed maximum capacity, where the data is stored internally without allocations.

Template Parameters
MaxSizethe maximum capacity of the string, not including the null terminator. Must be non-zero, and less than std::numeric_limits<difference_type>::max()

Constructor & Destructor Documentation

◆ ~inline_string()

template<std::size_t MaxSize>
arene::base::inline_string< MaxSize >::~inline_string ( )
default

Use the default destructor.

◆ inline_string() [1/10]

template<std::size_t MaxSize>
arene::base::inline_string< MaxSize >::inline_string ( )
constexprdefaultnoexcept

Default-construct an empty string.

◆ inline_string() [2/10]

template<std::size_t MaxSize>
arene::base::inline_string< MaxSize >::inline_string ( inline_string< MaxSize > const & )
constexprdefault

Default copy construction.

◆ inline_string() [3/10]

template<std::size_t MaxSize>
arene::base::inline_string< MaxSize >::inline_string ( inline_string< MaxSize > && )
constexprdefault

Default move construction.

◆ inline_string() [4/10]

template<std::size_t MaxSize>
arene::base::inline_string< MaxSize >::inline_string ( detail::raw_c_string const str)
inlineexplicitconstexprnoexcept

Construct from the provided NUL-terminated string.

Parameters
strThe source string
Precondition
The length of str must be less than MaxLength , else ARENE_PRECONDITION violation.
str must point to a NUL-terminated string, else behavior is undefined.
Postcondition
size() is the length of str
The content of this string is equivalent to the content of str

◆ inline_string() [5/10]

template<std::size_t MaxSize>
template<std::size_t N>
arene::base::inline_string< MaxSize >::inline_string ( detail::character const (&) str[N])
inlineconstexprnoexcept

Construct from the source string literal.

Template Parameters
Nthe size of the source character array. Must be <=(MaxLength+1)
Parameters
strThe string to copy from
Precondition
str must have a NUL terminator somewhere in it
Postcondition
The content of this string compares equal to str

◆ inline_string() [6/10]

template<std::size_t MaxSize>
arene::base::inline_string< MaxSize >::inline_string ( string_view const str)
inlineexplicitconstexprnoexcept

Construct from the provided string_view.

Parameters
strThe source string
Precondition
The length of str must be less than MaxLength , else ARENE_PRECONDITION violation.
str must point to a NUL-terminated string, else behavior is undefined.
Postcondition
size() is the length of str
The content of this string is equivalent to the content of str

◆ inline_string() [7/10]

template<std::size_t MaxSize>
template<size_type OtherMaxLength, constraints< std::enable_if_t<(OtherMaxLength<=MaxSize)> > = nullptr>
arene::base::inline_string< MaxSize >::inline_string ( inline_string< OtherMaxLength > const & other)
inlineconstexprnoexcept

Implicit conversion from another inline_string which can provably fit in this inline_string.

Template Parameters
OtherMaxLengthThe length of the other string. Must be <= MaxLength
Parameters
otherThe other string
Postcondition
size()==other.size()
The content of this string is equivalent to the content of other

◆ inline_string() [8/10]

template<std::size_t MaxSize>
template<size_type OtherMaxLength, constraints< std::enable_if_t<(OtherMaxLength > MaxSize)>>
arene::base::inline_string< MaxSize >::inline_string ( inline_string< OtherMaxLength > const & other)
inlineexplicitconstexprnoexcept

Explicit conversion from another inline_string which cannot provably fit in this inline_string.

Template Parameters
OtherMaxLengthThe length of the other string
Parameters
otherThe other string
Precondition
other.size() is less than or equal to MaxLength else ARENE_PRECONDITION violation
Postcondition
size()==other.size()
The content of this string is equivalent to the content of other

◆ inline_string() [9/10]

template<std::size_t MaxSize>
arene::base::inline_string< MaxSize >::inline_string ( size_type len,
detail::character chr )
inlineconstexprnoexcept

Construct a pre-filled inline_string of a given length.

Parameters
lenThe length of the constructed string.
chrThe character to fill the string.
Precondition
len must be less than or equal to MaxLength , else ARENE_PRECONDITION violation.
Postcondition
size() is equal to len .
This string is filled with chr .

◆ inline_string() [10/10]

template<std::size_t MaxSize>
template<typename InputIterator, constraints< std::enable_if_t< is_input_iterator_v< InputIterator > > > = nullptr>
arene::base::inline_string< MaxSize >::inline_string ( InputIterator const first,
InputIterator const last )
inlineexplicitconstexprnoexcept

Construction from a sequence of characters represented as a pair of iterators.

Template Parameters
InputIteratorThe type of the iterators
Parameters
firstThe start of the iterator range
lastThe end of the iterator range
Precondition
std::distance(first,last)<=MaxSize else ARENE_PRECONDITION violation.

Member Function Documentation

◆ append() [1/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::append ( detail::character rhs) -> inline_string&
inlineconstexprnoexcept

Append a character to the current string.

Parameters
rhsThe character to append
Returns
inline_string& *this
Precondition
size()+1<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by 1
back()==rhs

◆ append() [2/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::append ( detail::raw_c_string rhs,
size_type count ) -> inline_string&
inlineconstexprnoexcept

Append a string specified as pointer and length to the current string.

Parameters
rhsThe start if the string to append
countThe number of characters in the string to append
Returns
inline_string& *this
Precondition
size()+count<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by count
The last count characters in the string are the count characters from rhs .

◆ append() [3/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::append ( size_type count,
detail::character chr ) -> inline_string&
inlineconstexprnoexcept

Append the specified number of copies of a character to the string.

Parameters
countThe number of characters to append
chrThe character to append
Returns
inline_string& *this
Precondition
size()+count<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by count
The last count characters in the string are chr .

◆ append() [4/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::append ( std::initializer_list< detail::character > rhs) -> inline_string&
inlineconstexprnoexcept

Append a series of characters from an initializer list to the string.

Parameters
rhsThe characters to append
Returns
inline_string& *this
Precondition
size()+rhs.size()<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by rhs.size()
The final characters in the string will be a substring equivalent to rhs .

◆ append() [5/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::append ( string_view rhs) -> inline_string&
inlineconstexprnoexcept

Append a string to the current string.

Parameters
rhsThe string to append
Returns
inline_string& *this
Precondition
size()+rhs.size()<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by rhs.size()
The final characters in the string will be a substring equivalent to rhs .

◆ append() [6/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::append ( string_view rhs,
size_type pos ) -> inline_string&
inlineconstexprnoexcept

Append a substring of a string to the current string.

Parameters
rhsThe string containing the substring to append
posThe offset into rhs of the substring to append
Returns
inline_string& *this
Precondition
size()+rhs.substr(pos).size()<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by rhs.substr(pos).size()
The final characters in the string will be a substring equivalent to rhs.substr(pos) .

◆ append() [7/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::append ( string_view rhs,
size_type pos,
size_type count ) -> inline_string&
inlineconstexprnoexcept

Append a substring of a string to the current string.

Parameters
rhsThe string containing the substring to append
posThe offset into rhs of the substring to append
countThe maximum length of the substring to append
Returns
inline_string& *this
Precondition
size()+rhs.substr(pos,count).size()<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by rhs.substr(pos,count).size()
The final characters in the string will be a substring equivalent to rhs.substr(pos,count) .

◆ assign() [1/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::assign ( detail::character chr) -> inline_string&
inlineconstexprnoexcept

Assign from a single character.

Parameters
chrThe source character
Returns
inline_string& *this
Postcondition
size() is 1
The content of this string is chr

◆ assign() [2/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::assign ( detail::raw_c_string str,
size_type count ) -> inline_string&
inlineconstexprnoexcept

Assign from a string specified as pointer and length to the current string.

Parameters
strThe start if the string to assign
countThe number of characters in the string to assign
Returns
inline_string& *this
Precondition
str must not be nullptr , else ARENE_PRECONDITION violation.
str must be a null-terminated string, else behavior is undefined.
count must be less than the length of str, else behavior is undefined.
The length of str must be less than MaxLength , else ARENE_PRECONDITION violation.
Postcondition
size() is the length of str
The content of this string is equivalent to the content of str

◆ assign() [3/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::assign ( size_type count,
detail::character chr ) -> inline_string&
inlineconstexprnoexcept

Assign repeated copies of a single character.

Parameters
countThe number of times to repeat the character
chrThe source character
Returns
inline_string& *this
Precondition
count<=MaxLength , else ARENE_PRECONDITION violation.

◆ assign() [4/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::assign ( std::initializer_list< detail::character > str) -> inline_string&
inlineconstexprnoexcept

Assign from an initializer list of characters.

Parameters
strThe source initializer list
Returns
inline_string& *this
Precondition
The length of str must be less than MaxLength , else ARENE_PRECONDITION violation.
Postcondition
size() is the length of str
The content of this string is equivalent to the content of str

◆ assign() [5/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::assign ( string_view str) -> inline_string&
inlineconstexprnoexcept

Assign from a string_view.

Parameters
strThe source string
Returns
inline_string& *this
Precondition
The length of str must be less than MaxLength , else ARENE_PRECONDITION violation.
Postcondition
size() is the length of str
The content of this string is equivalent to the content of str

◆ assign() [6/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::assign ( string_view str,
size_type pos ) -> inline_string&
inlineconstexprnoexcept

Assign from a string_view.

Parameters
strThe source string
posThe offset in str of the substring to assign
Returns
inline_string& *this
Precondition
str.substr(pos).size() must be less than MaxLength , else ARENE_PRECONDITION violation.
Postcondition
size() is str.substr(pos).size()
The content of this string is equivalent to the content of str.substr(pos)

◆ assign() [7/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::assign ( string_view str,
size_type pos,
size_type count ) -> inline_string&
inlineconstexprnoexcept

Assign from a substring of a string_view starting at the specified position, with the specified max length.

Parameters
strThe source string
posThe offset in str of the substring to assign
countThe maximum number of characters in the substring
Returns
inline_string& *this
Precondition
str.substr(pos,count).size() must be less than MaxLength , else ARENE_PRECONDITION violation.
Postcondition
size() is str.substr(pos).size()
The content of this string is equivalent to the content of str.substr(pos,count)

◆ back() [1/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::back ( ) const -> detail::character const&
inlineconstexprnoexcept

Get the last character in the string.

Returns
A reference to the last character
Precondition
size()>0 , else ARENE_PRECONDITION violation.

◆ back() [2/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::back ( ) -> detail::character&
inlineconstexprnoexcept

Get the last character in the string.

Returns
A reference to the last character
Precondition
size()>0 , else ARENE_PRECONDITION violation.

◆ begin() [1/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::begin ( ) const -> const_iterator
inlineconstexprnoexcept

Iterator to the first position in the string.

Returns
const_iterator An iterator to that refers to the first element if the string is not empty, or end() otherwise

◆ begin() [2/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::begin ( ) -> iterator
inlineconstexprnoexcept

Iterator to the first position in the string.

Returns
iterator An iterator to that refers to the first element if the string is not empty, or end() otherwise

◆ c_str()

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::c_str ( ) const -> detail::raw_c_string
inlineconstexprnoexcept

Return a pointer to the NUL-terminated string held in *this.

Returns
a pointer to the NUL-terminated string held in *this

◆ capacity()

template<std::size_t MaxSize>
static constexpr auto arene::base::inline_string< MaxSize >::capacity ( ) -> std::size_t
inlinestaticconstexpr

The maximum length of the string.

Returns
size_type MaxSize

◆ cbegin()

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::cbegin ( ) const -> const_iterator
inlineconstexprnoexcept

Iterator to the first position in the string.

Returns
const_iterator An iterator to that refers to the first element if the string is not empty, or end() otherwise

◆ cend()

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::cend ( ) const -> const_iterator
inlineconstexprnoexcept

Return an iterator to one-past-the-last position in the string.

Returns
const_iterator An iterator to that refers to one-past-the-last position in the string.

◆ clear()

template<std::size_t MaxSize>
void arene::base::inline_string< MaxSize >::clear ( )
inlineconstexprnoexcept

Clear the string, so it is empty.

Postcondition
size()==0 .
data()[0]=='\0' .

◆ compare() [1/5]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::compare ( size_type pos,
size_type count,
string_view other ) const -> integral_comparison_result
inlineconstexprnoexcept

Compare a substring against another string, to see if it is less than, equal to or greater than the other.

Parameters
posThe start of the substring to compare
countThe length of the substring to compare
otherThe other string
Returns
inline_string substr(pos,n).compare(other)

◆ compare() [2/5]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::compare ( size_type pos,
size_type count,
string_view other,
size_type pos2 ) const -> integral_comparison_result
inlineconstexprnoexcept

Compare a substring against a substring of another string, to see if it is less than, equal to or greater than the other.

Parameters
posThe start of the substring to compare
countThe length of the substring to compare
otherThe other string
pos2The start of the substring in the other string
Returns
inline_string compare(pos,n,other.substr(pos2))

◆ compare() [3/5]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::compare ( size_type pos,
size_type length1,
detail::raw_c_string other,
size_type length2 ) const -> integral_comparison_result
inlineconstexprnoexcept

Compare a substring against another string, to see if it is less than, equal to or greater than the other.

Parameters
posThe start of the substring to compare
length1The length of the substring to compare
otherThe start of the other string
length2The length of the other string
Returns
inline_string compare(pos,n,string_view{other,length2})

◆ compare() [4/5]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::compare ( size_type pos,
size_type length1,
string_view other,
size_type pos2,
size_type length2 ) const -> integral_comparison_result
inlineconstexprnoexcept

Compare a substring against a substring of another string, to see if it is less than, equal to or greater than the other.

Parameters
posThe start of the substring to compare
length1The length of the substring to compare
otherThe other string
pos2The start of the substring in the other string
length2The length of the substring in the other string
Returns
inline_string compare(pos,n,other.substr(pos2,length2))

◆ compare() [5/5]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::compare ( string_view other) const -> integral_comparison_result
inlineconstexprnoexcept

Compare against another string, to see if it is less than, equal to or greater than the other.

Parameters
otherThe other string
Returns
inline_string -1 if *this is less than other, 0 if they are equal, and 1 if *this is greater than other

◆ copy() [1/2]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::copy ( detail::character * str,
size_type count ) const -> size_type
inlineconstexpr

Copy the string into the specified buffer up to the specified maximum length.

Parameters
strA pointer to the target buffer
countThe maximum number of characters to copy
Returns
The number of characters copied
Precondition
str+n must be valid , else behavior is undefined.

◆ copy() [2/2]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::copy ( detail::character * str,
size_type count,
size_type pos ) const -> size_type
inlineconstexpr

Copy the substring starting at the specified position into the specified buffer up to the specified maximum length.

Parameters
strA pointer to the target buffer
countThe maximum number of characters to copy
posThe starting position to copy from. If >size() , no characters are copied.
Returns
The number of characters copied
Precondition
str[min(count,size()-pos)] must be valid , else behavior is undefined.

◆ crbegin()

template<std::size_t MaxSize>
ARENE_NODISCARD auto arene::base::inline_string< MaxSize >::crbegin ( ) const -> const_reverse_iterator
inlinenoexcept

Return an iterator to the start of the reversed string.

Returns
const_reverse_iterator An iterator equivalent to const_reverse_iterator(end())

◆ crend()

template<std::size_t MaxSize>
ARENE_NODISCARD auto arene::base::inline_string< MaxSize >::crend ( ) const -> const_reverse_iterator
inlinenoexcept

Return an iterator to the end of the reversed string.

Returns
const_reverse_iterator An iterator equivalent to const_reverse_iterator(begin())

◆ data() [1/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::data ( ) const -> detail::raw_c_string
inlineconstexprnoexcept

Return a pointer to the NUL-terminated string held in *this.

Returns
a pointer to the NUL-terminated string held in *this

◆ data() [2/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::data ( ) -> detail::character*
inlineconstexprnoexcept

Return a pointer to the NUL-terminated string held in *this.

Returns
a pointer to the NUL-terminated string held in *this

◆ empty()

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::empty ( ) const -> bool
inlineconstexprnoexcept

Check if the string is empty.

Returns
true If size()==0 .
false If size()!=0 .

◆ end() [1/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::end ( ) const -> const_iterator
inlineconstexprnoexcept

Return an iterator to one-past-the-last position in the string.

Returns
const_iterator An iterator to that refers to one-past-the-last position in the string.

◆ end() [2/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::end ( ) -> iterator
inlineconstexprnoexcept

The one-past-the-last position in the string.

Returns
iterator An iterator to that refers to one-past-the-last position in the string.

◆ ends_with() [1/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::ends_with ( detail::character chr) const -> bool
inlineconstexprnoexcept

Check if the string ends with a character.

Parameters
chrThe character to check
Returns
inline_string true if the string ends with the character, false otherwise

◆ ends_with() [2/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::ends_with ( string_view str) const -> bool
inlineconstexprnoexcept

Check if the string ends with another string.

Parameters
strThe string to check
Returns
inline_string true if the string ends with the string, false otherwise

◆ erase() [1/5]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::erase ( ) -> inline_string&
inlineconstexprnoexcept

Erase all the characters in the string.

Returns
inline_string& *this

◆ erase() [2/5]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::erase ( const_iterator first,
const_iterator last ) -> iterator
inlineconstexprnoexcept

Erase the characters in the specified range.

Precondition
first and last must form a valid iterator range into the current string
Parameters
firstThe start of the range
lastThe end of the range
Returns
An iterator referring to the character after the removed range, or end() if there is no such character

◆ erase() [3/5]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::erase ( const_iterator pos) -> iterator
inlineconstexprnoexcept

Erase the character at the specified range.

Precondition
pos must be a valid iterator into the current string
Parameters
posThe iterator referring to the character to erase
Returns
An iterator referring to the character after the removed range, or end() if there is no such character

◆ erase() [4/5]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::erase ( size_type pos) -> inline_string&
inlineconstexpr

Erase characters from the string starting at the specified position to the end of the string.

Parameters
posThe position of the first character to remove. If >=size() is a noop.
Returns
inline_string& *this
Postcondition
If pos<size() , size() is reduced by the difference between the original size() and pos .

◆ erase() [5/5]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::erase ( size_type pos,
size_type count ) -> inline_string&
inlineconstexprnoexcept

Erase the specified number of characters in the string starting at the specified position.

Parameters
posThe position of the characters to remove. If pos>=size() this is a noop.
countThe maximum number of characters to remove.
Returns
inline_string& *this
Postcondition
If pos<size() , then size() is reduced by min(count,size()-pos) .
If pos<size() , then the characters in the range [pos,min(size(),count+size())) are removed, and the characters in the range [min(size(),count+size()),size()) are moved to be located starting at pos .

◆ fast_inequality_check() [1/2]

template<std::size_t MaxSize>
template<std::size_t OtherMaxLength>
static ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::fast_inequality_check ( inline_string< MaxSize > const & lhs,
inline_string< OtherMaxLength > const & rhs ) -> inequality_heuristic
inlinestaticconstexprnoexcept

Determine if two strings are definitely not equal.

Template Parameters
OtherMaxLengthThe max length of the second string
Parameters
lhsThe first string
rhsThe second string
Returns
inequality_heuristic::definitely_not_equal If lhs.size()!=rhs.size() .
inequality_heuristic::may_be_equal_or_not_equal If lhs.size()==rhs.size() .

◆ fast_inequality_check() [2/2]

template<std::size_t MaxSize>
static ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::fast_inequality_check ( inline_string< MaxSize > const & lhs,
string_view rhs ) -> inequality_heuristic
inlinestaticconstexprnoexcept

Determine if two strings are definitely not equal.

Parameters
lhsThe first string
rhsThe second string
Returns
inequality_heuristic::definitely_not_equal If lhs.size()!=rhs.size() .
inequality_heuristic::may_be_equal_or_not_equal If lhs.size()==rhs.size() .

◆ find() [1/6]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find ( detail::character chr) const -> size_type
inlineconstexprnoexcept

Find the earliest position of the specified character within the string.

Parameters
chrThe character to search for
Returns
The position of that character, or npos if not found

◆ find() [2/6]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find ( detail::character chr,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the earliest position of the specified character within the string, starting at the specified position.

Parameters
chrThe character to search for
posThe lowest position to search from
Returns
The position of that character, or npos if not found

◆ find() [3/6]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find ( detail::raw_c_string str) const -> size_type
inlineconstexprnoexcept

Find the earliest position of the given substring within the string.

Parameters
strThe substring to search for
Returns
size_type The offset at which str can be found within the string, or npos if not found.

◆ find() [4/6]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find ( detail::raw_c_string str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the earliest position of the given substring within the string, starting at the specified position.

Parameters
strThe substring to search for
posThe lowest position to search from
Returns
size_type The offset at which str can be found within the string, or npos if not found.

◆ find() [5/6]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find ( detail::raw_c_string str,
size_type pos,
size_type count ) const -> size_type
inlineconstexprnoexcept

Find the earliest position of the n character string starting at str within the string, starting at the specified position.

Parameters
strThe start of the string to search for
posThe lowest position to search from
countThe length of the string to search for
Returns
size_type The offset at which str can be found within the string, or npos if not found.

◆ find() [6/6]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find ( string_view str,
size_type pos = 0U ) const -> size_type
inlineconstexprnoexcept

Find the earliest position of the given substring within the string, starting at the specified position.

Parameters
strThe substring to search for.
posThe lowest position to search from. Defaults to 0.
Returns
size_type The offset at which str can be found within the string, or npos if not found.

◆ find_first_not_of() [1/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_not_of ( detail::character chr) const -> size_type
inlineconstexprnoexcept

Find the earliest position such that the character at that position is the provided character.

Parameters
chrThe character to find
Returns
The offset of the first character not matching chr if there is one, otherwise npos

◆ find_first_not_of() [2/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_not_of ( detail::character chr,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the earliest position from the provided start position onwards such that the character at that position is not the provided character.

Parameters
chrThe character to find
posThe start position
Returns
The offset of the first character not matching chr after pos if there is one, otherwise npos

◆ find_first_not_of() [3/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_not_of ( detail::raw_c_string str) const -> size_type
inlineconstexprnoexcept

Find the earliest position such that the character at that position is not one of those in the provided string.

Parameters
strThe list of characters to find
Returns
The offset of the first character not in str if there is one, otherwise npos

◆ find_first_not_of() [4/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_not_of ( detail::raw_c_string str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the earliest position from the provided start position onwards such that the character at that position is not one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
Returns
The offset of the first character not in str after pos if there is one, otherwise npos

◆ find_first_not_of() [5/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_not_of ( detail::raw_c_string str,
size_type pos,
size_type count ) const -> size_type
inlineconstexprnoexcept

Find the earliest position from the provided start position onwards such that the character at that position is not one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
countThe number of characters in str
Returns
The offset of the first character not in str after pos if there is one, otherwise npos

◆ find_first_not_of() [6/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_not_of ( string_view str) const -> size_type
inlineconstexprnoexcept

Find the earliest position such that the character at that position is not one of those in the provided string.

Parameters
strThe list of characters to find
Returns
The offset of the first character not in str if there is one, otherwise npos

◆ find_first_not_of() [7/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_not_of ( string_view str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the earliest position from the provided start position onwards such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
Returns
The offset of the first character not in str after pos if there is one, otherwise npos

◆ find_first_of() [1/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_of ( detail::character chr) const -> size_type
inlineconstexprnoexcept

Find the earliest position such that the character at that position is the provided character.

Parameters
chrThe character to find
Returns
The offset of the first character matching chr if there is one, otherwise npos

◆ find_first_of() [2/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_of ( detail::character chr,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the earliest position from the provided start position onwards such that the character at that position is the provided character.

Parameters
chrThe character to find
posThe start position
Returns
The offset of the first character matching chr after pos if there is one, otherwise npos

◆ find_first_of() [3/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_of ( detail::raw_c_string str) const -> size_type
inlineconstexprnoexcept

Find the earliest position such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
Returns
The offset of the first character in str if there is one, otherwise npos

◆ find_first_of() [4/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_of ( detail::raw_c_string str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the earliest position from the provided start position onwards such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
Returns
The offset of the first character in str after pos if there is one, otherwise npos

◆ find_first_of() [5/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_of ( detail::raw_c_string str,
size_type pos,
size_type count ) const -> size_type
inlineconstexprnoexcept

Find the earliest position from the provided start position onwards such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
countThe number of characters in str
Returns
The offset of the first character in str after pos if there is one, otherwise npos

◆ find_first_of() [6/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_of ( string_view str) const -> size_type
inlineconstexprnoexcept

Find the earliest position such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
Returns
The offset of the first character in str if there is one, otherwise npos

◆ find_first_of() [7/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_first_of ( string_view str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the earliest position from the provided start position onwards such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
Returns
The offset of the first character in str after pos if there is one, otherwise npos

◆ find_last_not_of() [1/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_not_of ( detail::character chr) const -> size_type
inlineconstexprnoexcept

Find the latest position such that the character at that position is not the provided character.

Parameters
chrThe character to find
Returns
The offset of the last character not matching chr if there is one, otherwise npos

◆ find_last_not_of() [2/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_not_of ( detail::character chr,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the latest position from the provided start position backwards such that the character at that position is not the provided character.

Parameters
chrThe character to find
posThe start position
Returns
The offset of the last character not matching chr at or before pos if there is one, otherwise npos

◆ find_last_not_of() [3/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_not_of ( detail::raw_c_string str) const -> size_type
inlineconstexprnoexcept

Find the latest position such that the character at that position is not one of those in the provided string.

Parameters
strThe list of characters to find
Returns
The offset of the last character not in str if there is one, otherwise npos

◆ find_last_not_of() [4/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_not_of ( detail::raw_c_string str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the latest position from the provided start position backwards such that the character at that position is not one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
Returns
The offset of the last character not in str at or before pos if there is one, otherwise npos

◆ find_last_not_of() [5/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_not_of ( detail::raw_c_string str,
size_type pos,
size_type count ) const -> size_type
inlineconstexprnoexcept

Find the latest position from the provided start position backwards such that the character at that position is not one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
countThe number of characters in str
Returns
The offset of the last character not in str at or before pos if there is one, otherwise npos

◆ find_last_not_of() [6/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_not_of ( string_view str) const -> size_type
inlineconstexprnoexcept

Find the latest position such that the character at that position is not one of those in the provided string.

Parameters
strThe list of characters to find
Returns
The offset of the last character not in str if there is one, otherwise npos

◆ find_last_not_of() [7/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_not_of ( string_view str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the latest position from the provided start position backwards such that the character at that position is not one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
Returns
The offset of the last character not in str at or before pos if there is one, otherwise npos

◆ find_last_of() [1/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_of ( detail::character chr) const -> size_type
inlineconstexprnoexcept

Find the latest position such that the character at that position is the provided character.

Parameters
chrThe character to find
Returns
The offset of the last character matching chr if there is one, otherwise npos

◆ find_last_of() [2/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_of ( detail::character chr,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the latest position from the provided start position backwards such that the character at that position is the provided character.

Parameters
chrThe character to find
posThe start position
Returns
The offset of the last character matching chr at or before pos if there is one, otherwise npos

◆ find_last_of() [3/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_of ( detail::raw_c_string str) const -> size_type
inlineconstexprnoexcept

Find the last position such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
Returns
The offset of the last character in str if there is one, otherwise npos

◆ find_last_of() [4/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_of ( detail::raw_c_string str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the last position from the provided start position backwards such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
Returns
The offset of the last character matching the characters in str at or before pos if there is one, otherwise npos

◆ find_last_of() [5/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_of ( detail::raw_c_string str,
size_type pos,
size_type count ) const -> size_type
inlineconstexprnoexcept

Find the latest position from the provided start position backwards such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
countThe number of characters in str
Returns
The offset of the last character matching the characters in the first n characters of str at or before pos if there is one, otherwise npos

◆ find_last_of() [6/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_of ( string_view str) const -> size_type
inlineconstexprnoexcept

Find the last position such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
Returns
The offset of the last character matching those in str if there is one, otherwise npos

◆ find_last_of() [7/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::find_last_of ( string_view str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the last position from the provided start position backwards such that the character at that position is one of those in the provided string.

Parameters
strThe list of characters to find
posThe start position
Returns
The offset of the last character matching those in str before or at pos if there is one, otherwise npos

◆ front() [1/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::front ( ) const -> detail::character const&
inlineconstexprnoexcept

Get the first character in the string.

Returns
A reference to the first character
Precondition
size()>0 , else ARENE_PRECONDITION violation.

◆ front() [2/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::front ( ) -> detail::character&
inlineconstexprnoexcept

Get the first character in the string.

Returns
A reference to the first character
Precondition
size()>0 , else ARENE_PRECONDITION violation.

◆ insert() [1/9]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::insert ( const_iterator pos,
detail::character chr ) -> iterator
inlineconstexprnoexcept

Insert the specified character starting at position pos.

Parameters
posThe insertion position
chrThe character to insert
Returns
iterator An iterator referring to the inserted character
Precondition
pos must be a valid iterator into *this else behavior is undefined.
size()+1<max_size() , else ARENE_PRECONDITION violation.
Postcondition
size() is increased by 1 .
chr is inserted at pos

◆ insert() [2/9]

template<std::size_t MaxSize>
template<typename InputIterator, constraints< std::enable_if_t< base::is_input_iterator_v< InputIterator > > > = nullptr>
auto arene::base::inline_string< MaxSize >::insert ( const_iterator pos,
InputIterator first,
InputIterator last ) -> iterator
inlineconstexprnoexcept

Insert a series of characters from an iterator range into the string at the specified position.

Template Parameters
InputIteratorThe type of the input iterator.
Parameters
posAn iterator representing the position to insert
firstThe start of the input range
lastThe end of the input range
Returns
iterator An iterator referring to the start of the sequence of inserted characters.
Precondition
size()+std::distance(first,last)<=max_size() else ARENE_PRECONDITION violation.
pos must be a valid iterator into *this
InputIterator must be an input iterator
first and last must form a valid iterator range

◆ insert() [3/9]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::insert ( const_iterator pos,
size_type count,
detail::character chr ) -> iterator
inlineconstexprnoexcept

Insert count copies of a character into the string at the specified position.

Parameters
posAn iterator representing the position to insert
countThe number of times to insert the character
chrThe character to insert
Returns
iterator An iterator referring to the start of the sequence of inserted characters.
Precondition
pos must be a valid iterator into *this else behavior is undefined.
pos+count<max_size() , else ARENE_PRECONDITION violation.
Postcondition
size() is increased by count .
count copies of chr are inserted beginning at pos

◆ insert() [4/9]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::insert ( const_iterator pos,
std::initializer_list< detail::character > chars ) -> iterator
inlineconstexprnoexcept

Insert a series of characters into the string at the specified position.

Parameters
posAn iterator representing the position to insert
charsThe characters to insert
Returns
iterator An iterator referring to the start of the sequence of inserted characters.
Precondition
pos must be a valid iterator into *this else behavior is undefined.
pos+chars.size()<max_size() , else ARENE_PRECONDITION violation.
Postcondition
size() is increased by chars.size() .
chars are inserted beginning at pos

◆ insert() [5/9]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::insert ( size_type pos,
detail::raw_c_string str,
size_type count ) -> inline_string&
inlineconstexprnoexcept

Insert the string of count characters starting at str at pos.

Parameters
posThe insertion position
strThe start of the string to insert
countThe length of the string to insert
Returns
inline_string& *this
Precondition
pos<=size() else ARENE_PRECONDITION violation.
pos+count<max_size() , else ARENE_PRECONDITION violation.
str+count must be in the valid range of str else behavior is undefined.
Postcondition
size() is increased by count .
str is inserted at pos

◆ insert() [6/9]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::insert ( size_type pos,
size_type count,
detail::character chr ) -> inline_string&
inlineconstexprnoexcept

Insert count copies of the specified character starting at position pos.

Parameters
posThe insertion position
countThe number of times to insert the character
chrThe character to insert
Returns
inline_string& *this
Precondition
pos<=size() else ARENE_PRECONDITION violation.
pos+count<max_size() , else ARENE_PRECONDITION violation.
Postcondition
size() is increased by count .
count copies of chr are inserted beginning at pos

◆ insert() [7/9]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::insert ( size_type pos,
string_view str ) -> inline_string&
inlineconstexprnoexcept

Insert the supplied string at the specified position.

Parameters
posThe insertion position
strThe string to insert
Returns
inline_string& *this
Precondition
pos<=size() else ARENE_PRECONDITION violation.
pos+str.length()<max_size() , else ARENE_PRECONDITION violation.
Postcondition
size() is increased by str.size() .
str is inserted at pos

◆ insert() [8/9]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::insert ( size_type pos1,
string_view str,
size_type pos2 ) -> inline_string&
inlineconstexprnoexcept

Insert the substring of the supplied string starting from pos2 at pos1.

Parameters
pos1The insertion position
strThe string holding the substring to insert
pos2The position of the start of the substring to insert. If >=str.size(), this is a no-op.
Returns
inline_string& *this
Precondition
pos1<=size() else ARENE_PRECONDITION violation.
pos1+(str.length()-pos2)<max_size() , else ARENE_PRECONDITION violation.
Postcondition
size() is increased by (str.size()-pos2) .
The range [str.begin()+pos2,str.end()) is inserted at pos1

◆ insert() [9/9]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::insert ( size_type pos1,
string_view str,
size_type pos2,
size_type length2 ) -> inline_string&
inlineconstexprnoexcept

Insert the substring of the supplied string of max length length2 starting from pos2 at pos1.

Parameters
pos1The insertion position
strThe string holding the substring to insert
pos2The position of the start of the substring to insert. If >=str.size(), this is a no-op.
length2The maximum length of the substring to insert
Returns
inline_string& *this
Precondition
pos1<=size() else ARENE_PRECONDITION violation.
pos1+min(length2,str.size()-pos2)<max_size() , else ARENE_PRECONDITION violation.
Postcondition
size() is increased by min(length2,str.size()-pos2) .
The range [str.begin()+pos2,str.begin()+min(length2,str.size()-pos2)) is inserted at pos1

◆ max_size()

template<std::size_t MaxSize>
static constexpr auto arene::base::inline_string< MaxSize >::max_size ( ) -> std::size_t
inlinestaticconstexpr

The maximum length of the string.

Returns
size_type MaxSize

◆ operator null_terminated_string_view()

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr arene::base::inline_string< MaxSize >::operator null_terminated_string_view ( ) const
inlineconstexprnoexcept

Convert to null terminated string view.

Implicit conversion to null_terminated_string_view supports the use of null_terminated_string_view as a vocabulary type for accepting string parameters.

Returns
A null-terminated string view referring to the characters of *this

◆ operator string_view()

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr arene::base::inline_string< MaxSize >::operator string_view ( ) const
inlineconstexprnoexcept

Convert to string view.

Implicit conversion to string_view supports the use of string_view as a vocabulary type for accepting string parameters.

Returns
A string view referring to the characters of *this

◆ operator+=() [1/3]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::operator+= ( detail::character rhs) -> inline_string&
inlineconstexprnoexcept

Append a character to the current string.

Parameters
rhsThe character to append
Returns
inline_string& *this
Precondition
size()+1<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by 1
back()==rhs

◆ operator+=() [2/3]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::operator+= ( std::initializer_list< detail::character > rhs) -> inline_string&
inlineconstexprnoexcept

Append a series of characters from an initializer list to the string.

Parameters
rhsThe characters to append
Returns
inline_string& *this
Precondition
size()+rhs.size()<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by rhs.size()
The final characters in the string will be a substring equivalent to rhs .

◆ operator+=() [3/3]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::operator+= ( string_view rhs) -> inline_string&
inlineconstexprnoexcept

Append a string to the current string.

Parameters
rhsThe string to append
Returns
inline_string& *this
Precondition
size()+rhs.size()<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by rhs.size()
The final characters in the string will be a substring equivalent to rhs .

◆ operator=() [1/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::operator= ( detail::character chr) -> inline_string&
inlineconstexprnoexcept

Assign from a single character.

Parameters
chrThe source character
Returns
inline_string& *this
Postcondition
size() is 1
The content of this string is chr

◆ operator=() [2/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::operator= ( detail::raw_c_string str) -> inline_string&
inlineconstexprnoexcept

Assign from a nul-terminated string.

Parameters
strThe source string
Returns
inline_string& *this
Precondition
The length of str must be less than MaxLength , else ARENE_PRECONDITION violation.
str must point to a NUL-terminated string, else behavior is undefined.
Postcondition
size() is the length of str
The content of this string is equivalent to the content of str

◆ operator=() [3/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::operator= ( inline_string< MaxSize > && ) -> inline_string &=default
constexprdefault

Default move assignment.

Returns
A reference to *this

◆ operator=() [4/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::operator= ( inline_string< MaxSize > const & ) -> inline_string &=default
constexprdefault

Default copy assignment.

Returns
A reference to *this

◆ operator=() [5/7]

template<std::size_t MaxSize>
template<std::size_t OtherMaxLength>
auto arene::base::inline_string< MaxSize >::operator= ( inline_string< OtherMaxLength > const & other) -> inline_string&
inlineconstexprnoexcept

Assign from another string.

Template Parameters
OtherMaxLengththe max length of the other string
Parameters
otherThe source string
Returns
inline_string& *this
Precondition
other.size() is less than or equal to MaxLength else ARENE_PRECONDITION violation
Postcondition
size()==other.size()
The content of this string is equivalent to the content of other

◆ operator=() [6/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::operator= ( std::initializer_list< detail::character > str) -> inline_string&
inlineconstexprnoexcept

Assign from an initializer list.

Parameters
strThe source string
Returns
inline_string& *this
Precondition
The length of str must be less than MaxLength , else ARENE_PRECONDITION violation.
Postcondition
size() is the length of str
The content of this string is equivalent to the content of str

◆ operator=() [7/7]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::operator= ( string_view str) -> inline_string&
inlineconstexprnoexcept

Assign from a string_view.

Parameters
strThe source string
Returns
inline_string& *this
Precondition
The length of str must be less than MaxLength , else ARENE_PRECONDITION violation.
Postcondition
size() is the length of str
The content of this string is equivalent to the content of str

◆ operator[]() [1/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::operator[] ( size_type index) const -> detail::character const&
inlineconstexprnoexcept

Retrieve the index -th character in the string.

Parameters
indexThe index of the character to retrieve
Returns
A reference to that character
Precondition
index<=size() else ARENE_PRECONDITION violation.

◆ operator[]() [2/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::operator[] ( size_type index) -> detail::character&
inlineconstexprnoexcept

Retrieve the index -th character in the string.

Parameters
indexThe index of the character to retrieve
Returns
A reference to that character
Precondition
index<=size() else ARENE_PRECONDITION violation.
Warning
Setting index[size()] to anything other than 0 is undefined behaviour.

◆ pop_back()

template<std::size_t MaxSize>
void arene::base::inline_string< MaxSize >::pop_back ( )
inlineconstexprnoexcept

Remove the last character.

Postcondition
size() is reduced by 1.
Precondition
The string must not be empty, else ARENE_PRECONDITION violation.

◆ push_back()

template<std::size_t MaxSize>
void arene::base::inline_string< MaxSize >::push_back ( detail::character rhs)
inlineconstexprnoexcept

Append a character to the current string.

Parameters
rhsThe character to append
Precondition
size()+1<=max_size() else ARENE_PRECONDITION violation.
Postcondition
size() is increased by 1
back()==rhs

◆ rbegin() [1/2]

template<std::size_t MaxSize>
ARENE_NODISCARD auto arene::base::inline_string< MaxSize >::rbegin ( ) const -> const_reverse_iterator
inlinenoexcept

Return an iterator to the start of the reversed string.

Returns
const_reverse_iterator An iterator equivalent to const_reverse_iterator(end())

◆ rbegin() [2/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::rbegin ( ) -> reverse_iterator
inlineconstexprnoexcept

Return an iterator to the start of the reversed string.

Returns
reverse_iterator An iterator equivalent to reverse_iterator(end())

◆ rend() [1/2]

template<std::size_t MaxSize>
ARENE_NODISCARD auto arene::base::inline_string< MaxSize >::rend ( ) const -> const_reverse_iterator
inlinenoexcept

Return an iterator to the end of the reversed string.

Returns
const_reverse_iterator An iterator equivalent to const_reverse_iterator(begin())

◆ rend() [2/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::rend ( ) -> reverse_iterator
inlineconstexprnoexcept

Return an iterator to the end of the reversed string.

Returns
reverse_iterator An iterator equivalent to reverse_iterator(begin())

◆ replace() [1/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( const_iterator first,
const_iterator last,
detail::raw_c_string str,
size_type count ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with a c-string.

Parameters
firstThe start of the substring to replace.
lastThe end of the substring to replace
strThe string to replace the substring with
countThe count into str to cap the replacement.
Returns
inline_string& *this
Postcondition
The characters in the range [first,last) are replaced by the characters in the range [str+pos,str+count) .
If std::distance(first,last)<count , then the remaining characters from str are inserted at last , and size() will increase by the difference.
If std::distance(first,last)>count, then the remain characters from [first,last) are erased and size() will decrease by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
str+count must be in the valid range of str else behavior is undefined.
Let dist=std::distance(first,last) ; if dist<count, then size()+(count-dist)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [2/13]

template<std::size_t MaxSize>
template<typename InputIterator, constraints< std::enable_if_t< base::is_input_iterator_v< InputIterator > >, std::enable_if_t<!base::is_random_access_iterator_v< InputIterator > > > = nullptr>
auto arene::base::inline_string< MaxSize >::replace ( const_iterator first,
const_iterator last,
InputIterator first2,
InputIterator last2 ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with another substring.

Template Parameters
InputIteratorThe iterator type
Parameters
firstThe start of the substring to replace.
lastThe end of the substring to replace
first2The start of the substring to replace the substring with
last2The end of the substring to replace the substring with.
Returns
inline_string& *this
Postcondition
The characters in the range [first,last) are replaced by the characters in the range [first2,last2) .
If std::distance(first,last)<std::distance(first2,last2) , then the remaining characters from [first2,last2] are inserted at last , and size() will increase by the difference.
If std::distance(first,last)>std::distance(first2,last2), then the remain characters from [first,last) are erased and size() will decrease by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
Let dist=std::distance(first,last) and length=std::distance(first,last) ; if dist<length, then size()+(length-dist)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [3/13]

template<std::size_t MaxSize>
template<typename RandomAccessIterator, constraints< std::enable_if_t< base::is_random_access_iterator_v< RandomAccessIterator > > > = nullptr>
auto arene::base::inline_string< MaxSize >::replace ( const_iterator first,
const_iterator last,
RandomAccessIterator first2,
RandomAccessIterator last2 ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with another substring.

Template Parameters
RandomAccessIteratorThe iterator type
Parameters
firstThe start of the substring to replace.
lastThe end of the substring to replace
first2The start of the substring to replace the substring with
last2The end of the substring to replace the substring with.
Returns
inline_string& *this
Postcondition
The characters in the range [first,last) are replaced by the characters in the range [first2,last2) .
If std::distance(first,last)<std::distance(first2,last2) , then the remaining characters from [first2,last2] are inserted at last , and size() will increase by the difference.
If std::distance(first,last)>std::distance(first2,last2), then the remain characters from [first,last) are erased and size() will decrease by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
Let dist=std::distance(first,last) and length=std::distance(first,last) ; if dist<length, then size()+(length-dist)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [4/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( const_iterator first,
const_iterator last,
size_type count,
detail::character chr ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with repeated copies of a character.

Parameters
firstThe start of the substring to replace.
lastThe end of the substring to replace
countThe count into str to cap the replacement.
chrThe character to fill with.
Returns
inline_string& *this
Postcondition
The characters in the range [first,last) are replaced by count repeated copies of chr
If std::distance(first,last)<count , then the remaining characters are inserted at last , and size() will increase by the difference.
If std::distance(first,last)>count, then the remain characters from [first,last) are erased and size() will decrease by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
Let dist=std::distance(first,last) ; if dist<count, then size()+(count-dist)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [5/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( const_iterator first,
const_iterator last,
std::initializer_list< detail::character > chars ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with a sequence of characters.

Parameters
firstThe start of the substring to replace.
lastThe end of the substring to replace
charsthe sequence of characters to replace
Returns
inline_string& *this
Postcondition
The characters in the range [first,last) are replaced by the characters from chars
If std::distance(first,last)<chars.size() , then the remaining characters from chars are inserted at last , and size() will increase by the difference.
If std::distance(first,last)>chars.size(), then the remain characters from [first,last) are erased and size() will decrease by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
Let dist=std::distance(first,last) ; if dist<chars.size(), then size()+(str.size()-dist)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [6/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( const_iterator first,
const_iterator last,
string_view str ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with another string.

Parameters
firstThe start of the substring to replace.
lastThe end of the substring to replace
strThe string to replace the substring with
Returns
inline_string& *this
Postcondition
The characters in the range [first,last) are replaced by the characters in str .
If std::distance(first,last)<str.size() , then the remaining characters from str are inserted at last , and size() will increase by the difference.
If std::distance(first,last)>str.size(), then the remain characters from [first,last) are erased and size() will decrease by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
Let dist=std::distance(first,last) ; if dist<str.size(), then size()+(str.size()-dist)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [7/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( const_iterator first,
const_iterator last,
string_view str,
size_type pos ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with another substring.

Parameters
firstThe start of the substring to replace.
lastThe end of the substring to replace
strThe string to replace the substring with
posThe offset into str to start the replacement string. If pos>str.size() , this is a no-op.
Returns
inline_string& *this
Postcondition
The characters in the range [first,last) are replaced by the characters in the range [str.begin()+pos,str.end()) .
If std::distance(first,last)<(str.size()-pos) , then the remaining characters from str are inserted at last , and size() will increase by the difference.
If std::distance(first,last)>(str.size()-pos), then the remain characters from [first,last) are erased and size() will decrease by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
Let dist=std::distance(first,last) ; if dist<(str.size()-pos), then size()+(str.size()-pos-dist)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [8/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( const_iterator first,
const_iterator last,
string_view str,
size_type pos,
size_type count ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with another substring.

Parameters
firstThe start of the substring to replace.
lastThe end of the substring to replace
strThe string to replace the substring with
posThe offset into str to start the replacement string. If pos>str.size() , this is a no-op.
countThe count into str to cap the replacement.
Returns
inline_string& *this
Postcondition
The characters in the range [first,last) are replaced by the characters in the range [str.begin()+pos,str.begin()+std::min(str.size(),count)) .
If std::distance(first,last)<std::min(str.size()-pos,count) , then the remaining characters from str are inserted at last , and size() will increase by the difference.
If std::distance(first,last)>std::min(str.size()-pos,count), then the remain characters from [first,last) are erased and size() will decrease by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
Let dist=std::distance(first,last) and length=std::min(str.size()-pos,count) ; if dist<length, then size()+(length-dist)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [9/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( size_type pos,
size_type count,
detail::raw_c_string str,
size_type count2 ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with a c-string.

Parameters
posThe start of the substring to replace.
countThe length of the substring to replace
strThe string to replace the substring with
count2The count into str to cap the replacement.
Returns
inline_string& *this
Postcondition
The characters in the range [pos,std::min(pos+count,size())) are replaced by the characters in the range [str,str+count) .
If count<count2 , then the remaining characters from str are inserted at the position equivalent to pos+count .
If count<count2 , then size() will increase by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
str+count must be in the valid range of str else behavior is undefined.
If count<count2, then size()+(count2-count)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [10/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( size_type pos,
size_type count,
size_type count2,
detail::character chr ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with repeated copies of a given character.

Parameters
posThe start of the substring to replace.
countThe length of the substring to replace
count2The number of characters to fill.
chrThe character to fill with.
Returns
inline_string& *this
Postcondition
The characters in the range [pos,std::min(pos+count,size())) are replaced by count2 copies of chr
If count<count2 , then the remaining copies of chr are inserted at the position equivalent to pos+count , and size() will increase by the difference
If count>count2 , then the remaining characters in the replacement range will be erased, and size() will decrease by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
If count<count2, then size()+(count2-count)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [11/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( size_type pos,
size_type count,
string_view str ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with another string.

Parameters
posThe start of the substring to replace.
countThe length of the substring to replace
strThe string to replace the substring with
Returns
inline_string& *this
Postcondition
The characters in the range [pos,std::min(pos+count,size())) are replaced by the characters in str .
If count<str.size() , then the remaining characters from str are inserted at the position equivalent to pos+count .
If count<str.size(), then size() will increase by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
If count<str.size(), then size()+(str.size()-count)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [12/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( size_type pos,
size_type count,
string_view str,
size_type pos2 ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with another substring.

Parameters
posThe start of the substring to replace.
countThe length of the substring to replace
strThe string to replace the substring with
pos2The offset into str to start the replacement string. If pos2>str.size() , this is a no-op.
Returns
inline_string& *this
Postcondition
The characters in the range [pos,std::min(pos+count,size())) are replaced by the characters in the range [pos2,str.size()) .
If count<(str.size()-pos2) , then the remaining characters from str are inserted at the position equivalent to pos+count .
If count<(str.size()-pos2) , then size() will increase by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
If count<(str.size()-pos2), then size()+(str.size()-pos2-count)<=max_size() else ARENE_PRECONDITION violation.

◆ replace() [13/13]

template<std::size_t MaxSize>
auto arene::base::inline_string< MaxSize >::replace ( size_type pos,
size_type count,
string_view str,
size_type pos2,
size_type count2 ) -> inline_string&
inlineconstexprnoexcept

Replace a substring with another substring.

Parameters
posThe start of the substring to replace.
countThe length of the substring to replace
strThe string to replace the substring with
pos2The offset into str to start the replacement string. If pos2>str.size() , this is a no-op.
count2The count into str to cap the replacement.
Returns
inline_string& *this
Postcondition
The characters in the range [pos,std::min(pos+count,size())) are replaced by the characters in the range [pos2,std::min(count2,str.size())) .
If count<(std::min(count2,str.size())-pos2) , then the remaining characters from str are inserted at the position equivalent to pos+count .
If count<(std::min(count2,str.size())-pos2) , then size() will increase by the difference.
Precondition
pos<=size() else ARENE_PRECONDITION violation.
If count<(std::min(count2,str.size())-pos2), then size()+(str.size()-pos2-count)<=max_size() else ARENE_PRECONDITION violation.

◆ resize()

template<std::size_t MaxSize>
void arene::base::inline_string< MaxSize >::resize ( size_type new_size,
detail::character new_char = '\0' )
inlineconstexprnoexcept

Resize the string. If the new size is larger than the old size, appending copies of new_char to make the string the required length.

Parameters
new_sizeThe new size of the string
new_charThe character to append if extending the string. Defaults to '\0' .
Precondition
new_size<=max_size() else ARENE_PRECONDITION violation.

◆ rfind() [1/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::rfind ( detail::character chr) const -> size_type
inlineconstexprnoexcept

Find the latest position of the specified character within the string.

Parameters
chrThe character to search for
Returns
The position of that character, or npos if not found

◆ rfind() [2/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::rfind ( detail::character chr,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the latest position of the specified character within the string, starting at the specified position.

Parameters
chrThe character to search for
posThe highest position to search from
Returns
The position of that character, or npos if not found

◆ rfind() [3/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::rfind ( detail::raw_c_string str) const -> size_type
inlineconstexprnoexcept

Find the latest position of the given substring within the string.

Parameters
strThe substring to search for
Returns
size_type The offset at which str can be found within the string, or npos if not found.

◆ rfind() [4/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::rfind ( detail::raw_c_string str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the latest position of the given substring within the string, starting at the specified position.

Parameters
strThe substring to search for
posThe highest position to search from
Returns
size_type The offset at which str can be found within the string, or npos if not found.

◆ rfind() [5/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::rfind ( detail::raw_c_string str,
size_type pos,
size_type count ) const -> size_type
inlineconstexprnoexcept

Find the latest position of the n character string starting at str within the string, starting at the specified position.

Parameters
strThe start of the string to search for
posThe highest position to search from
countThe length of the string to search for
Returns
size_type The offset at which str can be found within the string, or npos if not found.

◆ rfind() [6/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::rfind ( string_view str) const -> size_type
inlineconstexprnoexcept

Find the latest position of the given substring within the string.

Parameters
strThe substring to search for
Returns
size_type The offset at which str can be found within the string, or npos if not found.

◆ rfind() [7/7]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::rfind ( string_view str,
size_type pos ) const -> size_type
inlineconstexprnoexcept

Find the latest position of the given substring within the string, starting at the specified position.

Parameters
strThe substring to search for
posThe highest position to search from
Returns
size_type The offset at which str can be found within the string, or npos if not found.

◆ starts_with() [1/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::starts_with ( detail::character chr) const -> bool
inlineconstexprnoexcept

Check if the string starts with a character.

Parameters
chrThe character to check
Returns
inline_string true if the string starts with the character, false otherwise

◆ starts_with() [2/2]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::starts_with ( string_view str) const -> bool
inlineconstexprnoexcept

Check if the string starts with another string.

Parameters
strThe string to check
Returns
inline_string true if the string starts with the string, false otherwise

◆ substr() [1/3]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::substr ( ) const -> inline_string
inlineconstexprnoexcept

Produce a copy of the string.

Returns
inline_string A copy of *this

◆ substr() [2/3]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::substr ( size_type pos) const -> inline_string
inlineconstexprnoexcept

Produce substring of the string starting at an offset.

Parameters
posThe start of the substring to return.
Returns
inline_string A new string holding the characters in the range [begin()+pos,end()) . If pos>=size() , returns an empty string.

◆ substr() [3/3]

template<std::size_t MaxSize>
ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::substr ( size_type pos,
size_type n ) const -> inline_string
inlineconstexprnoexcept

Produce a substring of the string with an offset and length.

Parameters
posThe start of the substring to return
nThe maximum number of characters to return
Returns
inline_string A new string holding the characters in the range [begin()+pos,begin()+std::min(size()-pos,count)) . If pos>=size() , returns an empty string.

◆ three_way_compare() [1/4]

template<std::size_t MaxSize>
static ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::three_way_compare ( inline_string< MaxSize > const & lhs,
detail::raw_c_string rhs ) -> strong_ordering
inlinestaticconstexprnoexcept

Compare two strings for lexicographical ordering.

Parameters
lhsThe first string
rhsThe second string
Returns
strong_ordering::equal If both strings have the same size() and equivalent characters.
strong_ordering::less If lhs is lexicographically before rhs .
strong_ordering::greater If lhs is lexicographically after rhs .

◆ three_way_compare() [2/4]

template<std::size_t MaxSize>
template<std::size_t OtherMaxLength>
static ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::three_way_compare ( inline_string< MaxSize > const & lhs,
inline_string< OtherMaxLength > const & rhs ) -> strong_ordering
inlinestaticconstexprnoexcept

Compare two strings for lexicographical ordering.

Template Parameters
OtherMaxLengthThe max length of the other string
Parameters
lhsThe first string
rhsThe second string
Returns
strong_ordering::equal If both strings have the same size() and equivalent characters.
strong_ordering::less If lhs is lexicographically before rhs .
strong_ordering::greater If lhs is lexicographically after rhs .

◆ three_way_compare() [3/4]

template<std::size_t MaxSize>
static ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::three_way_compare ( inline_string< MaxSize > const & lhs,
null_terminated_string_view rhs ) -> strong_ordering
inlinestaticconstexprnoexcept

Compare two strings for lexicographical ordering.

Parameters
lhsThe first string
rhsThe second string
Returns
strong_ordering::equal If both strings have the same size() and equivalent characters.
strong_ordering::less If lhs is lexicographically before rhs .
strong_ordering::greater If lhs is lexicographically after rhs .

◆ three_way_compare() [4/4]

template<std::size_t MaxSize>
static ARENE_NODISCARD constexpr auto arene::base::inline_string< MaxSize >::three_way_compare ( inline_string< MaxSize > const & lhs,
string_view rhs ) -> strong_ordering
inlinestaticconstexprnoexcept

Compare two strings for lexicographical ordering.

Parameters
lhsThe first string
rhsThe second string
Returns
strong_ordering::equal If both strings have the same size() and equivalent characters.
strong_ordering::less If lhs is lexicographically before rhs .
strong_ordering::greater If lhs is lexicographically after rhs .

◆ try_construct() [1/4]

template<std::size_t MaxSize>
template<size_type OtherMaxSize, constraints< std::enable_if_t<(OtherMaxSize<=MaxSize)> > = nullptr>
static constexpr auto arene::base::inline_string< MaxSize >::try_construct ( inline_string< OtherMaxSize > const & str) -> optional<inline_string>
inlinestaticconstexprnoexcept

Attempt to construct from another inline_string with a capacity that is less than or equal to the capacity of this.

Template Parameters
OtherMaxSizeThe capacity of the other string
Parameters
strThe source string.
Returns
If str.size()>MaxLength , a null optional, else an optional populated as if via inline_string{str} .

◆ try_construct() [2/4]

template<std::size_t MaxSize>
template<size_type OtherMaxSize, constraints< std::enable_if_t<(OtherMaxSize > MaxSize)>>
static constexpr auto arene::base::inline_string< MaxSize >::try_construct ( inline_string< OtherMaxSize > const & str) -> optional<inline_string>
inlinestaticconstexprnoexcept

Attempt to construct from another inline_string with a larger capacity.

Template Parameters
OtherMaxSizeThe capacity of the other string
Parameters
strThe source string.
Returns
If str.size()>MaxLength , a null optional, else an optional populated as if via inline_string{str} .

◆ try_construct() [3/4]

template<std::size_t MaxSize>
template<typename InputIterator, constraints< std::enable_if_t< is_input_iterator_v< InputIterator > > > = nullptr>
static constexpr auto arene::base::inline_string< MaxSize >::try_construct ( InputIterator first,
InputIterator last ) -> optional<inline_string>
inlinestaticconstexprnoexcept

Attempt to construct from a sequence of characters.

Parameters
firstAn iterator referring to the start of the source string
lastAn iterator referring to the end of the source string
Returns
optional<inline_string> If the length of the range is greater than MaxLength , a null optional, else an optional populated with the elements in the range [first,last) .

◆ try_construct() [4/4]

template<std::size_t MaxSize>
static constexpr auto arene::base::inline_string< MaxSize >::try_construct ( string_view const str) -> optional<inline_string>
inlinestaticconstexprnoexcept

Attempt to construct from a string_view .

Parameters
strThe source string.
Returns
optional<inline_string> If str.size()>MaxLength , a null optional, else an optional populated as if via inline_string{str} .

Friends And Related Symbol Documentation

◆ operator+ [1/3]

template<std::size_t MaxSize>
template<std::size_t OtherMaxLength>
ARENE_NODISCARD friend constexpr auto operator+ ( inline_string< MaxSize > const & lhs,
inline_string< OtherMaxLength > const & rhs ) -> inline_string<MaxSize + OtherMaxLength>
friend

Concatenate two strings.

Template Parameters
OtherMaxLengththe max length of rhs
Parameters
lhsThe first string to concatenate
rhsThe second string to concatenate
Returns
A inline_string<MaxLength+OtherMaxLength> holding the concatenation of the two strings.

◆ operator+ [2/3]

template<std::size_t MaxSize>
ARENE_NODISCARD friend constexpr auto operator+ ( inline_string< MaxSize > const & lhs,
string_view const rhs ) -> inline_string
friend

Concatenate two strings.

Parameters
lhsThe first string to concatenate
rhsThe second string to concatenate
Returns
inline_string holding the concatenation of the two strings.
Precondition
lhs.size()+rhs.size()<=lhs.max_size() else ARENE_PRECONDITION violation.

◆ operator+ [3/3]

template<std::size_t MaxSize>
ARENE_NODISCARD friend constexpr auto operator+ ( string_view const lhs,
inline_string< MaxSize > const & rhs ) -> inline_string
friend

Concatenate two strings.

Parameters
lhsThe first string to concatenate
rhsThe second string to concatenate
Returns
inline_string holding the concatenation of the two strings.
Precondition
lhs.size()+rhs.size()<=rhs.max_size() else ARENE_PRECONDITION violation.

Member Data Documentation

◆ npos

template<std::size_t MaxSize>
size_type arene::base::inline_string< MaxSize >::npos {string_view::npos}
staticconstexpr

Special marker for element not in string.


The documentation for this class was generated from the following file: