[#bsl-basic_string-0faf] = xref:bsl.adoc[bsl]::basic_string :relfileprefix: ../ :mrdocs: This class template provides an STL‐compliant `string` that conforms to the `bslma::Allocator` model. For the requirements of a string class, consult the second revision of the ISO/IEC 14882 Programming Language C++ (2003). Note that the (template parameter) `CHAR_TYPE` must be _equal_ to `ALLOCATOR::value_type`. In addition, this implementation offers strong exception guarantees (see below), with the general rules that: == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class CHAR_TYPE, class CHAR_TRAITS = char_traits<CHAR_TYPE>, class ALLOCATOR = xref:bsl/allocator-0df.adoc[allocator<CHAR_TYPE>]> class basic_string; ---- == Description 1. any method that would result in a string of length larger than the size returned by `max_size` throws `std::length_error`, and 2. any method that attempts to access a position outside the valid range of a string throws `std::out_of_range`. Circumstances where a method throws `bsl::length_error` (1) are clear and not repeated in the individual function‐level documentations below. More generally, this class supports an almost complete set of _in‐core_ _value_ _semantic_ operations, including copy construction, assignment, equality comparison (but excluding `ostream` printing since this component is below STL). A precise operational definition of when two objects have the same value can be found in the description of `operator==` for the class. This class is _exception_ _neutral_ with full guarantee of rollback: if an exception is thrown during the invocation of a method on a pre‐existing object, the object is left unchanged. In no event is memory leaked. Note that _aliasing_ (e.g., using all or part of an object as both source and destination) is supported in all cases in the public interface of `basic_string`. However, the private interface (`...Raw` methods) should be assumed to be not alias‐safe unless specifically noted otherwise. == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/basic_string-0faf/allocator_type.adoc[`allocator_type`] | Alias for the (template parameter) `ALLOCATOR` type. | xref:bsl/basic_string-0faf/const_iterator.adoc[`const_iterator`] | Alias for a constant iterator over the characters of this string. | xref:bsl/basic_string-0faf/const_pointer.adoc[`const_pointer`] | Alias for a constant pointer to the character type. | xref:bsl/basic_string-0faf/const_reference.adoc[`const_reference`] | Alias for a non‐modifiable reference to the character type. | xref:bsl/basic_string-0faf/const_reverse_iterator.adoc[`const_reverse_iterator`] | These types satisfy the `ReversibleSequence` requirements. | xref:bsl/basic_string-0faf/difference_type.adoc[`difference_type`] | This `typedef` is an alias to `AllocatorTraits::difference_type`. | xref:bsl/basic_string-0faf/iterator.adoc[`iterator`] | Alias for an iterator over the characters of this string. | xref:bsl/basic_string-0faf/pointer.adoc[`pointer`] | Alias for a pointer to the character type. | xref:bsl/basic_string-0faf/reference.adoc[`reference`] | Alias for a modifiable reference to the character type. | xref:bsl/basic_string-0faf/reverse_iterator.adoc[`reverse_iterator`] | Alias for a reverse iterator over the characters of this string. | xref:bsl/basic_string-0faf/size_type.adoc[`size_type`] | Alias for the size type of this string. | xref:bsl/basic_string-0faf/traits_type.adoc[`traits_type`] | Alias for the (template parameter) `CHAR_TRAITS` type. | xref:bsl/basic_string-0faf/value_type.adoc[`value_type`] | Alias for the character type stored in this string. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/basic_string-0faf/2constructor-0ec.adoc[`basic_string`] [.small]#[constructor]# | Constructors | xref:bsl/basic_string-0faf/2destructor.adoc[`~basic_string`] [.small]#[destructor]# | Destroy this string object. | xref:bsl/basic_string-0faf/operator_assign-00.adoc[`operator=`] | Assignment operators | xref:bsl/basic_string-0faf/append-0b.adoc[`append`] | `append` overloads | xref:bsl/basic_string-0faf/append_range.adoc[`append_range`] | Append to this string the characters from the specified `range`. Return a reference providing modifiable access to this string. Note that `range` must meet the requirements of an input range and the values from `range` must have a type matching or convertible to (template parameter) `CHAR_TYPE`. | xref:bsl/basic_string-0faf/assign-0ce.adoc[`assign`] | `assign` overloads | xref:bsl/basic_string-0faf/assign_range.adoc[`assign_range`] | Assign to this string the characters from the specified `range`. Return a reference providing modifiable access to this string. Note that `range` must meet the requirements of an input range and the values from `range` must have a type matching or convertible to (template parameter) `CHAR_TYPE`. | xref:bsl/basic_string-0faf/at-01.adoc[`at`] | `at` overloads | xref:bsl/basic_string-0faf/back-08.adoc[`back`] | `back` overloads | xref:bsl/basic_string-0faf/begin-0f.adoc[`begin`] | `begin` overloads | xref:bsl/basic_string-0faf/c_str.adoc[`c_str`] | Return an address providing non‐modifiable access to the null‐terminated buffer of `length() + 1` characters whose contents are identical to the value of this string. Note that any call to the string destructor or any of its manipulators invalidates the returned pointer. | xref:bsl/basic_string-0faf/capacity.adoc[`capacity`] | Return the capacity of this string, i.e., the maximum length for which resizing is guaranteed not to trigger a reallocation. | xref:bsl/basic_string-0faf/cbegin.adoc[`cbegin`] | Return an iterator providing non‐modifiable access to the first character of this string (or the past‐the‐end iterator if this string is empty). | xref:bsl/basic_string-0faf/cend.adoc[`cend`] | Return the past‐the‐end iterator for this string. | xref:bsl/basic_string-0faf/clear.adoc[`clear`] | Reset this string to an empty value. Note that the capacity may change (or not if `BASIC_STRING_DEALLOCATE_IN_CLEAR` is `false`). Note that the Standard doesn't allow to reduce capacity on `clear`. | xref:bsl/basic_string-0faf/compare-0f.adoc[`compare`] | `compare` overloads | xref:bsl/basic_string-0faf/contains-01.adoc[`contains`] | `contains` overloads | xref:bsl/basic_string-0faf/copy.adoc[`copy`] | Copy from this string, starting from the optionally specified `position`, the specified `numChars` or `length() ‐ position` characters, whichever is smaller, into the specified `characterString` buffer, and return the number of characters copied. If `position` is not specified, 0 is used. Throw `out_of_range` if `position > length()`. The behavior is undefined unless `characterString` is at least `numChars` long. Note that the output `characterString` is _not_ null‐terminated. | xref:bsl/basic_string-0faf/crbegin.adoc[`crbegin`] | Return a reverse iterator providing non‐modifiable access to the last character of this string (or the past‐the‐end reverse iterator if this string is empty). | xref:bsl/basic_string-0faf/crend.adoc[`crend`] | Return the past‐the‐end reverse iterator for this string. | xref:bsl/basic_string-0faf/data-00.adoc[`data`] | `data` overloads | xref:bsl/basic_string-0faf/empty.adoc[`empty`] | Return `true` if this string has length 0, and `false` otherwise. | xref:bsl/basic_string-0faf/end-04.adoc[`end`] | `end` overloads | xref:bsl/basic_string-0faf/ends_with-05.adoc[`ends_with`] | `ends_with` overloads | xref:bsl/basic_string-0faf/erase-04.adoc[`erase`] | `erase` overloads | xref:bsl/basic_string-0faf/find-0c8.adoc[`find`] | `find` overloads | xref:bsl/basic_string-0faf/find_first_not_of-06.adoc[`find_first_not_of`] | `find_first_not_of` overloads | xref:bsl/basic_string-0faf/find_first_of-0c.adoc[`find_first_of`] | `find_first_of` overloads | xref:bsl/basic_string-0faf/find_last_not_of-0a0.adoc[`find_last_not_of`] | `find_last_not_of` overloads | xref:bsl/basic_string-0faf/find_last_of-032.adoc[`find_last_of`] | `find_last_of` overloads | xref:bsl/basic_string-0faf/front-0b.adoc[`front`] | `front` overloads | xref:bsl/basic_string-0faf/get_allocator.adoc[`get_allocator`] | Return the allocator used by this string to supply memory. | xref:bsl/basic_string-0faf/insert-030.adoc[`insert`] | `insert` overloads | xref:bsl/basic_string-0faf/insert_range.adoc[`insert_range`] | Insert at the specified `position` in this string the characters from the specified `range` and return an iterator providing non‐modifiable access to the first inserted character, or a non‐`const` copy of `position` if `true == bsl::ranges.empty()`. The behavior is undefined unless `position` is an iterator in the range `[begin() .. end()]` (both endpoints included). Note that `range` must meet the requirements of an input range and the values from `range` must have a type matching or convertible to (template parameter) `CHAR_TYPE`> | xref:bsl/basic_string-0faf/length.adoc[`length`] | Return the length of this string. Note that this number may differ from `CHAR_TRAITS::length(c_str())` in case the string contains null characters. Also note that a null‐terminating character added by the `c_str` method is _not_ counted in this length. | xref:bsl/basic_string-0faf/max_size.adoc[`max_size`] | Return the maximal possible length of this string. Note that requests to create a string longer than this number of characters are guaranteed to raise a `length_error` exception. | xref:bsl/basic_string-0faf/operator_plus_eq-044.adoc[`operator+=`] | Addition assignment operators | xref:bsl/basic_string-0faf/operator_subs-0fc.adoc[`operator[]`] | Subscript operators | xref:bsl/basic_string-0faf/pop_back.adoc[`pop_back`] | Erase the last character from this string. The behavior is undefined if this string is empty. | xref:bsl/basic_string-0faf/push_back.adoc[`push_back`] | Append the specified `character` to this string. | xref:bsl/basic_string-0faf/rbegin-0ef.adoc[`rbegin`] | `rbegin` overloads | xref:bsl/basic_string-0faf/rend-02.adoc[`rend`] | `rend` overloads | xref:bsl/basic_string-0faf/replace-06.adoc[`replace`] | `replace` overloads | xref:bsl/basic_string-0faf/replace_with_range.adoc[`replace_with_range`] | Replace the substring in the range starting at the specified `first` position and ending right before the specified `last` position with the characters from the specified `range`. Return a reference providing modifiable access to this string. The behavior is undefined unless `first` and `last` are both within the range `[cbegin() .. cend()]`. Note that `range` must meet the requirements of an input range and the values from `range` must have a type matching or convertible to template parameter) `CHAR_TYPE`. | xref:bsl/basic_string-0faf/reserve.adoc[`reserve`] | Change the capacity of this string to the specified `newCapacity`. Note that the capacity of a string is the maximum length it can accommodate without reallocation. The actual storage allocated may be higher. | xref:bsl/basic_string-0faf/resize-01.adoc[`resize`] | `resize` overloads | xref:bsl/basic_string-0faf/resize_and_overwrite.adoc[`resize_and_overwrite`] | Change the length of this string to the specified `newLength`, erasing characters at the end if `newLength < length()` or appending the appropriate number of characters at the end if `length() < newLength`. Subsequently, invoke the specified `operation` passing the address of the null‐terminated buffer and the adjusted length of this string as parameters. Finally, change the length of this string to the value returned by the `operation`. Throw `length_error` if `newLength > max_size()`. The behavior is undefined unless the value returned by the `operation` is less than or equal to `newLength`. | xref:bsl/basic_string-0faf/rfind-0c.adoc[`rfind`] | `rfind` overloads | xref:bsl/basic_string-0faf/shrink_to_fit.adoc[`shrink_to_fit`] | Request the removal of unused capacity by causing reallocation. Note that this method has no effect if the capacity is equal to the size. Also note that if (and only if) reallocation occurs, all iterators, including the past the end iterator, and all references to the elements are invalidated. | xref:bsl/basic_string-0faf/size.adoc[`size`] | Return the length of this string. Note that this number may differ from `CHAR_TRAITS::length(c_str())` in case the string contains null characters. Also note that a null‐terminating character added by the `c_str` method is _not_ counted in this length. | xref:bsl/basic_string-0faf/starts_with-03.adoc[`starts_with`] | `starts_with` overloads | xref:bsl/basic_string-0faf/substr-0d8.adoc[`substr`] | `substr` overloads | xref:bsl/basic_string-0faf/swap.adoc[`swap`] | Exchange the value of this object with that of the specified `other` object; also exchange the allocator of this object with that of `other` if the (template parameter) type `ALLOCATOR` has the `propagate_on_container_swap` trait, and do not modify either allocator otherwise. This method provides the no‐throw exception‐safety guarantee. This operation has `O[1]` complexity if either this object was created with the same allocator as `other` or `ALLOCATOR` has the `propagate_on_container_swap` trait; otherwise, it has `O[n + m]` complexity, where `n` and `m` are the lengths of this object and `other`, respectively. Note that this method`s support for swapping objects created with different allocators when `ALLOCATOR` does not have the `propagate_on_container_swap` trait is a departure from the C++ Standard. | xref:bsl/basic_string-0faf/2conversion-00.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration<basic_string, IsBitwiseMoveable, BloombergLP::bslmf::IsBitwiseMoveable<ALLOCATOR>::value>`] | `CHAR_TYPE` is required to be a POD as per the Standard, which makes `CHAR_TYPE` bitwise‐movable, so `basic_string` is bitwise‐movable as long as the (template parameter) type `ALLOCATOR` is also bitwise‐movable. | xref:bsl/basic_string-0faf/2conversion-0f.adoc[`operator basic_string_view<CHAR_TYPE, CHAR_TRAITS>`] | Convert this object to a `string_view` type instantiated with the same character type and traits type. The return view will contain the same sequence of characters as this object. Note that this conversion operator can be invoked implicitly (e.g., during argument passing). | xref:bsl/basic_string-0faf/2conversion-04.adoc[`operator std::basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOC2>`] | Convert this object to a string type native to the compiler's library, instantiated with the same character type and traits type, but not necessarily the same allocator type. The return string will contain the same sequence of characters as `orig` and will have a default‐constructed allocator. Note that this conversion operator can be invoked implicitly (e.g., during argument passing). |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:bsl/basic_string-0faf/npos.adoc[`npos`] | Value used to denote "not‐a‐position", guaranteed to be outside the range `[0 .. max_size()]`. |=== == Specializations [cols="1"] |=== | Name | xref:bsl/basic_string-0fb.adoc[`basic_string<char>`] | xref:bsl/basic_string-0ce.adoc[`basic_string<char16_t>`] | xref:bsl/basic_string-0f3.adoc[`basic_string<char32_t>`] | xref:bsl/basic_string-01d.adoc[`basic_string<char8_t>`] | xref:bsl/basic_string-0e.adoc[`basic_string<wchar_t>`] |=== == Deduction Guides [cols="1,4"] |=== | Name| Description | xref:bsl/basic_string-016.adoc[`basic_string<CHAR_TYPE>`] | Deduce the template parameter `CHAR_TYPE` from the `value_type` of the `initializer_list` passed to the constructor of `basic_string`. This deduction guide does not participate unless the specified `ALLOC` is convertible to `bsl::allocator<CHAR_TYPE>`. | xref:bsl/basic_string-0c4.adoc[`basic_string<CHAR_TYPE>`] | Deduce the template parameter `CHAR_TYPE` from the parameters passed to the constructor of `basic_string`. This deduction guide does not participate unless the specified `ALLOC` is convertible to `bsl::allocator<CHAR_TYPE>`. | xref:bsl/basic_string-02.adoc[`basic_string<CHAR_TYPE>`] | Deduce the template parameter `CHAR_TYPE` from the `value_type` of the iterators passed to passed to the constructor of `basic_string`. This deduction guide does not participate unless the specified `ALLOC` is convertible to `bsl::allocator<CHAR_TYPE>`. | xref:bsl/basic_string-06.adoc[`basic_string<CHAR_TYPE>`] | Deduce the template parameter `CHAR_TYPE` from the parameters passed to the constructor of `basic_string`. This deduction guide does not participate unless the specified `ALLOC` is convertible to `bsl::allocator<CHAR_TYPE>`. | xref:bsl/basic_string-00.adoc[`basic_string<CHAR_TYPE>`] | Deduce the template parameter `CHAR_TYPE` from the parameters passed to the constructor of `basic_string`. This deduction guide does not participate unless the specified `ALLOC` is convertible to `bsl::allocator<CHAR_TYPE>`. | xref:bsl/basic_string-0fa9.adoc[`basic_string<CHAR_TYPE, CHAR_TRAITS>`] | Deduce the template parameters `CHAR_TYPE` and `TRAITS` from the corresponding template parameters of the `bsl::basic_string_view` passed to the constructor of `basic_string`. This deduction guide does not participate unless the specified `ALLOC` is convertible to `bsl::allocator<CHAR_TYPE>`. | xref:bsl/basic_string-0c7.adoc[`basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>`] | Deduce the template parameters `CHAR_TYPE` and `TRAITS` from the corresponding template parameters of the `bsl::basic_string_view` passed to the constructor of `basic_string`. Deduce the template parameter `ALLOCATOR` from the optional argument passed to the constructor. This deduction guide does not participate unless the specified `ALLOCATOR` meets the requirements of a standard allocator. | xref:bsl/basic_string-074.adoc[`basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>`] | Deduce the template parameters `CHAR_TYPE`, `TRAITS`, and `ALLOCATOR` from the corresponding template parameters of the `bsl::basic_string` passed to the constructor of `basic_string`. This deduction guide does not participate unless the specified `ALLOC` is convertible to `ALLOCATOR`. | xref:bsl/basic_string-09.adoc[`basic_string<CHAR_TYPE, CHAR_TRAITS, ALLOCATOR>`] | Deduce the template parameters `CHAR_TYPE`, `TRAITS`, and `ALLOCATOR` from the corresponding template parameters of the `bsl::basic_string` passed to the constructor of `basic_string`. This deduction guide does not participate unless the specified `ALLOC` is convertible to `ALLOCATOR`. | xref:bsl/basic_string-07a.adoc[`basic_string<CHAR_TYPE, char_traits<CHAR_TYPE>, ALLOCATOR>`] | Deduce the template parameter `CHAR_TYPE` from the `value_type` of the iterators passed to passed to the constructor of `basic_string`. Deduce the template parameter `ALLOCATOR` from the optional argument passed to the constructor. This deduction guide does not participate unless the specified `ALLOCATOR` meets the requirements of a standard allocator. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:bsl/String_ClearProctor.adoc[bsl::String_ClearProctor]` | This component private `class` implements a proctor that sets the length of a string to zero, and, if `release` is not called, will restore that string upon it's destruction. The intended usage is to implement `assign` methods in terms of `append` (by clearing the string before appending to it), while maintaining the strong exceptions guarantee. Note that after constructing this proctor for a string `s`, the invariant `s[s.length()]== CHAR_TYPE()` is violated for non‐empty `s`. This invariant will be restored by either a successful `append` or by the proctor's destructor if an exception is thrown. Note that the template parameter was renamed from STRING_TYPE to FULL_STRING_TYPE due to a name clash with a define elsewhere in the code base (see DRQS 112049582). | `xref:bsl/to_string-08.adoc[bsl::to_string]` | Constructs a string with contents equal to the specified `value`. The contents of the string will be the same as what `std::sprintf(buf, "%llu", value)` would produce with a sufficiently large buffer. | `xref:bsl/to_string-07.adoc[bsl::to_string]` | Constructs a string with contents equal to the specified `value`. The contents of the string will be the same as what `std::sprintf(buf, "%lu", value)` would produce with a sufficiently large buffer. | `xref:bsl/to_string-0c8.adoc[bsl::to_string]` | Constructs a string with contents equal to the specified `value`. The contents of the string will be the same as what `std::sprintf(buf, "%u", value)` would produce with a sufficiently large buffer. | `xref:bsl/to_string-03.adoc[bsl::to_string]` | Constructs a string with contents equal to the specified `value`. The contents of the string will be the same as what `std::sprintf(buf, "%lld", value)` would produce with a sufficiently large buffer. | `xref:bsl/to_string-09.adoc[bsl::to_string]` | Constructs a string with contents equal to the specified `value`. The contents of the string will be the same as what `std::sprintf(buf, "%ld", value)` would produce with a sufficiently large buffer. | `xref:bsl/to_string-0c7.adoc[bsl::to_string]` | `to_string` functions are made friends to allow access to the internal short string buffer. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/erase-07.adoc[`erase`] | Erase (in‐place) all the elements from the specified `str` that compare equal to the specified `c`, and return the number of erased elements. | xref:bsl/erase_if-0e.adoc[`erase_if`] | Erase (in‐place) all the elements from the specified `str` where the specified `pred` returns `true`, and return the number of erased elements. | xref:bsl/hashBasicString-0d.adoc[`hashBasicString`] | Return a hash value for the specified `str`. | xref:bsl/operator_plus-014.adoc[`operator+`] | Same as the primary `operator+` with a C‐string `lhs`. | xref:bsl/operator_plus-01b.adoc[`operator+`] | Same as the primary `operator+` with a C‐string `rhs`. | xref:bsl/operator_plus-02.adoc[`operator+`] | Same as the primary `operator+` with a single `CHAR_TYPE` `rhs` and rvalue `lhs`. | xref:bsl/operator_plus-03.adoc[`operator+`] | Same as the primary `operator+` with an rvalue `lhs` C‐string. | xref:bsl/operator_plus-04.adoc[`operator+`] | Same as the primary `operator+` overload with an rvalue `lhs`. | xref:bsl/operator_plus-062.adoc[`operator+`] | Same as the primary `operator+` with a string‐view‐like `lhs` and string `rhs`. | xref:bsl/operator_plus-064.adoc[`operator+`] | Same as the primary `operator+` with a C‐string `rhs` and rvalue `lhs`. | xref:bsl/operator_plus-06c.adoc[`operator+`] | Return the concatenation of strings constructed from the specified `lhs` and `rhs` arguments, i.e., `basic_string(lhs).append(rhs)`. The allocator of the returned string is determined per the rules in P1165 (https://www.open‐std.org/jtc1/sc22/wg21/docs/papers/2018/p1165r1.html). Note that overloads that accept rvalue references are implemented for C++11 and later only. | xref:bsl/operator_plus-06e.adoc[`operator+`] | Same as the primary `operator+` with a C‐string `rhs`. | xref:bsl/operator_plus-07.adoc[`operator+`] | Same as the primary `operator+` with an rvalue `lhs` and C‐string `rhs`. | xref:bsl/operator_plus-08.adoc[`operator+`] | Same as the primary `operator+` for mixed `std`/`bsl` strings with an rvalue `rhs`. | xref:bsl/operator_plus-09.adoc[`operator+`] | Same as the primary `operator+` overload with an rvalue `lhs` and lvalue `rhs`. | xref:bsl/operator_plus-0a.adoc[`operator+`] | Same as the primary `operator+` for mixed `bsl`/`std` strings. | xref:bsl/operator_plus-0b.adoc[`operator+`] | Same as the primary `operator+` with a single `CHAR_TYPE` `lhs` and rvalue `rhs`. | xref:bsl/operator_plus-0c9.adoc[`operator+`] | Same as the primary `operator+` with C‐string operands. | xref:bsl/operator_plus-0cd.adoc[`operator+`] | Same as the primary `operator+` overload with an rvalue `lhs`. | xref:bsl/operator_plus-0d8.adoc[`operator+`] | Same as the primary `operator+` with a C‐string `lhs` and rvalue `rhs`. | xref:bsl/operator_plus-0dd.adoc[`operator+`] | Same as the primary `operator+` for mixed `bsl`/`std` strings. | xref:bsl/operator_plus-0e1.adoc[`operator+`] | Same as the primary `operator+` with a C‐string `rhs` and rvalue `lhs`. | xref:bsl/operator_plus-0e3.adoc[`operator+`] | Same as the primary `operator+` for mixed `std`/`bsl` strings. | xref:bsl/operator_3way-041c.adoc[`operator<=>`] | Perform a lexicographic three‐way comparison of the specified `lhs` and the specified `rhs` strings by using `CHAR_TRAITS::eq` on each character; return the result of that comparison. | xref:bsl/operator_3way-07c1.adoc[`operator<=>`] | Perform a lexicographic three‐way comparison of the specified `lhs` and the specified `rhs` strings by using `CHAR_TRAITS::eq` on each character; return the result of that comparison. | xref:bsl/operator_3way-0d7.adoc[`operator<=>`] | Perform a lexicographic three‐way comparison of the specified `lhs` string and the specified `rhs` C‐string by using `CHAR_TRAITS::eq` on each character; return the result of that comparison. | xref:bsl/operator_eq-02e.adoc[`operator==`] | Return `true` if the specified `lhs` string has the same value as the specified `rhs` string, and `false` otherwise. Two strings have the same value if they have the same length, and the characters at each respective position have the same value according to `CHAR_TRAITS::eq`. | xref:bsl/operator_eq-052.adoc[`operator==`] | Same as the two‐argument `operator==` for `basic_string`. | xref:bsl/operator_eq-0c0.adoc[`operator==`] | Same as the two‐argument `operator==` for mixed `bsl`/`std` strings. | xref:bsl/quoted-03.adoc[`quoted`] | Return an object, containing quoted version of the specified `value` obtained using the optionally specified `delim` and `escape` characters, and that can be inserted to output stream. Return an object, containing quoted version of the specified `value` obtained using the optionally specified `delim` and `escape` characters, and that can be inserted to output stream. | xref:bsl/quoted-0c.adoc[`quoted`] | Return an object, containing quoted version of the specified `value` obtained using the optionally specified `delim` and `escape` characters, and that can be inserted to output (or extracted from input) stream. Return an object, containing quoted version of the specified `value` obtained using the optionally specified `delim` and `escape` characters, and that can be inserted to output (or extracted from input) stream. | xref:bsl/swap-0eb7.adoc[`swap`] | Exchange the value of the specified `a` object with that of the specified `b` object; also exchange the allocator of `a` with that of `b` if the (template parameter) type `ALLOCATOR` has the `propagate_on_container_swap` trait, and do not modify either allocator otherwise. This function provides the no‐throw exception‐safety guarantee. This operation has `O[1]` complexity if either `a` was created with the same allocator as `b` or `ALLOCATOR` has the `propagate_on_container_swap` trait; otherwise, it has `O[n + m]` complexity, where `n` and `m` are the lengths of `a` and `b`, respectively. Note that this function`s support for swapping objects created with different allocators when `ALLOCATOR` does not have the `propagate_on_container_swap` trait is a departure from the C++ Standard. | xref:BloombergLP/bslstl/operator_plus-00.adoc[`::BloombergLP::bslstl::operator+`] | Return the concatenation of the specified `lhs` string ref and the specified `rhs` `std::basic_string` value. | xref:BloombergLP/bslstl/operator_plus-02.adoc[`::BloombergLP::bslstl::operator+`] | Return a `bsl::string` having the value of the concatenation of the strings referred to by the specified `lhs` and `rhs` values. | xref:BloombergLP/bslstl/operator_plus-03.adoc[`::BloombergLP::bslstl::operator+`] | Return the concatenation of the specified C string and string ref. | xref:BloombergLP/bslstl/operator_plus-05.adoc[`::BloombergLP::bslstl::operator+`] | Return the concatenation of the specified `lhs` string ref and the specified `rhs` `bsl::basic_string` value. | xref:BloombergLP/bslstl/operator_plus-072.adoc[`::BloombergLP::bslstl::operator+`] | Return the concatenation of the specified `lhs` string ref and the specified `rhs` `bsl::basic_string` value. | xref:BloombergLP/bslstl/operator_plus-076.adoc[`::BloombergLP::bslstl::operator+`] | Return the concatenation of the specified string ref and C string. | xref:BloombergLP/bslstl/operator_plus-0f7.adoc[`::BloombergLP::bslstl::operator+`] | Return the concatenation of the specified `lhs` `std::basic_string` and the specified `rhs` string ref. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#