The sequences controlled by an object of template class basic_string are the Standard C++ string class and are usually referred to as strings, but they should not be confused with the null-terminated C-strings used throughout the Standard C++ Library. The string class is a container that enables the use of strings as normal types, such as using comparison and concatenation operations, iterators, and STL algorithms and copying and assigning with class allocator managed memory.
For a list of all members of this type, see basic_string Members.
template < class CharType, class Traits=char_traits<CharType>, class Allocator=allocator<CharType> > class basic_string
Many member functions require an operand sequence of elements. You can specify such an operand sequence several ways.
One element with character value _Ch.
A repetition of _Count elements each with value _Ch.
A null-terminated sequence, such as a C string, with a CharType of type char, beginning at _Ptr (which must not be a null pointer), where the terminating element is the value value_type and is not part of the operand sequence.
A sequence of _Count elements beginning at _Ptr.
The sequence specified by a basic_string object.
_Str, _Off, _Count
The substring of the basic_string object _Str with up to _Count elements (or through the end of the string, whichever comes first) beginning at position _Off.
A sequence of elements delimited by the iterators _First and _Last, in the range [_First, _Last), which may overlap the sequence controlled by the string object whose member function is being called.
If a position argument (such as _Off) is beyond the end of the string on a call to a basic_string member function, the function reports an out-of-range error by throwing an object of type out_of_range Class.
References, pointers, and iterators that designate elements of the controlled sequence can become invalid after any call to a function that alters the controlled sequence, or after the first call to a non-const member function.