BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > Class Template Reference

#include <bslstl_string.h>

Inheritance diagram for bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >:
bsl::String_Imp< CHAR_TYPE, allocator_traits< ALLOCATOR >::size_type >

Detailed Description

template<class CHAR_TYPE, class CHAR_TRAITS, class ALLOCATOR>
class bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >

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
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:
  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
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.

Public Types

typedef CHAR_TRAITS traits_type
 
typedef CHAR_TRAITS::char_type value_type
 
typedef ALLOCATOR allocator_type
 
typedef AllocatorTraits::size_type size_type
 
typedef AllocatorTraits::difference_type difference_type
 
typedef AllocatorTraits::pointer pointer
 
typedef AllocatorTraits::const_pointer const_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef CHAR_TYPE * iterator
 
typedef const CHAR_TYPE * const_iterator
 
typedef bsl::reverse_iterator< iteratorreverse_iterator
 
typedef bsl::reverse_iterator< const_iteratorconst_reverse_iterator
 

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION_IF (basic_string, BloombergLP::bslmf::IsBitwiseMoveable, BloombergLP::bslmf::IsBitwiseMoveable< ALLOCATOR >::value)
 
 basic_string () BSLS_KEYWORD_NOEXCEPT
 
 basic_string (const ALLOCATOR &basicAllocator) BSLS_KEYWORD_NOEXCEPT
 
 basic_string (const basic_string &original)
 
 basic_string (const basic_string &original, const ALLOCATOR &basicAllocator)
 
 basic_string (BloombergLP::bslmf::MovableRef< basic_string > original) BSLS_KEYWORD_NOEXCEPT
 
 basic_string (BloombergLP::bslmf::MovableRef< basic_string > original, const ALLOCATOR &basicAllocator)
 
 basic_string (BloombergLP::bslmf::MovableRef< basic_string > original, size_type position, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
 basic_string (BloombergLP::bslmf::MovableRef< basic_string > original, size_type position, size_type numChars, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
 basic_string (const basic_string &original, size_type position, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
 basic_string (const basic_string &original, size_type position, size_type numChars, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
 basic_string (const CHAR_TYPE *characterString, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
 basic_string (const CHAR_TYPE *characterString, size_type numChars, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
 basic_string (size_type numChars, CHAR_TYPE character, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
template<class INPUT_ITER >
 basic_string (INPUT_ITER first, INPUT_ITER last, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
template<class RANGE >
 basic_string (from_range_t, BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
template<class ALLOC2 >
 basic_string (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &original, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
 basic_string (const BloombergLP::bslstl::StringRefData< CHAR_TYPE > &strRef, const ALLOCATOR &basicAllocator=ALLOCATOR())
 
template<class STRING_VIEW_LIKE_TYPE >
 basic_string (const STRING_VIEW_LIKE_TYPE &object, basicAllocator=ALLOCATOR())
 
template<class STRING_VIEW_LIKE_TYPE >
 basic_string (const STRING_VIEW_LIKE_TYPE &object, size_type position, size_type numChars, const ALLOCATOR &basicAllocator=ALLOCATOR(), BSLSTL_STRINGVIEWLIKEPARAM_ENABLE_IF_T(void) *=0)
 
 ~basic_string ()
 
basic_stringoperator= (const basic_string &rhs)
 
basic_stringoperator= (BloombergLP::bslmf::MovableRef< basic_string > rhs)
 
template<class STRING_VIEW_LIKE_TYPE >
 operator= (const STRING_VIEW_LIKE_TYPE &rhs)
 
basic_stringoperator= (const CHAR_TYPE *rhs)
 
basic_stringoperator= (CHAR_TYPE character)
 
template<class ALLOC2 >
basic_stringoperator= (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &rhs)
 
void resize (size_type newLength, CHAR_TYPE character)
 
void resize (size_type newLength)
 
template<class OPERATION >
void resize_and_overwrite (size_type newLength, OPERATION operation)
 
void reserve (size_type newCapacity)
 
void shrink_to_fit ()
 
void clear () BSLS_KEYWORD_NOEXCEPT
 
iterator begin () BSLS_KEYWORD_NOEXCEPT
 
iterator end () BSLS_KEYWORD_NOEXCEPT
 
reverse_iterator rbegin () BSLS_KEYWORD_NOEXCEPT
 
reverse_iterator rend () BSLS_KEYWORD_NOEXCEPT
 
reference operator[] (size_type position)
 
reference at (size_type position)
 
CHAR_TYPE & front ()
 
CHAR_TYPE & back ()
 
basic_stringoperator+= (const basic_string &rhs)
 
basic_stringoperator+= (const CHAR_TYPE *rhs)
 
basic_stringoperator+= (CHAR_TYPE character)
 
template<class STRING_VIEW_LIKE_TYPE >
 operator+= (const STRING_VIEW_LIKE_TYPE &rhs)
 
template<class ALLOC2 >
basic_stringoperator+= (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &rhs)
 
basic_stringappend (const basic_string &suffix)
 
basic_stringappend (const basic_string &suffix, size_type position, size_type numChars=npos)
 
basic_stringappend (const CHAR_TYPE *characterString, size_type numChars)
 
basic_stringappend (const CHAR_TYPE *characterString)
 
basic_stringappend (size_type numChars, CHAR_TYPE character)
 
template<class STRING_VIEW_LIKE_TYPE >
 append (const STRING_VIEW_LIKE_TYPE &suffix)
 
template<class STRING_VIEW_LIKE_TYPE >
 append (const STRING_VIEW_LIKE_TYPE &suffix, size_type position, size_type numChars=npos)
 
template<class INPUT_ITER >
basic_stringappend (INPUT_ITER first, INPUT_ITER last)
 
template<class RANGE >
basic_stringappend_range (BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range)
 
void push_back (CHAR_TYPE character)
 
basic_stringassign (const basic_string &replacement)
 
basic_stringassign (BloombergLP::bslmf::MovableRef< basic_string > replacement) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(false)
 
basic_stringassign (const basic_string &replacement, size_type position, size_type numChars=npos)
 
basic_stringassign (const CHAR_TYPE *characterString)
 
basic_stringassign (const CHAR_TYPE *characterString, size_type numChars)
 
template<class STRING_VIEW_LIKE_TYPE >
 assign (const STRING_VIEW_LIKE_TYPE &replacement)
 
template<class STRING_VIEW_LIKE_TYPE >
 assign (const STRING_VIEW_LIKE_TYPE &replacement, size_type position, size_type numChars=npos)
 
template<class ALLOC2 >
basic_stringassign (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &string)
 
basic_stringassign (size_type numChars, CHAR_TYPE character)
 
template<class INPUT_ITER >
basic_stringassign (INPUT_ITER first, INPUT_ITER last)
 
template<class RANGE >
basic_stringassign_range (BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range)
 
basic_stringinsert (size_type position, const basic_string &other)
 
basic_stringinsert (size_type position, const basic_string &other, size_type sourcePosition, size_type numChars=npos)
 
basic_stringinsert (size_type position, const CHAR_TYPE *characterString, size_type numChars)
 
basic_stringinsert (size_type position, const CHAR_TYPE *characterString)
 
basic_stringinsert (size_type position, size_type numChars, CHAR_TYPE character)
 
iterator insert (const_iterator position, CHAR_TYPE character)
 
template<class INPUT_ITER >
iterator insert (const_iterator position, INPUT_ITER first, INPUT_ITER last)
 
iterator insert (const_iterator position, size_type numChars, CHAR_TYPE character)
 
template<class STRING_VIEW_LIKE_TYPE >
 insert (size_type position, const STRING_VIEW_LIKE_TYPE &other)
 
template<class STRING_VIEW_LIKE_TYPE >
 insert (size_type position, const STRING_VIEW_LIKE_TYPE &other, size_type sourcePosition, size_type numChars=npos)
 
template<class RANGE >
iterator insert_range (const_iterator position, BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range)
 
basic_stringerase (size_type position=0, size_type numChars=npos)
 
iterator erase (const_iterator position)
 
iterator erase (const_iterator first, const_iterator last)
 
void pop_back ()
 
basic_stringreplace (size_type outPosition, size_type outNumChars, const basic_string &replacement)
 
basic_stringreplace (size_type outPosition, size_type outNumChars, const basic_string &replacement, size_type position, size_type numChars=npos)
 
basic_stringreplace (size_type outPosition, size_type outNumChars, const CHAR_TYPE *characterString, size_type numChars)
 
basic_stringreplace (size_type outPosition, size_type outNumChars, const CHAR_TYPE *characterString)
 
basic_stringreplace (size_type outPosition, size_type outNumChars, size_type numChars, CHAR_TYPE character)
 
template<class STRING_VIEW_LIKE_TYPE >
 replace (size_type outPosition, size_type outNumChars, const STRING_VIEW_LIKE_TYPE &replacement)
 
template<class STRING_VIEW_LIKE_TYPE >
 replace (size_type outPosition, size_type outNumChars, const STRING_VIEW_LIKE_TYPE &replacement, size_type position, size_type numChars=npos)
 
basic_stringreplace (const_iterator first, const_iterator last, const basic_string &replacement)
 
template<class STRING_VIEW_LIKE_TYPE >
 replace (const_iterator first, const_iterator last, const STRING_VIEW_LIKE_TYPE &replacement)
 
basic_stringreplace (const_iterator first, const_iterator last, const CHAR_TYPE *characterString, size_type numChars)
 
basic_stringreplace (const_iterator first, const_iterator last, const CHAR_TYPE *characterString)
 
basic_stringreplace (const_iterator first, const_iterator last, size_type numChars, CHAR_TYPE character)
 
template<class INPUT_ITER >
basic_stringreplace (const_iterator first, const_iterator last, INPUT_ITER stringFirst, INPUT_ITER stringLast)
 
template<class RANGE >
basic_stringreplace_with_range (const_iterator first, const_iterator last, BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range)
 
CHAR_TYPE * data () BSLS_KEYWORD_NOEXCEPT
 
const_iterator cbegin () const BSLS_KEYWORD_NOEXCEPT
 
const_iterator end () const BSLS_KEYWORD_NOEXCEPT
 
const_iterator cend () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator rbegin () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator crbegin () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator rend () const BSLS_KEYWORD_NOEXCEPT
 
const_reverse_iterator crend () const BSLS_KEYWORD_NOEXCEPT
 
size_type length () const BSLS_KEYWORD_NOEXCEPT
 
size_type size () const BSLS_KEYWORD_NOEXCEPT
 
size_type max_size () const BSLS_KEYWORD_NOEXCEPT
 
size_type capacity () const BSLS_KEYWORD_NOEXCEPT
 
bool empty () const BSLS_KEYWORD_NOEXCEPT
 
const_reference operator[] (size_type position) const
 
const_reference at (size_type position) const
 
const CHAR_TYPE & front () const
 
const CHAR_TYPE & back () const
 
size_type copy (CHAR_TYPE *characterString, size_type numChars, size_type position=0) const
 
const CHAR_TYPE * c_str () const BSLS_KEYWORD_NOEXCEPT
 
const CHAR_TYPE * data () const BSLS_KEYWORD_NOEXCEPT
 
allocator_type get_allocator () const BSLS_KEYWORD_NOEXCEPT
 
size_type find (const basic_string &substring, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
 
template<class STRING_VIEW_LIKE_TYPE >
size_type find (const STRING_VIEW_LIKE_TYPE &substring, size_type position=0, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
size_type find (const CHAR_TYPE *substring, size_type position, size_type numChars) const
 
size_type find (const CHAR_TYPE *substring, size_type position=0) const
 
size_type find (CHAR_TYPE character, size_type position=0) const
 
size_type rfind (const basic_string &substring, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
 
template<class STRING_VIEW_LIKE_TYPE >
size_type rfind (const STRING_VIEW_LIKE_TYPE &substring, size_type position=npos, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
size_type rfind (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
size_type rfind (const CHAR_TYPE *characterString, size_type position=npos) const
 
size_type rfind (CHAR_TYPE character, size_type position=npos) const
 
size_type find_first_of (const basic_string &characterString, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
 
template<class STRING_VIEW_LIKE_TYPE >
size_type find_first_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position=0, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
size_type find_first_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
size_type find_first_of (const CHAR_TYPE *characterString, size_type position=0) const
 
size_type find_first_of (CHAR_TYPE character, size_type position=0) const
 
size_type find_last_of (const basic_string &characterString, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
 
template<class STRING_VIEW_LIKE_TYPE >
size_type find_last_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position=npos, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
size_type find_last_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
size_type find_last_of (const CHAR_TYPE *characterString, size_type position=npos) const
 
size_type find_last_of (CHAR_TYPE character, size_type position=npos) const
 
size_type find_first_not_of (const basic_string &characterString, size_type position=0) const BSLS_KEYWORD_NOEXCEPT
 
template<class STRING_VIEW_LIKE_TYPE >
size_type find_first_not_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position=0, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
size_type find_first_not_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
size_type find_first_not_of (const CHAR_TYPE *characterString, size_type position=0) const
 
size_type find_first_not_of (CHAR_TYPE character, size_type position=0) const
 
size_type find_last_not_of (const basic_string &characterString, size_type position=npos) const BSLS_KEYWORD_NOEXCEPT
 
template<class STRING_VIEW_LIKE_TYPE >
size_type find_last_not_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position=npos, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
size_type find_last_not_of (const CHAR_TYPE *characterString, size_type position, size_type numChars) const
 
size_type find_last_not_of (const CHAR_TYPE *characterString, size_type position=npos) const
 
size_type find_last_not_of (CHAR_TYPE character, size_type position=npos) const
 
bool contains (basic_string_view< CHAR_TYPE, CHAR_TRAITS > subview) const BSLS_KEYWORD_NOEXCEPT
 
bool contains (CHAR_TYPE character) const BSLS_KEYWORD_NOEXCEPT
 
bool contains (const CHAR_TYPE *characterString) const
 
bool starts_with (basic_string_view< CHAR_TYPE, CHAR_TRAITS > characterString) const BSLS_KEYWORD_NOEXCEPT
 
bool starts_with (CHAR_TYPE character) const BSLS_KEYWORD_NOEXCEPT
 
bool starts_with (const CHAR_TYPE *characterString) const
 
bool ends_with (basic_string_view< CHAR_TYPE, CHAR_TRAITS > characterString) const BSLS_KEYWORD_NOEXCEPT
 
bool ends_with (CHAR_TYPE character) const BSLS_KEYWORD_NOEXCEPT
 
bool ends_with (const CHAR_TYPE *characterString) const
 
basic_string substr (size_type position=0, size_type numChars=npos) const
 
int compare (const basic_string &other) const BSLS_KEYWORD_NOEXCEPT
 
int compare (size_type position, size_type numChars, const basic_string &other) const
 
int compare (size_type lhsPosition, size_type lhsNumChars, const basic_string &other, size_type otherPosition, size_type otherNumChars=npos) const
 
int compare (const CHAR_TYPE *other) const
 
int compare (size_type lhsPosition, size_type lhsNumChars, const CHAR_TYPE *other, size_type otherNumChars) const
 
int compare (size_type lhsPosition, size_type lhsNumChars, const CHAR_TYPE *other) const
 
template<class STRING_VIEW_LIKE_TYPE >
int compare (const STRING_VIEW_LIKE_TYPE &other, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *=0) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
template<class STRING_VIEW_LIKE_TYPE >
int compare (size_type position, size_type numChars, const STRING_VIEW_LIKE_TYPE &other, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *=0) const
 
template<class STRING_VIEW_LIKE_TYPE >
int compare (size_type lhsPosition, size_type lhsNumChars, const STRING_VIEW_LIKE_TYPE &other, size_type otherPosition, size_type otherNumChars=npos, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *=0) const
 
template<class ALLOC2 >
 operator std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > () const
 
 operator basic_string_view< CHAR_TYPE, CHAR_TRAITS > () const
 
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateAppend (INPUT_ITER first, SENTINEL last, const char *message, std::input_iterator_tag tag)
 
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateAppend (INPUT_ITER first, SENTINEL last, size_type numChars, const char *message, std::input_iterator_tag)
 
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateAppend (INPUT_ITER first, SENTINEL last, const char *message, std::forward_iterator_tag tag)
 
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateAppend (INPUT_ITER first, SENTINEL last, size_type numChars, const char *message, std::forward_iterator_tag)
 
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateAppend (INPUT_ITER first, INPUT_ITER last, const char *message)
 
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateAppendRange (INPUT_ITER first, SENTINEL last, size_type numChars, const char *message)
 
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateAppendDispatch (INPUT_ITER first, INPUT_ITER last, const char *message, BloombergLP::bslmf::MatchArithmeticType, BloombergLP::bslmf::Nil)
 
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateAppendDispatch (INPUT_ITER first, INPUT_ITER last, const char *message, BloombergLP::bslmf::MatchAnyType, BloombergLP::bslmf::MatchAnyType)
 
template<class FIRST_TYPE , class SECOND_TYPE >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateAssignDispatch (FIRST_TYPE first, SECOND_TYPE second, const char *message)
 
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateAssignRangeDispatch (INPUT_ITER first, SENTINEL last, size_type numChars, const char *message)
 
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateReplaceDispatch (size_type position, size_type numChars, INPUT_ITER first, INPUT_ITER last, BloombergLP::bslmf::MatchArithmeticType, BloombergLP::bslmf::Nil)
 
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateReplaceDispatch (size_type position, size_type numChars, INPUT_ITER first, INPUT_ITER last, BloombergLP::bslmf::MatchAnyType, BloombergLP::bslmf::MatchAnyType)
 
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateReplace (size_type outPosition, size_type outNumChars, INPUT_ITER first, INPUT_ITER last, std::input_iterator_tag tag)
 
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateReplace (size_type outPosition, size_type outNumChars, size_type inNumChars, INPUT_ITER first, SENTINEL last, std::input_iterator_tag)
 
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateReplace (size_type outPosition, size_type outNumChars, INPUT_ITER first, INPUT_ITER last, std::forward_iterator_tag tag)
 
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateReplace (size_type outPosition, size_type outNumChars, size_type inNumChars, INPUT_ITER first, SENTINEL last, std::forward_iterator_tag)
 
template<class INPUT_ITER , class SENTINEL >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & privateReplaceRange (size_type position, size_type outNumChars, size_type inNumChars, INPUT_ITER first, SENTINEL last)
 
template<class INPUT_ITERATOR , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type privateNumCharsInRange (INPUT_ITERATOR first, SENTINEL last) const
 
template<class ALLOC2 >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &original, const ALLOCATOR &basicAllocator)
 
template<class ALLOC2 >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & operator= (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &rhs)
 
template<class ALLOC2 >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & operator+= (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &rhs)
 
template<class INPUT_ITER >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & append (INPUT_ITER first, INPUT_ITER last)
 
template<class RANGE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & append_range (BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range)
 
template<class ALLOC2 >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & assign (const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &string)
 
template<class INPUT_ITER >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & assign (INPUT_ITER first, INPUT_ITER last)
 
template<class RANGE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & assign_range (BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range)
 
template<class INPUT_ITER >
BSLSTL_INSERT_RETURN_TYPE insert (const_iterator position, INPUT_ITER first, INPUT_ITER last)
 
template<class RANGE >
BSLSTL_INSERT_RETURN_TYPE insert_range (const_iterator position, BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range)
 
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & replace (const_iterator first, const_iterator last, INPUT_ITER stringFirst, INPUT_ITER stringLast)
 
template<class RANGE >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & replace_with_range (const_iterator first, const_iterator last, BSLS_COMPILERFEATURES_FORWARD_REF(RANGE) range)
 
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type find (const STRING_VIEW_LIKE_TYPE &substring, size_type position, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type rfind (const STRING_VIEW_LIKE_TYPE &substring, size_type position, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type find_first_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type find_last_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type find_first_not_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type find_last_not_of (const STRING_VIEW_LIKE_TYPE &characterString, size_type position, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE int compare (const STRING_VIEW_LIKE_TYPE &other, BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *) const BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(true)
 

Public Attributes

void swap(basic_string &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(AllocatorTraits const_iterator begin () const BSLS_KEYWORD_NOEXCEPT
 

Static Public Attributes

static const size_type npos = ~size_type(0)
 

Friends

class String_ClearProctor< basic_string >
 
string to_string (int)
 
string to_string (long)
 
string to_string (long long)
 
string to_string (unsigned)
 
string to_string (unsigned long)
 
string to_string (unsigned long long)
 

Member Typedef Documentation

◆ allocator_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef ALLOCATOR bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::allocator_type

◆ const_iterator

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef const CHAR_TYPE* bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_iterator

◆ const_pointer

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef AllocatorTraits::const_pointer bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_pointer

◆ const_reference

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef const value_type& bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_reference

◆ const_reverse_iterator

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef bsl::reverse_iterator<const_iterator> bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_reverse_iterator

These types satisfy the ReversibleSequence requirements.

◆ difference_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef AllocatorTraits::difference_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::difference_type

◆ iterator

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef CHAR_TYPE* bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::iterator

◆ pointer

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef AllocatorTraits::pointer bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::pointer

◆ reference

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef value_type& bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::reference

◆ reverse_iterator

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef bsl::reverse_iterator<iterator> bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::reverse_iterator

◆ size_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef AllocatorTraits::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type

◆ traits_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef CHAR_TRAITS bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::traits_type

◆ value_type

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
typedef CHAR_TRAITS::char_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::value_type

Constructor & Destructor Documentation

◆ basic_string() [1/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( )
inline

◆ basic_string() [2/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const ALLOCATOR &  basicAllocator)
inlineexplicit

Create an empty string. Optionally specify the basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used.

◆ basic_string() [3/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  original)

Create a string that has the same value as the specified original string. Use the allocator returned by 'bsl::allocator_traits<ALLOCATOR>:: select_on_container_copy_construction(original.get_allocator())' to supply memory.

◆ basic_string() [4/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  original,
const ALLOCATOR &  basicAllocator 
)

Create a string that has the same value as the specified original string and uses the specified basicAllocator to supply memory.

Note
Note that it is important to have two copy constructors instead of a single:
basic_string(const basic_string& original,
const ALLOCATOR& basicAllocator = ALLOCATOR());
Definition bslstl_string.h:1252
basic_string() BSLS_KEYWORD_NOEXCEPT
Definition bslstl_string.h:5559
When the copy constructor with the default allocator is used, xlC10 gets confused and refuses to use the return value optimization, which then causes extra allocations when returning by value in operator+.

◆ basic_string() [5/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( BloombergLP::bslmf::MovableRef< basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > >  original)
inline

Create a string that has the same value as the specified original string by moving (in constant time) the contents of original to the new string. The allocator associated with original is propagated for use in the newly-created string. original is left in a valid but unspecified state.

◆ basic_string() [6/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( BloombergLP::bslmf::MovableRef< basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > >  original,
const ALLOCATOR &  basicAllocator 
)
inline

Create a string that has the same value as the specified original string that uses the specified basicAllocator to supply memory. The contents of original are moved (in constant time) to the new string if basicAllocator == original.get_allocator(), and are copied (in linear time) using basicAllocator otherwise. original is left in a valid but unspecified state.

◆ basic_string() [7/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( BloombergLP::bslmf::MovableRef< basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > >  original,
size_type  position,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)
inline

Create a string that has the same value as the substring starting at the specified position in the specified original string. Optionally specify the basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used. The contents of original are moved (in constant time) to the new string if basicAllocator == original.get_allocator(), and are copied (in linear time) using basicAllocator otherwise. original is left in a valid but unspecified state. Throw out_of_range if position > original.length().

◆ basic_string() [8/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( BloombergLP::bslmf::MovableRef< basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > >  original,
size_type  position,
size_type  numChars,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)
inline

Create a string that has the same value as the substring of the specified numChars length starting at the specified position in the specified original string. If numChars is more than the available string length, then the remaining length of the string is used (i.e., numChars is set to original.length() - position). Optionally specify the basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used. The contents of original are moved (in constant time) to the new string if basicAllocator == original.get_allocator(), and are copied (in linear time) using basicAllocator otherwise. original is left in a valid but unspecified state. Throw out_of_range if position > original.length().

◆ basic_string() [9/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  original,
size_type  position,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)

Create a string that has the same value as the substring of the specified numChars length starting at the specified position in the specified original string. Optionally specify the basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used. Throw out_of_range if position > original.length().

◆ basic_string() [10/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  original,
size_type  position,
size_type  numChars,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)

Create a string that has the same value as the substring of the specified numChars length starting at the specified position in the specified original string. If numChars equals npos, then the remaining length of the string is used (i.e., numChars is set to original.length() - position). Optionally specify the basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used. Throw out_of_range if position > original.length().

◆ basic_string() [11/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const CHAR_TYPE *  characterString,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)

Create a string having the same value as the specified null-terminated characterString (of length CHAR_TRAITS::length(characterString)). Optionally specify a basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used.

◆ basic_string() [12/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const CHAR_TYPE *  characterString,
size_type  numChars,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)

Create a string that has the same value as the substring of the optionally specified numChars length starting at the beginning of the specified characterString. If numChars is not specified, CHAR_TRAITS::length(characterString) is used. Optionally specify the basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used. Throw out_of_range if numChars >= npos.

◆ basic_string() [13/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( size_type  numChars,
CHAR_TYPE  character,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)

Create a string of the specified numChars length whose every position contains the specified character. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used.

◆ basic_string() [14/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( INPUT_ITER  first,
INPUT_ITER  last,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)
inline

Create a string from the characters in the range starting at the specified first iterator and ending right before the specified last iterator of the (template parameter) type INPUT_ITER. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used.

Precondition
The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last.

◆ basic_string() [15/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class RANGE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( from_range_t  ,
BSLS_COMPILERFEATURES_FORWARD_REF(RANGE)  range,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)
inline

Create a string that containing the characters from the specified range. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not specified, a default-constructed allocator is used.

Note
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.

◆ basic_string() [16/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class ALLOC2 >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &  original,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)

Create a string that has the same value as the specified original string, where the type original is the 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 resulting string will contain the same sequence of characters as original. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not specified, then a default-constructed allocator is used.

◆ basic_string() [17/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const BloombergLP::bslstl::StringRefData< CHAR_TYPE > &  strRef,
const ALLOCATOR &  basicAllocator = ALLOCATOR() 
)
inline

Create a string that has the same value as the specified strRef string. The resulting string will contain the same sequence of characters as strRef. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not specified, then a default-constructed allocator is used.

◆ basic_string() [18/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const STRING_VIEW_LIKE_TYPE &  object,
basicAllocator  = ALLOCATOR() 
)
inlineexplicit

Create a string that has the same value as the specified object. Optionally specify a basicAllocator used to supply memory. If basicAllocator is not specified, then a default-constructed allocator is used.

◆ basic_string() [19/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const STRING_VIEW_LIKE_TYPE &  object,
size_type  position,
size_type  numChars,
const ALLOCATOR &  basicAllocator = ALLOCATOR(),
BSLSTL_STRINGVIEWLIKEPARAM_ENABLE_IF_T(void) *  = 0 
)
inline

Create a string that has the same value as the substring of the specified numChars length starting at the specified position in the specified object. Optionally specify a basicAllocator used to supply memory. If the basicAllocator is not specified, a default-constructed allocator is used. Throw out_of_range if position > original.object().

◆ ~basic_string()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::~basic_string ( )

Destroy this string object.

◆ basic_string() [20/20]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class ALLOC2 >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::basic_string ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &  original,
const ALLOCATOR &  basicAllocator 
)

Member Function Documentation

◆ append() [1/9]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  suffix)

Append to this string the specified suffix, and return a reference providing modifiable access to this string.

◆ append() [2/9]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  suffix,
size_type  position,
size_type  numChars = npos 
)

Append to this string the optionally specified numChars characters starting at the specified position in the specified suffix, or the tail of suffix starting at position if position + numChars > suffix.length(). If numChars is not specified, npos is used. Return a reference providing modifiable access to this string. Throw out_of_range if position > suffix.length().

◆ append() [3/9]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append ( const CHAR_TYPE *  characterString)

Append the specified null-terminated characterString (of length CHAR_TRAITS::length(characterString)) to this string, and return a reference providing modifiable access to this string.

◆ append() [4/9]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append ( const CHAR_TYPE *  characterString,
size_type  numChars 
)

Append to this string the specified initial numChars characters from the specified characterString, and return a reference providing modifiable access to this string.

Precondition
The behavior is undefined unless characterString is at least numChars long.

◆ append() [5/9]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append ( const STRING_VIEW_LIKE_TYPE &  suffix)

Append to this string the bsl::string_view object, obtained from the specified suffix, and return a reference providing modifiable access to this string. Throw length_error if the length of the resulting string exceeds max_size().

◆ append() [6/9]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append ( const STRING_VIEW_LIKE_TYPE &  suffix,
size_type  position,
size_type  numChars = npos 
)

Append to this string the optionally specified numChars characters starting at the specified position in the bsl::string_view object, obtained from the specified suffix, or its tail starting at position if numChars exceeds the length of this tail. If numChars is not specified, npos is used. Return a reference providing modifiable access to this string. Throw out_of_range if position > strView.length(). Throw length_error if the length of the resulting string exceeds max_size().

◆ append() [7/9]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append ( INPUT_ITER  first,
INPUT_ITER  last 
)

Append to this string the characters in the range starting at the specified first iterator and ending right before the specified last iterator of the (template parameter) type INPUT_ITER. Return a reference providing modifiable access to this string.

Precondition
The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last.

◆ append() [8/9]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append ( INPUT_ITER  first,
INPUT_ITER  last 
)

◆ append() [9/9]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append ( size_type  numChars,
CHAR_TYPE  character 
)

Append the specified numChars copies of the specified character to this string, and return a reference providing modifiable access to this string.

◆ append_range() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class RANGE >
basic_string & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append_range ( BSLS_COMPILERFEATURES_FORWARD_REF(RANGE)  range)

Append to this string the characters from the specified range. Return a reference providing modifiable access to this string.

Note
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.

◆ append_range() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class RANGE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::append_range ( BSLS_COMPILERFEATURES_FORWARD_REF(RANGE)  range)

◆ assign() [1/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( BloombergLP::bslmf::MovableRef< basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > >  replacement)
inline

Assign to this string the value of the specified replacement string, propagate to this object the allocator of replacement if the ALLOCATOR type has trait propagate_on_container_move_assignment , and return a reference providing modifiable access to this string. The content of replacement is moved (in constant time) to this string if get_allocator() == rhs.get_allocator() (after accounting for the aforementioned trait). replacement is left in a valid but unspecified state.

Note
Note that this method has exactly the same behavior as the corresponding operator=.

◆ assign() [2/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  replacement)

Assign to this string the value of the specified replacement string, propagate to this object the allocator of replacement if the ALLOCATOR type has trait propagate_on_container_copy_assignment , and return a reference providing modifiable access to this string.

Note
Note that this method has exactly the same behavior as the corresponding operator=.

◆ assign() [3/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  replacement,
size_type  position,
size_type  numChars = npos 
)

Assign to this string the value of the optionally specified numChars characters starting at the specified position in the specified replacement string, or the suffix of replacement starting at position if position + numChars > replacement.length(). If numChars is not specified, npos is used. Return a reference providing modifiable access to this string. Throw out_of_range if position > replacement.length().

◆ assign() [4/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( const CHAR_TYPE *  characterString)

Assign to this string the value of the specified null-terminated characterString (of length CHAR_TRAITS::length(characterString)), and return a reference providing modifiable access to this string.

◆ assign() [5/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( const CHAR_TYPE *  characterString,
size_type  numChars 
)

Assign to this string the specified initial numChars characters in the specified characterString, and return a reference providing modifiable access to this string.

Precondition
The behavior is undefined unless characterString is at least numChars long.

◆ assign() [6/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class ALLOC2 >
basic_string & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &  string)

Assign to this string the value of the specified string, and return a reference providing modifiable access to this string.

◆ assign() [7/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class ALLOC2 >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &  string)

◆ assign() [8/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( const STRING_VIEW_LIKE_TYPE &  replacement)

Assign to this string the value of the specified replacement, and return a reference providing modifiable access to this string.

Note
Note that this method has exactly the same behavior as the corresponding operator=.

◆ assign() [9/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( const STRING_VIEW_LIKE_TYPE &  replacement,
size_type  position,
size_type  numChars = npos 
)

Assign to this string the value of the optionally specified numChars characters starting at the specified position in the specified replacement, or the suffix of the replacement starting at position if position + numChars > replacement.length(). If numChars is not specified, npos is used. Return a reference providing modifiable access to this string. Throw out_of_range if position > replacement.length().

◆ assign() [10/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( INPUT_ITER  first,
INPUT_ITER  last 
)

Assign to this string the characters in the range starting at the specified first iterator and ending right before the specified last iterator of the (template parameter) type INPUT_ITER. Return a reference providing modifiable access to this string.

Precondition
The behavior is undefined unless first and last refer to a sequence of valid values where first is at a position at or before last.

◆ assign() [11/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( INPUT_ITER  first,
INPUT_ITER  last 
)

◆ assign() [12/12]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign ( size_type  numChars,
CHAR_TYPE  character 
)

Assign to this string the value of a string of the specified numChars length whose every character is equal to the specified character, and return a reference providing modifiable access to this string.

◆ assign_range() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class RANGE >
basic_string & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign_range ( BSLS_COMPILERFEATURES_FORWARD_REF(RANGE)  range)

Assign to this string the characters from the specified range. Return a reference providing modifiable access to this string.

Note
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.

◆ assign_range() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class RANGE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::assign_range ( BSLS_COMPILERFEATURES_FORWARD_REF(RANGE)  range)

◆ at() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::reference bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::at ( size_type  position)

Return a reference providing modifiable access to the character at the specified position in this string. Throw out_of_range if position >= length().

◆ at() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_reference bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::at ( size_type  position) const

Return a reference providing non-modifiable access to the character at the specified position in this string. Throw out_of_range if position >= length().

◆ back() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
CHAR_TYPE & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::back ( )
inline

Return a reference providing modifiable access to the character at the last position in this string.

Precondition
The behavior is undefined if this string is empty.
Note
Note that the last position is length() - 1.

◆ back() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
const CHAR_TYPE & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::back ( ) const
inline

Return a reference providing non-modifiable access to the character at the last position in this string.

Precondition
The behavior is undefined if this string is empty.
Note
Note that the last position is length() - 1.

◆ begin()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::begin ( )

Return an iterator referring to the first character in this modifiable string (or the past-the-end iterator if this string is empty).

◆ BSLMF_NESTED_TRAIT_DECLARATION_IF()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::BSLMF_NESTED_TRAIT_DECLARATION_IF ( basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >  ,
BloombergLP::bslmf::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.

◆ c_str()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
const CHAR_TYPE * bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::c_str ( ) const
inline

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
Note that any call to the string destructor or any of its manipulators invalidates the returned pointer.

◆ capacity()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::capacity ( ) const
inline

Return the capacity of this string, i.e., the maximum length for which resizing is guaranteed not to trigger a reallocation.

◆ cbegin()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::cbegin ( ) const
inline

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

◆ cend()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::cend ( ) const
inline

Return the past-the-end iterator for this string.

◆ clear()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE void bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::clear ( )

Reset this string to an empty value.

Note
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.

◆ compare() [1/10]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE int bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::compare ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  other) const

Lexicographically compare this string with the specified other string, and return a negative value if this string is less than other, a positive value if it is greater than other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. See {Lexicographical Comparisons}.

◆ compare() [2/10]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE int bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::compare ( const CHAR_TYPE *  other) const

Lexicographically compare this string with the specified null-terminated other string (of length CHAR_TRAITS::length(other)), and return a negative value if this string is less than other, a positive value if it is greater than other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. See {Lexicographical Comparisons}.

◆ compare() [3/10]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE int bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::compare ( const STRING_VIEW_LIKE_TYPE &  other,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *   
) const

◆ compare() [4/10]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
int bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::compare ( const STRING_VIEW_LIKE_TYPE &  other,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *  = 0 
) const

Lexicographically compare this string with the specified other, and return a negative value if this string is less than other, a positive value if it is greater than other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. See {Lexicographical Comparisons}.

Precondition
The behavior is undefined unless the conversion from STRING_VIEW_LIKE_TYPE to bsl::basic_string_view<CHAR_TYPE, CHAR_TRAITS> does not throw any exception.
Note
Note that this behavior differs from the behavior implemented in the standard container, where the following noexcept specification is used:
noexcept(
std::is_nothrow_convertible_v<const T&,
std::basic_string_view<CharT,
Traits> >)

◆ compare() [5/10]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
int bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::compare ( size_type  lhsPosition,
size_type  lhsNumChars,
const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  other,
size_type  otherPosition,
size_type  otherNumChars = npos 
) const

Lexicographically compare the substring of this string of the specified lhsNumChars length starting at the specified lhsPosition (or the suffix of this string starting at lhsPosition if lhsPosition + lhsNumChars > length()) with the substring of the specified other string of the optionally specified otherNumChars length starting at the specified otherPosition (or the suffix of other starting at otherPosition if otherPosition + otherNumChars > other.length()). If numChars is not specified, npos is used. Return a negative value if the indicated substring of this string is less than the indicated substring of other, a positive value if it is greater than the indicated substring of other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. Throw out_of_range if lhsPosition > length() or otherPosition > other.length(). See {Lexicographical Comparisons}.

◆ compare() [6/10]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE int bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::compare ( size_type  lhsPosition,
size_type  lhsNumChars,
const CHAR_TYPE *  other 
) const

Lexicographically compare the substring of this string of the specified lhsNumChars length starting at the specified lhsPosition (or the suffix of this string starting at lhsPosition if lhsPosition + lhsNumChars > length()) with the specified null-terminated other string (of length CHAR_TRAITS::length(other)), and return a negative value if the indicated substring of this string is less than other, a positive value if it is greater than other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. Throw out_of_range if lhsPosition > length(). See {Lexicographical Comparisons}.

◆ compare() [7/10]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
int bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::compare ( size_type  lhsPosition,
size_type  lhsNumChars,
const CHAR_TYPE *  other,
size_type  otherNumChars 
) const

Lexicographically compare the substring of this string of the specified lhsNumChars length starting at the specified lhsPosition (or the suffix of this string starting at lhsPosition if lhsPosition + lhsNumChars > length()) with the specified other string of the specified otherNumChars length, and return a negative value if the indicated substring of this string is less than other, a positive value if it is greater than other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. Throw out_of_range if lhsPosition > length(). See {Lexicographical Comparisons}.

◆ compare() [8/10]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
int bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::compare ( size_type  lhsPosition,
size_type  lhsNumChars,
const STRING_VIEW_LIKE_TYPE &  other,
size_type  otherPosition,
size_type  otherNumChars = npos,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *  = 0 
) const

Lexicographically compare the substring of this string of the specified lhsNumChars length starting at the specified lhsPosition (or the suffix of this string starting at lhsPosition if lhsPosition + lhsNumChars > length()) with the substring of the specified other of the optionally specified otherNumChars length starting at the specified otherPosition (or the suffix of other starting at otherPosition if otherPosition + otherNumChars > other.length()). If numChars is not specified, npos is used. Return a negative value if the indicated substring of this string is less than the indicated substring of other, a positive value if it is greater than the indicated substring of other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. See {Lexicographical Comparisons}. Throw out_of_range if lhsPosition > length() or otherPosition > other.length().

◆ compare() [9/10]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
int bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::compare ( size_type  position,
size_type  numChars,
const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  other 
) const

Lexicographically compare the substring of this string of the specified numChars length starting at the specified position (or the suffix of this string starting at position if position + numChars > length()) with the specified other string, and return a negative value if the indicated substring of this string is less than other, a positive value if it is greater than other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. See {Lexicographical Comparisons}. Throw out_of_range if position > length().

◆ compare() [10/10]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
int bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::compare ( size_type  position,
size_type  numChars,
const STRING_VIEW_LIKE_TYPE &  other,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *  = 0 
) const

Lexicographically compare the substring of this string of the specified numChars length starting at the specified position (or the suffix of this string starting at position if position + numChars > length()) with the specified other, and return a negative value if the indicated substring of this string is less than other, a positive value if it is greater than other, and 0 in case of equality. CHAR_TRAITS::lt is used to compare characters. See {Lexicographical Comparisons}. Throw out_of_range if position > length().

◆ contains() [1/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bool bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::contains ( basic_string_view< CHAR_TYPE, CHAR_TRAITS subview) const

Return true if this view contains with the specified subview, and false otherwise. See {Lexicographical Comparisons}.

◆ contains() [2/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bool bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::contains ( CHAR_TYPE  character) const

Return true if this view contains with the specified character, and false otherwise.

◆ contains() [3/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bool bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::contains ( const CHAR_TYPE *  characterString) const

Return true if this view contains with the specified characterString, and false otherwise.

◆ copy()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::copy ( CHAR_TYPE *  characterString,
size_type  numChars,
size_type  position = 0 
) const

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().

Precondition
The behavior is undefined unless characterString is at least numChars long.
Note
Note that the output characterString is not null-terminated.

◆ crbegin()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_reverse_iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::crbegin ( ) const
inline

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

◆ crend()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_reverse_iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::crend ( ) const

Return the past-the-end reverse iterator for this string.

◆ data() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
CHAR_TYPE * bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::data ( )
inline

Return an address providing modifiable access to the null-terminated buffer of length() + 1 characters whose contents are identical to the value of this string.

Note
Note that any call to the string destructor or any of its manipulators invalidates the returned pointer.

◆ data() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
const CHAR_TYPE * bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::data ( ) const
inline

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
Note that any call to the string destructor or any of its manipulators invalidates the returned pointer.

◆ empty()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
bool bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::empty ( ) const
inline

Return true if this string has length 0, and false otherwise.

◆ end() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::end ( )
inline

Return the past-the-end iterator for this modifiable string.

◆ end() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::end ( ) const
inline

◆ ends_with() [1/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bool bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::ends_with ( basic_string_view< CHAR_TYPE, CHAR_TRAITS characterString) const

Return true if the length of this string is equal to or greater than the length of the specified characterString and the last characterString.length() characters of this string are equal to the characters of the characterString, and false otherwise. CHAR_TRAITS::compare is used to compare characters. See {Lexicographical Comparisons}.

◆ ends_with() [2/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bool bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::ends_with ( CHAR_TYPE  character) const

Return true if this string contains at least one symbol and the last symbol of this string is equal to the specified character, and false otherwise. CHAR_TRAITS::eq is used to compare characters. See {Lexicographical Comparisons}.

◆ ends_with() [3/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bool bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::ends_with ( const CHAR_TYPE *  characterString) const

Return true if the length of this string is equal to or greater than the length of the specified characterString and the last CHAR_TRAITS::length(characterString) characters of this string are equal to the characters of the characterString, and false otherwise. CHAR_TRAITS::compare is used to compare characters. See {Lexicographical Comparisons}.

◆ erase() [1/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::erase ( const_iterator  first,
const_iterator  last 
)

Erase from this string a substring defined by the specified pair of first and last iterators within this string. Return an iterator providing modifiable access to the character at the last position prior to erasing. If no such character exists, return end(). This method invalidates existing iterators pointing to first or a subsequent position.

Precondition
The behavior is undefined unless first and last are both within the range [cbegin() .. cend()] and first <= last.

◆ erase() [2/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::erase ( const_iterator  position)

Erase a character at the specified position from this string, and return an iterator providing modifiable access to the character at position prior to erasing. If no such character exists, return end().

Precondition
The behavior is undefined unless position is within the half-open range [cbegin() .. cend()).

◆ erase() [3/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::erase ( size_type  position = 0,
size_type  numChars = npos 
)

Erase from this string the substring of length the optionally specified numChars or original.length() - position, whichever is smaller, starting at the optionally specified position. If position is not specified, the first position is used (i.e., position is set to 0). Return a reference providing modifiable access to this string. If numChars equals npos, then the remaining length of the string is erased (i.e., numChars is set to length() - position). Throw out_of_range if position > length().

◆ find() [1/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find ( CHAR_TYPE  character,
size_type  position = 0 
) const

Return the position of the first occurrence of the specified character, if such an occurrence can be found in this string (on or after the optionally specified position if such a position is specified), and return npos otherwise.

◆ find() [2/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  substring,
size_type  position = 0 
) const

Return the starting position of the first occurrence of the specified substring, if such a substring can be found in this string (on or after the optionally specified position if such a position is specified) using CHAR_TRAITS::eq to compare characters, and return npos otherwise.

◆ find() [3/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find ( const CHAR_TYPE *  substring,
size_type  position,
size_type  numChars 
) const

Return the starting position of the first occurrence of the specified substring of the optionally specified numChars length, if such a substring can be found in this string (on or after the optionally specified position if such a position is specified) using CHAR_TRAITS::eq to compare characters, and return npos otherwise. If numChars is not specified, CHAR_TRAITS::length(substring) is used.

◆ find() [4/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find ( const CHAR_TYPE *  substring,
size_type  position = 0 
) const

◆ find() [5/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find ( const STRING_VIEW_LIKE_TYPE &  substring,
size_type  position,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *   
) const

◆ find() [6/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find ( const STRING_VIEW_LIKE_TYPE &  substring,
size_type  position = 0,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *  = 0 
) const

Return the starting position of the first occurrence of the specified substring, if such a substring can be found in this string (on or after the optionally specified position if such a position is specified) using CHAR_TRAITS::eq to compare characters, and return npos otherwise.

Precondition
The behavior is undefined unless the conversion from STRING_VIEW_LIKE_TYPE to bsl::basic_string_view<CHAR_TYPE, CHAR_TRAITS> does not throw any exception.
Note
Note that this behavior differs from the behavior implemented in the standard container, where the following noexcept specification is used:
noexcept(
std::is_nothrow_convertible_v<const T&,
std::basic_string_view<CharT,
Traits> >)

◆ find_first_not_of() [1/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_not_of ( CHAR_TYPE  character,
size_type  position = 0 
) const

Return the position of the first occurrence of a character different from the specified character, if such an occurrence can be found in this string (on or after the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_first_not_of() [2/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_not_of ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  characterString,
size_type  position = 0 
) const

Return the position of the first occurrence of a character not belonging to the specified characterString, if such an occurrence can be found in this string (on or after the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_first_not_of() [3/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_not_of ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the position of the first occurrence of a character not belonging to the specified characterString of the optionally specified numChars length, if such an occurrence can be found in this string (on or after the optionally specified position if such a position is specified), and return npos otherwise. If numChars is not specified, CHAR_TRAITS::length(characterString) is used.

◆ find_first_not_of() [4/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_not_of ( const CHAR_TYPE *  characterString,
size_type  position = 0 
) const

◆ find_first_not_of() [5/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_not_of ( const STRING_VIEW_LIKE_TYPE &  characterString,
size_type  position,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *   
) const

◆ find_first_not_of() [6/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_not_of ( const STRING_VIEW_LIKE_TYPE &  characterString,
size_type  position = 0,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *  = 0 
) const

Return the position of the first occurrence of a character not belonging to the specified characterString, if such an occurrence can be found in this string (on or after the optionally specified position if such a position is specified), and return npos otherwise.

Precondition
The behavior is undefined unless the conversion from STRING_VIEW_LIKE_TYPE to bsl::basic_string_view<CHAR_TYPE, CHAR_TRAITS> does not throw any exception.
Note
Note that this behavior differs from the behavior implemented in the standard container, where the following noexcept specification is used:
noexcept(
std::is_nothrow_convertible_v<const T&,
std::basic_string_view<CharT,
Traits> >)

◆ find_first_of() [1/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_of ( CHAR_TYPE  character,
size_type  position = 0 
) const

Return the position of the first occurrence of the specified character, if such an occurrence can be found in this string (on or after the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_first_of() [2/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_of ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  characterString,
size_type  position = 0 
) const

Return the position of the first occurrence of a character belonging to the specified characterString, if such an occurrence can be found in this string (on or after the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_first_of() [3/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_of ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the position of the first occurrence of a character belonging to the specified characterString of the optionally specified numChars length, if such an occurrence can be found in this string (on or after the optionally specified position if such a position is specified), and return npos otherwise. If numChars is not specified, CHAR_TRAITS::length(characterString) is used.

◆ find_first_of() [4/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_of ( const CHAR_TYPE *  characterString,
size_type  position = 0 
) const

◆ find_first_of() [5/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_of ( const STRING_VIEW_LIKE_TYPE &  characterString,
size_type  position,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *   
) const

◆ find_first_of() [6/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_first_of ( const STRING_VIEW_LIKE_TYPE &  characterString,
size_type  position = 0,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *  = 0 
) const

Return the position of the first occurrence of a character belonging to the specified characterString, if such an occurrence can be found in this string (on or after the optionally specified position if such a position is specified), and return npos otherwise.

Precondition
The behavior is undefined unless the conversion from STRING_VIEW_LIKE_TYPE to bsl::basic_string_view<CHAR_TYPE, CHAR_TRAITS> does not throw any exception.
Note
Note that this behavior differs from the behavior implemented in the standard container, where the following noexcept specification is used:
noexcept(
std::is_nothrow_convertible_v<const T&,
std::basic_string_view<CharT,
Traits> >)

◆ find_last_not_of() [1/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_not_of ( CHAR_TYPE  character,
size_type  position = npos 
) const

Return the position of the last occurrence of a character different from the specified character, if such an occurrence can be found in this string (on or before the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_last_not_of() [2/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_not_of ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  characterString,
size_type  position = npos 
) const

Return the position of the last occurrence of a character not belonging to the specified characterString, if such an occurrence can be found in this string (on or before the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_last_not_of() [3/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_not_of ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the position of the last occurrence of a character not belonging to the specified characterString of the optionally specified numChars length, if such an occurrence can be found in this string (on or before the optionally specified position if such a position is specified), and return npos otherwise. If numChars is not specified, CHAR_TRAITS::length(characterString) is used.

◆ find_last_not_of() [4/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_not_of ( const CHAR_TYPE *  characterString,
size_type  position = npos 
) const

◆ find_last_not_of() [5/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_not_of ( const STRING_VIEW_LIKE_TYPE &  characterString,
size_type  position,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *   
) const

◆ find_last_not_of() [6/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_not_of ( const STRING_VIEW_LIKE_TYPE &  characterString,
size_type  position = npos,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *  = 0 
) const

Return the position of the last occurrence of a character not belonging to the specified characterString, if such an occurrence can be found in this string (on or before the optionally specified position if such a position is specified), and return npos otherwise.

Precondition
The behavior is undefined unless the conversion from STRING_VIEW_LIKE_TYPE to bsl::basic_string_view<CHAR_TYPE, CHAR_TRAITS> does not throw any exception.
Note
Note that this behavior differs from the behavior implemented in the standard container, where the following noexcept specification is used:
noexcept(
std::is_nothrow_convertible_v<const T&,
std::basic_string_view<CharT,
Traits> >)

◆ find_last_of() [1/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_of ( CHAR_TYPE  character,
size_type  position = npos 
) const

Return the position of the last occurrence of the specified character, if such an occurrence can be found in this string (on or before the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_last_of() [2/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_of ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  characterString,
size_type  position = npos 
) const

Return the position of the last occurrence of a character belonging to the specified characterString, if such an occurrence can be found in this string (on or before the optionally specified position if such a position is specified), and return npos otherwise.

◆ find_last_of() [3/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_of ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the position of the last occurrence of a character belonging to the specified characterString of the optionally specified numChars length, if such an occurrence can be found in this string (on or before the optionally specified position if such a position is specified), and return npos otherwise. If numChars is not specified, CHAR_TRAITS::length(characterString) is used.

◆ find_last_of() [4/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_of ( const CHAR_TYPE *  characterString,
size_type  position = npos 
) const

◆ find_last_of() [5/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_of ( const STRING_VIEW_LIKE_TYPE &  characterString,
size_type  position,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *   
) const

◆ find_last_of() [6/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::find_last_of ( const STRING_VIEW_LIKE_TYPE &  characterString,
size_type  position = npos,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *  = 0 
) const

Return the position of the last occurrence of a character belonging to the specified characterString, if such an occurrence can be found in this string (on or before the optionally specified position if such a position is specified), and return npos otherwise.

Precondition
The behavior is undefined unless the conversion from STRING_VIEW_LIKE_TYPE to bsl::basic_string_view<CHAR_TYPE, CHAR_TRAITS> does not throw any exception.
Note
Note that this behavior differs from the behavior implemented in the standard container, where the following noexcept specification is used:
noexcept(
std::is_nothrow_convertible_v<const T&,
std::basic_string_view<CharT,
Traits> >)

◆ front() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
CHAR_TYPE & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::front ( )
inline

Return a reference providing modifiable access to the character at the first position in this string.

Precondition
The behavior is undefined if this string is empty.

◆ front() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
const CHAR_TYPE & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::front ( ) const
inline

Return a reference providing non-modifiable access to the character at the first position in this string.

Precondition
The behavior is undefined if this string is empty.

◆ get_allocator()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::allocator_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::get_allocator ( ) const
inline

Return the allocator used by this string to supply memory.

◆ insert() [1/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( const_iterator  position,
CHAR_TYPE  character 
)

Insert the specified character at the specified position in this string, and return an iterator providing modifiable access to the inserted character.

Precondition
The behavior is undefined unless position is a valid iterator on this string.

◆ insert() [2/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( const_iterator  position,
INPUT_ITER  first,
INPUT_ITER  last 
)

Insert at the specified position in this string the characters in the range starting at the specified first iterator and ending right before the specified last iterator of the (template parameter) type INPUT_ITER, and return an iterator providing modifiable access to the first inserted character, or a non-const copy of position if first == last.

Precondition
The behavior is undefined unless position is a valid iterator on this string, and first and last refer to a sequence of valid values where first is at a position at or before last.

◆ insert() [3/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
BSLSTL_INSERT_RETURN_TYPE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( const_iterator  position,
INPUT_ITER  first,
INPUT_ITER  last 
)
inline

◆ insert() [4/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( const_iterator  position,
size_type  numChars,
CHAR_TYPE  character 
)
inline

Insert at the specified position in this string the specified numChars copies of the specified character, and return an iterator providing modifiable access to the first inserted character, or a non-const copy of position if 0 == numChars.

Precondition
The behavior is undefined unless position is a valid iterator on this string.

◆ insert() [5/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( size_type  position,
const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  other 
)

Insert at the specified position in this string a copy of the specified other string, and return a reference providing modifiable access to this string. Throw out_of_range if position > length().

◆ insert() [6/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( size_type  position,
const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  other,
size_type  sourcePosition,
size_type  numChars = npos 
)

Insert at the specified position in this string the optionally specified numChars characters starting at the specified sourcePosition in the specified other string, or the suffix of other starting at sourcePosition if sourcePosition + numChars > other.length(). If numChars is not specified, npos is used. Return a reference providing modifiable access to this string. Throw out_of_range if position > length() or sourcePosition > other.length().

◆ insert() [7/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( size_type  position,
const CHAR_TYPE *  characterString 
)

Insert at the specified position in this string the specified null-terminated characterString (of length CHAR_TRAITS::length(characterString)), and return a reference providing modifiable access to this string. Throw out_of_range if position > length().

◆ insert() [8/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( size_type  position,
const CHAR_TYPE *  characterString,
size_type  numChars 
)

Insert at the specified position in this string the specified initial numChars characters in the specified characterString, and return a reference providing modifiable access to this string. Throw out_of_range if position > length().

Precondition
The behavior is undefined unless characterString is at least numChars long.

◆ insert() [9/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( size_type  position,
const STRING_VIEW_LIKE_TYPE &  other 
)

Insert at the specified position in this string the bsl::string_view object, obtained from the specified other, and return a reference providing modifiable access to this string. Throw out_of_range if position > length(). Throw length_error if the length of the resulting string exceeds max_size().

◆ insert() [10/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( size_type  position,
const STRING_VIEW_LIKE_TYPE &  other,
size_type  sourcePosition,
size_type  numChars = npos 
)

Insert at the specified position in this string the optionally specified numChars characters starting at the specified sourcePosition in the bsl::string_view object, obtained from the specified other, or the suffix of this object starting at sourcePosition if sourcePosition + numChars > other.length(). If numChars is not specified, npos is used. Return a reference providing modifiable access to this string. Throw out_of_range if position > length() or sourcePosition > other.length(). Throw length_error if the length of the resulting string exceeds max_size().

◆ insert() [11/11]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert ( size_type  position,
size_type  numChars,
CHAR_TYPE  character 
)

Insert at the specified position in this string the specified numChars copies of the specified character, and return a reference providing modifiable access to this string. Throw out_of_range if position > length().

◆ insert_range() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class RANGE >
iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert_range ( const_iterator  position,
BSLS_COMPILERFEATURES_FORWARD_REF(RANGE)  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().

Precondition
The behavior is undefined unless position is an iterator in the range [begin() .. end()] (both endpoints included).
Note
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>

◆ insert_range() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class RANGE >
BSLSTL_INSERT_RETURN_TYPE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::insert_range ( const_iterator  position,
BSLS_COMPILERFEATURES_FORWARD_REF(RANGE)  range 
)
inline

◆ length()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::length ( ) const
inline

Return the length of this string.

Note
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.

◆ max_size()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::max_size ( ) const
inline

Return the maximal possible length of this string.

Note
Note that requests to create a string longer than this number of characters are guaranteed to raise a length_error exception.

◆ operator basic_string_view< CHAR_TYPE, CHAR_TRAITS >()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator basic_string_view< CHAR_TYPE, CHAR_TRAITS > ( ) const

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
Note that this conversion operator can be invoked implicitly (e.g., during argument passing).

◆ operator std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 >()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class ALLOC2 >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > ( ) const
inline

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
Note that this conversion operator can be invoked implicitly (e.g., during argument passing).

◆ operator+=() [1/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator+= ( CHAR_TYPE  character)

Append the specified character to this string, and return a reference providing modifiable access to this string.

◆ operator+=() [2/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator+= ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  rhs)

Append the specified rhs string to this string, and return a reference providing modifiable access to this string.

◆ operator+=() [3/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator+= ( const CHAR_TYPE *  rhs)

Append the specified null-terminated rhs string (of length CHAR_TRAITS::length(rhs)) to this string, and return a reference providing modifiable access to this string.

◆ operator+=() [4/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class ALLOC2 >
basic_string & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator+= ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &  rhs)

Append the specified rhs string to this string, and return a reference providing modifiable access to this string.

◆ operator+=() [5/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class ALLOC2 >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator+= ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &  rhs)

◆ operator+=() [6/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator+= ( const STRING_VIEW_LIKE_TYPE &  rhs)

Append the specified rhs to this string, and return a reference providing modifiable access to this string.

◆ operator=() [1/7]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator= ( BloombergLP::bslmf::MovableRef< basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > >  rhs)
inline

Assign to this string the value of the specified rhs string, propagate to this object the allocator of rhs if the ALLOCATOR type has trait propagate_on_container_move_assignment , and return a reference providing modifiable access to this string. The content of rhs is moved (in constant time) to this string if get_allocator() == rhs.get_allocator() (after accounting for the aforementioned trait). rhs is left in a valid but unspecified state.

◆ operator=() [2/7]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator= ( CHAR_TYPE  character)

Assign to this string the value of the string of length one consisting of the specified character, and return a reference providing modifiable access to this string.

◆ operator=() [3/7]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator= ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  rhs)

Assign to this string the value of the specified rhs string, propagate to this object the allocator of rhs if the ALLOCATOR type has trait propagate_on_container_copy_assignment , and return a reference providing modifiable access to this string.

◆ operator=() [4/7]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator= ( const CHAR_TYPE *  rhs)

Assign to this string the value of the specified null-terminated rhs string (of length CHAR_TRAITS::length(characterString)), and return a reference providing modifiable access to this string.

◆ operator=() [5/7]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class ALLOC2 >
basic_string & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator= ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &  rhs)

Assign to this string the value of the specified rhs string, and return a reference providing modifiable access to this string.

◆ operator=() [6/7]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class ALLOC2 >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator= ( const std::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOC2 > &  rhs)

◆ operator=() [7/7]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator= ( const STRING_VIEW_LIKE_TYPE &  rhs)

Assign to this string the value of the specified rhs object, and return a reference providing modifiable access to this string.

◆ operator[]() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::reference bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator[] ( size_type  position)
inline

Return a reference providing modifiable access to the character at the specified position in this string if position < length(), or a reference providing non-modifiable access to the null-terminating character if position == length().

Precondition
The behavior is undefined unless position <= length(), and, in the case of position == length(), the null-terminating character is not modified through the returned reference.

◆ operator[]() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_reference bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::operator[] ( size_type  position) const
inline

Return a reference providing non-modifiable access to the character at the specified position in this string.

Precondition
The behavior is undefined unless position <= length().
Note
Note that if position == length(), a reference to the null-terminating character is returned.

◆ pop_back()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
void bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::pop_back ( )
inline

Erase the last character from this string.

Precondition
The behavior is undefined if this string is empty.

◆ privateAppend() [1/5]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateAppend ( INPUT_ITER  first,
INPUT_ITER  last,
const char *  message 
)
inline

◆ privateAppend() [2/5]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateAppend ( INPUT_ITER  first,
SENTINEL  last,
const char *  message,
std::forward_iterator_tag  tag 
)
inline

◆ privateAppend() [3/5]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateAppend ( INPUT_ITER  first,
SENTINEL  last,
const char *  message,
std::input_iterator_tag  tag 
)
inline

◆ privateAppend() [4/5]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateAppend ( INPUT_ITER  first,
SENTINEL  last,
size_type  numChars,
const char *  message,
std::forward_iterator_tag   
)
inline

◆ privateAppend() [5/5]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateAppend ( INPUT_ITER  first,
SENTINEL  last,
size_type  numChars,
const char *  message,
std::input_iterator_tag   
)
inline

◆ privateAppendDispatch() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateAppendDispatch ( INPUT_ITER  first,
INPUT_ITER  last,
const char *  message,
BloombergLP::bslmf::MatchAnyType  ,
BloombergLP::bslmf::MatchAnyType   
)
inline

◆ privateAppendDispatch() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateAppendDispatch ( INPUT_ITER  first,
INPUT_ITER  last,
const char *  message,
BloombergLP::bslmf::MatchArithmeticType  ,
BloombergLP::bslmf::Nil   
)
inline

◆ privateAppendRange()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateAppendRange ( INPUT_ITER  first,
SENTINEL  last,
size_type  numChars,
const char *  message 
)
inline

◆ privateAssignDispatch()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class FIRST_TYPE , class SECOND_TYPE >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateAssignDispatch ( FIRST_TYPE  first,
SECOND_TYPE  second,
const char *  message 
)
inline

◆ privateAssignRangeDispatch()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateAssignRangeDispatch ( INPUT_ITER  first,
SENTINEL  last,
size_type  numChars,
const char *  message 
)
inline

◆ privateNumCharsInRange()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITERATOR , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateNumCharsInRange ( INPUT_ITERATOR  first,
SENTINEL  last 
) const

◆ privateReplace() [1/4]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateReplace ( size_type  outPosition,
size_type  outNumChars,
INPUT_ITER  first,
INPUT_ITER  last,
std::forward_iterator_tag  tag 
)

◆ privateReplace() [2/4]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateReplace ( size_type  outPosition,
size_type  outNumChars,
INPUT_ITER  first,
INPUT_ITER  last,
std::input_iterator_tag  tag 
)

◆ privateReplace() [3/4]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateReplace ( size_type  outPosition,
size_type  outNumChars,
size_type  inNumChars,
INPUT_ITER  first,
SENTINEL  last,
std::forward_iterator_tag   
)

◆ privateReplace() [4/4]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER , class SENTINEL >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateReplace ( size_type  outPosition,
size_type  outNumChars,
size_type  inNumChars,
INPUT_ITER  first,
SENTINEL  last,
std::input_iterator_tag   
)

◆ privateReplaceDispatch() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateReplaceDispatch ( size_type  position,
size_type  numChars,
INPUT_ITER  first,
INPUT_ITER  last,
BloombergLP::bslmf::MatchAnyType  ,
BloombergLP::bslmf::MatchAnyType   
)
inline

◆ privateReplaceDispatch() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateReplaceDispatch ( size_type  position,
size_type  numChars,
INPUT_ITER  first,
INPUT_ITER  last,
BloombergLP::bslmf::MatchArithmeticType  ,
BloombergLP::bslmf::Nil   
)
inline

◆ privateReplaceRange()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER , class SENTINEL >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::privateReplaceRange ( size_type  position,
size_type  outNumChars,
size_type  inNumChars,
INPUT_ITER  first,
SENTINEL  last 
)

◆ push_back()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
void bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::push_back ( CHAR_TYPE  character)

Append the specified character to this string.

◆ rbegin() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::reverse_iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rbegin ( )
inline

Return a reverse iterator referring to the last character in this modifiable string (or the past-the-end reverse iterator if this string is empty).

◆ rbegin() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_reverse_iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rbegin ( ) const
inline

◆ rend() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::reverse_iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rend ( )
inline

Return the past-the-end reverse iterator for this modifiable string.

◆ rend() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_reverse_iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rend ( ) const

◆ replace() [1/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( const_iterator  first,
const_iterator  last,
const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  replacement 
)

Replace the substring in the range starting at the specified first position and ending right before the specified last position with the specified replacement string. Return a reference providing modifiable access to this string.

Precondition
The behavior is undefined unless first and last are both within the range [cbegin() .. cend()] and first <= last.

◆ replace() [2/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( const_iterator  first,
const_iterator  last,
const CHAR_TYPE *  characterString 
)

Replace the substring in the range starting at the specified first position and ending right before the specified last position with the specified null-terminated characterString (of length CHAR_TRAITS::length(characterString)). Return a reference providing modifiable access to this string.

Precondition
The behavior is undefined unless first and last are both within the range [cbegin() .. cend()] and first <= last.

◆ replace() [3/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( const_iterator  first,
const_iterator  last,
const CHAR_TYPE *  characterString,
size_type  numChars 
)

Replace the substring in the range starting at the specified first position and ending right before the specified last position with the specified initial numChars characters in the specified characterString. Return a reference providing modifiable access to this string.

Precondition
The behavior is undefined unless first and last are both within the range [cbegin() .. cend()], first <= last, and characterString is at least numChars long.

◆ replace() [4/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( const_iterator  first,
const_iterator  last,
const STRING_VIEW_LIKE_TYPE &  replacement 
)

Replace the substring in the range starting at the specified first position and ending right before the specified last position with the specified replacement. Return a reference providing modifiable access to this string.

Precondition
The behavior is undefined unless first and last are both within the range [cbegin() .. cend()] and first <= last.

◆ replace() [5/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( const_iterator  first,
const_iterator  last,
INPUT_ITER  stringFirst,
INPUT_ITER  stringLast 
)

Replace the substring in the range starting at the specified first position and ending right before the specified last position with the characters in the range starting at the specified stringFirst and ending right before the specified stringLast iterator, both of the (template parameter) type INPUT_ITER. Return a reference providing modifiable access to this string.

Precondition
The behavior is undefined unless first and last are both within the range [cbegin() .. cend()], first <= last, and stringFirst and stringLast refer to a sequence of valid values where stringFirst is at a position at or before stringLast.

◆ replace() [6/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class INPUT_ITER >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( const_iterator  first,
const_iterator  last,
INPUT_ITER  stringFirst,
INPUT_ITER  stringLast 
)
inline

◆ replace() [7/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( const_iterator  first,
const_iterator  last,
size_type  numChars,
CHAR_TYPE  character 
)

Replace the substring in the range starting at the specified first position and ending right before the specified last position with the specified numChars copies of the specified character. Return a reference providing modifiable access to this string.

Precondition
The behavior is undefined unless first and last are both within the range [cbegin() .. cend()] and first <= last.

◆ replace() [8/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( size_type  outPosition,
size_type  outNumChars,
const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  replacement 
)

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the specified replacement string, and return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length().

◆ replace() [9/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( size_type  outPosition,
size_type  outNumChars,
const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  replacement,
size_type  position,
size_type  numChars = npos 
)

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the optionally specified numChars characters starting at the specified position in the specified replacement string (or the suffix of replacement starting at position if position + numChars > replacement.length()). If numChars is not specified, npos is used. Return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length() or position > replacement.length().

◆ replace() [10/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( size_type  outPosition,
size_type  outNumChars,
const CHAR_TYPE *  characterString 
)

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the specified null-terminated characterString (of length CHAR_TRAITS::length(characterString)). Return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length().

◆ replace() [11/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( size_type  outPosition,
size_type  outNumChars,
const CHAR_TYPE *  characterString,
size_type  numChars 
)

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the specified initial numChars characters in the specified characterString. Return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length().

Precondition
The behavior is undefined unless characterString is at least numChars long.

◆ replace() [12/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( size_type  outPosition,
size_type  outNumChars,
const STRING_VIEW_LIKE_TYPE &  replacement 
)

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the specified replacement, and return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length().

◆ replace() [13/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( size_type  outPosition,
size_type  outNumChars,
const STRING_VIEW_LIKE_TYPE &  replacement,
size_type  position,
size_type  numChars = npos 
)

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the optionally specified numChars characters starting at the specified position in the specified replacement (or the suffix of replacement starting at position if position + numChars > replacement.length()). If numChars is not specified, npos is used. Return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length() or position > replacement.length().

◆ replace() [14/14]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace ( size_type  outPosition,
size_type  outNumChars,
size_type  numChars,
CHAR_TYPE  character 
)

Replace the specified outNumChars characters starting at the specified outPosition in this string (or the suffix of this string starting at outPosition if outPosition + outNumChars > length()) with the specified numChars copies of the specified character. Return a reference providing modifiable access to this string. Throw out_of_range if outPosition > length().

◆ replace_with_range() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class RANGE >
basic_string & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace_with_range ( const_iterator  first,
const_iterator  last,
BSLS_COMPILERFEATURES_FORWARD_REF(RANGE)  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.

Precondition
The behavior is undefined unless first and last are both within the range [cbegin() .. cend()].
Note
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.

◆ replace_with_range() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class RANGE >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > & bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::replace_with_range ( const_iterator  first,
const_iterator  last,
BSLS_COMPILERFEATURES_FORWARD_REF(RANGE)  range 
)
inline

◆ reserve()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE void bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::reserve ( size_type  newCapacity)

Change the capacity of this string to the specified newCapacity.

Note
Note that the capacity of a string is the maximum length it can accommodate without reallocation. The actual storage allocated may be higher.

◆ resize() [1/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE void bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::resize ( size_type  newLength)

Change the length of this string to the specified newLength, erasing characters at the end if newLength < length() or appending the appropriate number of copies of CHAR_TYPE() at the end if length() < newLength.

◆ resize() [2/2]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE void bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::resize ( size_type  newLength,
CHAR_TYPE  character 
)

Change the length of this string to the specified newLength, erasing characters at the end if newLength < length() or appending the appropriate number of copies of the specified character at the end if length() < newLength.

◆ resize_and_overwrite()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class OPERATION >
void bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::resize_and_overwrite ( size_type  newLength,
OPERATION  operation 
)

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().

Precondition
The behavior is undefined unless the value returned by the operation is less than or equal to newLength.

◆ rfind() [1/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rfind ( CHAR_TYPE  character,
size_type  position = npos 
) const

Return the position of the last occurrence of the specified character, if such an occurrence can be found in this string (on or before the optionally specified position if such a position is specified), and return npos otherwise.

◆ rfind() [2/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rfind ( const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > &  substring,
size_type  position = npos 
) const

Return the starting position of the last occurrence of the specified substring within this string, if such a sequence can be found in this string (on or before the optionally specified position if such a position is specified) using CHAR_TRAITS::eq to compare characters, and return npos otherwise.

◆ rfind() [3/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rfind ( const CHAR_TYPE *  characterString,
size_type  position,
size_type  numChars 
) const

Return the starting position of the last occurrence of a substring whose value equals that of the specified characterString of the optionally specified numChars length, if such a substring can be found in this string (on or before the optionally specified position if such a position is specified), and return npos otherwise. If numChars is not specified, CHAR_TRAITS::length(characterString) is used.

◆ rfind() [4/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rfind ( const CHAR_TYPE *  characterString,
size_type  position = npos 
) const

◆ rfind() [5/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rfind ( const STRING_VIEW_LIKE_TYPE &  substring,
size_type  position,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *   
) const

◆ rfind() [6/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
template<class STRING_VIEW_LIKE_TYPE >
size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::rfind ( const STRING_VIEW_LIKE_TYPE &  substring,
size_type  position = npos,
BSLSTL_STRINGVIEWLIKEPARAM_ONLY_ENABLE_IF_T(void) *  = 0 
) const

Return the starting position of the last occurrence of the specified substring within this string, if such a sequence can be found in this string (on or before the optionally specified position if such a position is specified) using CHAR_TRAITS::eq to compare characters, and return npos otherwise.

Precondition
The behavior is undefined unless the conversion from STRING_VIEW_LIKE_TYPE to bsl::basic_string_view<CHAR_TYPE, CHAR_TRAITS> does not throw any exception.
Note
Note that this behavior differs from the behavior implemented in the standard container, where the following noexcept specification is used:
noexcept(
std::is_nothrow_convertible_v<const T&,
std::basic_string_view<CharT,
Traits> >)

◆ shrink_to_fit()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE void bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::shrink_to_fit ( )

Request the removal of unused capacity by causing reallocation.

Note
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.

◆ size()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size ( ) const
inline

Return the length of this string.

Note
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.

◆ starts_with() [1/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bool bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::starts_with ( basic_string_view< CHAR_TYPE, CHAR_TRAITS characterString) const

Return true if the length of this string is equal to or greater than the length of the specified characterString and the first characterString.length() characters of this string are equal to the characters of the characterString, and false otherwise. CHAR_TRAITS::compare is used to compare characters. See {Lexicographical Comparisons}.

◆ starts_with() [2/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bool bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::starts_with ( CHAR_TYPE  character) const

Return true if this string contains at least one symbol and the last symbol of this string is equal to the specified character, and false otherwise. CHAR_TRAITS::eq is used to compare characters. See {Lexicographical Comparisons}.

◆ starts_with() [3/3]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE bool bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::starts_with ( const CHAR_TYPE *  characterString) const

Return true if the length of this string is equal to or greater than the length of the specified characterString and the first CHAR_TRAITS::length(characterString) characters of this string are equal to the characters of the characterString, and false otherwise. CHAR_TRAITS::compare is used to compare characters. See {Lexicographical Comparisons}.

◆ substr()

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
BSLS_PLATFORM_AGGRESSIVE_INLINE basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR > bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::substr ( size_type  position = 0,
size_type  numChars = npos 
) const

Return a string whose value is the substring starting at the optionally specified position in this string, of length the optionally specified numChars or length() - position, whichever is smaller. If position is not specified, 0 is used (i.e., the substring is from the beginning of this string). If numChars is not specified, npos is used (i.e., the entire suffix from position to the end of the string is returned).

Friends And Related Symbol Documentation

◆ String_ClearProctor< basic_string >

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
friend class String_ClearProctor< basic_string >
friend

String_ClearProctor is made friend to allow access to internal buffer and length.

◆ to_string [1/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
string to_string ( int  )
friend

to_string functions are made friends to allow access to the internal short string buffer.

Constructs a string with contents equal to the specified value. The contents of the string will be the same as what std::sprintf(buf, "%d", value) would produce with a sufficiently large buffer.

◆ to_string [2/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
string to_string ( long long  )
friend

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.

◆ to_string [3/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
string to_string ( long  )
friend

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.

◆ to_string [4/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
string to_string ( unsigned long long  )
friend

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.

◆ to_string [5/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
string to_string ( unsigned long  )
friend

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.

◆ to_string [6/6]

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
string to_string ( unsigned  )
friend

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.

Member Data Documentation

◆ begin

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::const_iterator bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::begin
inline

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
Note that this methods 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.

◆ npos

template<class CHAR_TYPE , class CHAR_TRAITS , class ALLOCATOR >
const basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::size_type bsl::basic_string< CHAR_TYPE, CHAR_TRAITS, ALLOCATOR >::npos = ~size_type(0)
static

Value used to denote "not-a-position", guaranteed to be outside the range [0 .. max_size()].


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