pw::InlineBasicString is a fixed-capacity version of std::basic_string. In brief:
std::basic_string, but the capacity of the string is fixed at construction and cannot grow. Attempting to increase the size beyond the capacity triggers an assert.pw::InlineBasicString is efficient and compact. The current size and capacity are stored in a single word. Accessing its contents is a simple array access within the object, with no pointer indirection, even when working from a generic reference pw::InlineBasicString<T> where the capacity is not specified as a template argument. A string object can be used safely without the need to know its capacity.
See also pw::InlineString, which is an alias of pw::InlineBasicString<char> and is equivalent to std::string.
Public Member Functions | |
| constexpr | InlineBasicString (size_t count, T ch) |
| template<size_t kOtherCapacity> | |
| constexpr | InlineBasicString (const InlineBasicString< T, kOtherCapacity > &other, size_t index, size_t count=npos) |
| constexpr | InlineBasicString (const T *string, size_t count) |
| template<typename U , typename = string_impl::EnableIfNonArrayCharPointer<T, U>> | |
| constexpr | InlineBasicString (U c_string) |
| template<size_t kCharArraySize> | |
| constexpr | InlineBasicString (const T(&array)[kCharArraySize]) |
| template<typename Iterator , typename = containers::internal::EnableIfInputIterator<Iterator>> | |
| constexpr | InlineBasicString (Iterator start, Iterator finish) |
| constexpr | InlineBasicString (const InlineBasicString &)=default |
| template<size_t kOtherCapacity> | |
| constexpr | InlineBasicString (const InlineBasicString< T, kOtherCapacity > &other) |
| constexpr | InlineBasicString (std::initializer_list< T > list) |
| template<typename StringViewLike , string_impl::EnableIfStringViewLikeButNotStringView< T, StringViewLike > * = nullptr> | |
| constexpr | InlineBasicString (const StringViewLike &string) |
| template<typename StringView , std::enable_if_t< std::is_same< StringView, string_impl::View< T > >::value > * = nullptr> | |
| constexpr | InlineBasicString (const StringView &view) |
| template<typename StringView , typename = string_impl::EnableIfStringViewLike<T, StringView>> | |
| constexpr | InlineBasicString (const StringView &string, size_t index, size_t count) |
| InlineBasicString (std::nullptr_t)=delete | |
| constexpr InlineBasicString & | operator= (const InlineBasicString &other)=default |
| template<size_t kOtherCapacity> | |
| constexpr InlineBasicString & | operator= (const InlineBasicString< T, kOtherCapacity > &other) |
| template<size_t kCharArraySize> | |
| constexpr InlineBasicString & | operator= (const T(&array)[kCharArraySize]) |
| template<typename U , typename = string_impl::EnableIfNonArrayCharPointer<T, U>> | |
| constexpr InlineBasicString & | operator= (U c_string) |
| constexpr InlineBasicString & | operator= (T ch) |
| constexpr InlineBasicString & | operator= (std::initializer_list< T > list) |
| template<typename StringView , typename = string_impl::EnableIfStringViewLike<T, StringView>> | |
| constexpr InlineBasicString & | operator= (const StringView &string) |
| constexpr InlineBasicString & | operator= (std::nullptr_t)=delete |
| template<size_t kOtherCapacity> | |
| constexpr InlineBasicString & | operator+= (const InlineBasicString< T, kOtherCapacity > &string) |
| constexpr InlineBasicString & | operator+= (T character) |
| template<size_t kCharArraySize> | |
| constexpr InlineBasicString & | operator+= (const T(&array)[kCharArraySize]) |
| template<typename U , typename = string_impl::EnableIfNonArrayCharPointer<T, U>> | |
| constexpr InlineBasicString & | operator+= (U c_string) |
| constexpr InlineBasicString & | operator+= (std::initializer_list< T > list) |
| template<typename StringView , typename = string_impl::EnableIfStringViewLike<T, StringView>> | |
| constexpr InlineBasicString & | operator+= (const StringView &string) |
| constexpr pointer | data () |
| constexpr const_pointer | data () const |
| constexpr size_t | max_size () const noexcept |