.TH "std::basic_string< _CharT, _Traits, _Alloc >" 3cxx "Tue Jul 2 2019" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::basic_string< _CharT, _Traits, _Alloc > \- Managing sequences of characters and character-like objects\&. .SH SYNOPSIS .br .PP .SS "Public Types" .in +1c .ti -1c .RI "typedef _Alloc \fBallocator_type\fP" .br .ti -1c .RI "typedef __gnu_cxx::__normal_iterator< const_pointer, \fBbasic_string\fP > \fBconst_iterator\fP" .br .ti -1c .RI "typedef _CharT_alloc_type::const_pointer \fBconst_pointer\fP" .br .ti -1c .RI "typedef _CharT_alloc_type::const_reference \fBconst_reference\fP" .br .ti -1c .RI "typedef \fBstd::reverse_iterator\fP< const_iterator > \fBconst_reverse_iterator\fP" .br .ti -1c .RI "typedef _CharT_alloc_type::difference_type \fBdifference_type\fP" .br .ti -1c .RI "typedef __gnu_cxx::__normal_iterator< pointer, \fBbasic_string\fP > \fBiterator\fP" .br .ti -1c .RI "typedef _CharT_alloc_type::pointer \fBpointer\fP" .br .ti -1c .RI "typedef _CharT_alloc_type::reference \fBreference\fP" .br .ti -1c .RI "typedef \fBstd::reverse_iterator\fP< iterator > \fBreverse_iterator\fP" .br .ti -1c .RI "typedef _CharT_alloc_type::size_type \fBsize_type\fP" .br .ti -1c .RI "typedef _Traits \fBtraits_type\fP" .br .ti -1c .RI "typedef _Traits::char_type \fBvalue_type\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBbasic_string\fP ()" .br .RI "Default constructor creates an empty string\&. " .ti -1c .RI "\fBbasic_string\fP (const _Alloc &__a)" .br .RI "Construct an empty string using allocator \fIa\fP\&. " .ti -1c .RI "\fBbasic_string\fP (const \fBbasic_string\fP &__str)" .br .RI "Construct string with copy of value of \fIstr\fP\&. " .ti -1c .RI "\fBbasic_string\fP (const \fBbasic_string\fP &__str, size_type __pos, const _Alloc &__a=_Alloc())" .br .RI "Construct string as copy of a substring\&. " .ti -1c .RI "\fBbasic_string\fP (const \fBbasic_string\fP &__str, size_type __pos, size_type __n)" .br .RI "Construct string as copy of a substring\&. " .ti -1c .RI "\fBbasic_string\fP (const \fBbasic_string\fP &__str, size_type __pos, size_type __n, const _Alloc &__a)" .br .RI "Construct string as copy of a substring\&. " .ti -1c .RI "\fBbasic_string\fP (const _CharT *__s, size_type __n, const _Alloc &__a=_Alloc())" .br .RI "Construct string initialized by a character array\&. " .ti -1c .RI "\fBbasic_string\fP (const _CharT *__s, const _Alloc &__a=_Alloc())" .br .RI "Construct string as copy of a C string\&. " .ti -1c .RI "\fBbasic_string\fP (size_type __n, _CharT __c, const _Alloc &__a=_Alloc())" .br .RI "Construct string as multiple characters\&. " .ti -1c .RI "\fBbasic_string\fP (\fBbasic_string\fP &&__str) noexcept" .br .RI "Move construct string\&. " .ti -1c .RI "\fBbasic_string\fP (\fBinitializer_list\fP< _CharT > __l, const _Alloc &__a=_Alloc())" .br .RI "Construct string from an initializer list\&. " .ti -1c .RI "template \fBbasic_string\fP (_InputIterator __beg, _InputIterator __end, const _Alloc &__a=_Alloc())" .br .RI "Construct string as copy of a range\&. " .ti -1c .RI "\fB~basic_string\fP () noexcept" .br .RI "Destroy the string instance\&. " .ti -1c .RI "template \fBbasic_string\fP< _CharT, _Traits, _Alloc > & \fB_M_replace_dispatch\fP (iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2, __false_type)" .br .ti -1c .RI "template _CharT * \fB_S_construct\fP (_InIterator __beg, _InIterator __end, const _Alloc &__a, \fBforward_iterator_tag\fP)" .br .ti -1c .RI "\fBbasic_string\fP & \fBappend\fP (const \fBbasic_string\fP &__str)" .br .RI "Append a string to this string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBappend\fP (const \fBbasic_string\fP &__str, size_type __pos, size_type __n=\fBnpos\fP)" .br .RI "Append a substring\&. " .ti -1c .RI "\fBbasic_string\fP & \fBappend\fP (const _CharT *__s, size_type __n)" .br .RI "Append a C substring\&. " .ti -1c .RI "\fBbasic_string\fP & \fBappend\fP (const _CharT *__s)" .br .RI "Append a C string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBappend\fP (size_type __n, _CharT __c)" .br .RI "Append multiple characters\&. " .ti -1c .RI "\fBbasic_string\fP & \fBappend\fP (\fBinitializer_list\fP< _CharT > __l)" .br .RI "Append an initializer_list of characters\&. " .ti -1c .RI "template \fBbasic_string\fP & \fBappend\fP (_InputIterator __first, _InputIterator __last)" .br .RI "Append a range of characters\&. " .ti -1c .RI "\fBbasic_string\fP & \fBassign\fP (const \fBbasic_string\fP &__str)" .br .RI "Set value to contents of another string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBassign\fP (\fBbasic_string\fP &&__str)" .br .RI "Set value to contents of another string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBassign\fP (const \fBbasic_string\fP &__str, size_type __pos, size_type __n=\fBnpos\fP)" .br .RI "Set value to a substring of a string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBassign\fP (const _CharT *__s, size_type __n)" .br .RI "Set value to a C substring\&. " .ti -1c .RI "\fBbasic_string\fP & \fBassign\fP (const _CharT *__s)" .br .RI "Set value to contents of a C string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBassign\fP (size_type __n, _CharT __c)" .br .RI "Set value to multiple characters\&. " .ti -1c .RI "template \fBbasic_string\fP & \fBassign\fP (_InputIterator __first, _InputIterator __last)" .br .RI "Set value to a range of characters\&. " .ti -1c .RI "\fBbasic_string\fP & \fBassign\fP (\fBinitializer_list\fP< _CharT > __l)" .br .RI "Set value to an initializer_list of characters\&. " .ti -1c .RI "const_reference \fBat\fP (size_type __n) const" .br .RI "Provides access to the data contained in the string\&. " .ti -1c .RI "reference \fBat\fP (size_type __n)" .br .RI "Provides access to the data contained in the string\&. " .ti -1c .RI "reference \fBback\fP ()" .br .ti -1c .RI "const_reference \fBback\fP () const noexcept" .br .ti -1c .RI "iterator \fBbegin\fP ()" .br .ti -1c .RI "const_iterator \fBbegin\fP () const noexcept" .br .ti -1c .RI "const _CharT * \fBc_str\fP () const noexcept" .br .RI "Return const pointer to null-terminated contents\&. " .ti -1c .RI "size_type \fBcapacity\fP () const noexcept" .br .ti -1c .RI "const_iterator \fBcbegin\fP () const noexcept" .br .ti -1c .RI "const_iterator \fBcend\fP () const noexcept" .br .ti -1c .RI "void \fBclear\fP () noexcept" .br .ti -1c .RI "int \fBcompare\fP (const \fBbasic_string\fP &__str) const" .br .RI "Compare to a string\&. " .ti -1c .RI "int \fBcompare\fP (size_type __pos, size_type __n, const \fBbasic_string\fP &__str) const" .br .RI "Compare substring to a string\&. " .ti -1c .RI "int \fBcompare\fP (size_type __pos1, size_type __n1, const \fBbasic_string\fP &__str, size_type __pos2, size_type __n2=\fBnpos\fP) const" .br .RI "Compare substring to a substring\&. " .ti -1c .RI "int \fBcompare\fP (const _CharT *__s) const noexcept" .br .RI "Compare to a C string\&. " .ti -1c .RI "int \fBcompare\fP (size_type __pos, size_type __n1, const _CharT *__s) const" .br .RI "Compare substring to a C string\&. " .ti -1c .RI "int \fBcompare\fP (size_type __pos, size_type __n1, const _CharT *__s, size_type __n2) const" .br .RI "Compare substring against a character array\&. " .ti -1c .RI "size_type \fBcopy\fP (_CharT *__s, size_type __n, size_type __pos=0) const" .br .RI "Copy substring into C string\&. " .ti -1c .RI "\fBconst_reverse_iterator\fP \fBcrbegin\fP () const noexcept" .br .ti -1c .RI "\fBconst_reverse_iterator\fP \fBcrend\fP () const noexcept" .br .ti -1c .RI "const _CharT * \fBdata\fP () const noexcept" .br .RI "Return const pointer to contents\&. " .ti -1c .RI "bool \fBempty\fP () const noexcept" .br .ti -1c .RI "iterator \fBend\fP ()" .br .ti -1c .RI "const_iterator \fBend\fP () const noexcept" .br .ti -1c .RI "\fBbasic_string\fP & \fBerase\fP (size_type __pos=0, size_type __n=\fBnpos\fP)" .br .RI "Remove characters\&. " .ti -1c .RI "iterator \fBerase\fP (iterator __position)" .br .RI "Remove one character\&. " .ti -1c .RI "iterator \fBerase\fP (iterator __first, iterator __last)" .br .RI "Remove a range of characters\&. " .ti -1c .RI "size_type \fBfind\fP (const _CharT *__s, size_type __pos, size_type __n) const noexcept" .br .RI "Find position of a C substring\&. " .ti -1c .RI "size_type \fBfind\fP (const \fBbasic_string\fP &__str, size_type __pos=0) const noexcept" .br .RI "Find position of a string\&. " .ti -1c .RI "size_type \fBfind\fP (const _CharT *__s, size_type __pos=0) const noexcept" .br .RI "Find position of a C string\&. " .ti -1c .RI "size_type \fBfind\fP (_CharT __c, size_type __pos=0) const noexcept" .br .RI "Find position of a character\&. " .ti -1c .RI "size_type \fBfind_first_not_of\fP (const \fBbasic_string\fP &__str, size_type __pos=0) const noexcept" .br .RI "Find position of a character not in string\&. " .ti -1c .RI "size_type \fBfind_first_not_of\fP (const _CharT *__s, size_type __pos, size_type __n) const noexcept" .br .RI "Find position of a character not in C substring\&. " .ti -1c .RI "size_type \fBfind_first_not_of\fP (const _CharT *__s, size_type __pos=0) const noexcept" .br .RI "Find position of a character not in C string\&. " .ti -1c .RI "size_type \fBfind_first_not_of\fP (_CharT __c, size_type __pos=0) const noexcept" .br .RI "Find position of a different character\&. " .ti -1c .RI "size_type \fBfind_first_of\fP (const \fBbasic_string\fP &__str, size_type __pos=0) const noexcept" .br .RI "Find position of a character of string\&. " .ti -1c .RI "size_type \fBfind_first_of\fP (const _CharT *__s, size_type __pos, size_type __n) const noexcept" .br .RI "Find position of a character of C substring\&. " .ti -1c .RI "size_type \fBfind_first_of\fP (const _CharT *__s, size_type __pos=0) const noexcept" .br .RI "Find position of a character of C string\&. " .ti -1c .RI "size_type \fBfind_first_of\fP (_CharT __c, size_type __pos=0) const noexcept" .br .RI "Find position of a character\&. " .ti -1c .RI "size_type \fBfind_last_not_of\fP (const \fBbasic_string\fP &__str, size_type __pos=\fBnpos\fP) const noexcept" .br .RI "Find last position of a character not in string\&. " .ti -1c .RI "size_type \fBfind_last_not_of\fP (const _CharT *__s, size_type __pos, size_type __n) const noexcept" .br .RI "Find last position of a character not in C substring\&. " .ti -1c .RI "size_type \fBfind_last_not_of\fP (const _CharT *__s, size_type __pos=\fBnpos\fP) const noexcept" .br .RI "Find last position of a character not in C string\&. " .ti -1c .RI "size_type \fBfind_last_not_of\fP (_CharT __c, size_type __pos=\fBnpos\fP) const noexcept" .br .RI "Find last position of a different character\&. " .ti -1c .RI "size_type \fBfind_last_of\fP (const \fBbasic_string\fP &__str, size_type __pos=\fBnpos\fP) const noexcept" .br .RI "Find last position of a character of string\&. " .ti -1c .RI "size_type \fBfind_last_of\fP (const _CharT *__s, size_type __pos, size_type __n) const noexcept" .br .RI "Find last position of a character of C substring\&. " .ti -1c .RI "size_type \fBfind_last_of\fP (const _CharT *__s, size_type __pos=\fBnpos\fP) const noexcept" .br .RI "Find last position of a character of C string\&. " .ti -1c .RI "size_type \fBfind_last_of\fP (_CharT __c, size_type __pos=\fBnpos\fP) const noexcept" .br .RI "Find last position of a character\&. " .ti -1c .RI "reference \fBfront\fP ()" .br .ti -1c .RI "const_reference \fBfront\fP () const noexcept" .br .ti -1c .RI "allocator_type \fBget_allocator\fP () const noexcept" .br .RI "Return copy of allocator used to construct this string\&. " .ti -1c .RI "void \fBinsert\fP (iterator __p, size_type __n, _CharT __c)" .br .RI "Insert multiple characters\&. " .ti -1c .RI "template void \fBinsert\fP (iterator __p, _InputIterator __beg, _InputIterator __end)" .br .RI "Insert a range of characters\&. " .ti -1c .RI "void \fBinsert\fP (iterator __p, \fBinitializer_list\fP< _CharT > __l)" .br .RI "Insert an initializer_list of characters\&. " .ti -1c .RI "\fBbasic_string\fP & \fBinsert\fP (size_type __pos1, const \fBbasic_string\fP &__str)" .br .RI "Insert value of a string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBinsert\fP (size_type __pos1, const \fBbasic_string\fP &__str, size_type __pos2, size_type __n=\fBnpos\fP)" .br .RI "Insert a substring\&. " .ti -1c .RI "\fBbasic_string\fP & \fBinsert\fP (size_type __pos, const _CharT *__s, size_type __n)" .br .RI "Insert a C substring\&. " .ti -1c .RI "\fBbasic_string\fP & \fBinsert\fP (size_type __pos, const _CharT *__s)" .br .RI "Insert a C string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBinsert\fP (size_type __pos, size_type __n, _CharT __c)" .br .RI "Insert multiple characters\&. " .ti -1c .RI "iterator \fBinsert\fP (iterator __p, _CharT __c)" .br .RI "Insert one character\&. " .ti -1c .RI "size_type \fBlength\fP () const noexcept" .br .RI "Returns the number of characters in the string, not including any null-termination\&. " .ti -1c .RI "size_type \fBmax_size\fP () const noexcept" .br .RI "Returns the size() of the largest possible string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBoperator+=\fP (const \fBbasic_string\fP &__str)" .br .RI "Append a string to this string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBoperator+=\fP (const _CharT *__s)" .br .RI "Append a C string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBoperator+=\fP (_CharT __c)" .br .RI "Append a character\&. " .ti -1c .RI "\fBbasic_string\fP & \fBoperator+=\fP (\fBinitializer_list\fP< _CharT > __l)" .br .RI "Append an initializer_list of characters\&. " .ti -1c .RI "\fBbasic_string\fP & \fBoperator=\fP (const \fBbasic_string\fP &__str)" .br .RI "Assign the value of \fIstr\fP to this string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBoperator=\fP (const _CharT *__s)" .br .RI "Copy contents of \fIs\fP into this string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBoperator=\fP (_CharT __c)" .br .RI "Set value to string of length 1\&. " .ti -1c .RI "\fBbasic_string\fP & \fBoperator=\fP (\fBbasic_string\fP &&__str)" .br .RI "Move assign the value of \fIstr\fP to this string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBoperator=\fP (\fBinitializer_list\fP< _CharT > __l)" .br .RI "Set value to string constructed from initializer list\&. " .ti -1c .RI "const_reference \fBoperator[]\fP (size_type __pos) const noexcept" .br .RI "Subscript access to the data contained in the string\&. " .ti -1c .RI "reference \fBoperator[]\fP (size_type __pos)" .br .RI "Subscript access to the data contained in the string\&. " .ti -1c .RI "void \fBpop_back\fP ()" .br .RI "Remove the last character\&. " .ti -1c .RI "void \fBpush_back\fP (_CharT __c)" .br .RI "Append a single character\&. " .ti -1c .RI "\fBreverse_iterator\fP \fBrbegin\fP ()" .br .ti -1c .RI "\fBconst_reverse_iterator\fP \fBrbegin\fP () const noexcept" .br .ti -1c .RI "\fBreverse_iterator\fP \fBrend\fP ()" .br .ti -1c .RI "\fBconst_reverse_iterator\fP \fBrend\fP () const noexcept" .br .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (size_type __pos, size_type __n, const \fBbasic_string\fP &__str)" .br .RI "Replace characters with value from another string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (size_type __pos1, size_type __n1, const \fBbasic_string\fP &__str, size_type __pos2, size_type __n2=\fBnpos\fP)" .br .RI "Replace characters with value from another string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (size_type __pos, size_type __n1, const _CharT *__s, size_type __n2)" .br .RI "Replace characters with value of a C substring\&. " .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (size_type __pos, size_type __n1, const _CharT *__s)" .br .RI "Replace characters with value of a C string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (size_type __pos, size_type __n1, size_type __n2, _CharT __c)" .br .RI "Replace characters with multiple characters\&. " .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (iterator __i1, iterator __i2, const \fBbasic_string\fP &__str)" .br .RI "Replace range of characters with string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (iterator __i1, iterator __i2, const _CharT *__s, size_type __n)" .br .RI "Replace range of characters with C substring\&. " .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (iterator __i1, iterator __i2, const _CharT *__s)" .br .RI "Replace range of characters with C string\&. " .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (iterator __i1, iterator __i2, size_type __n, _CharT __c)" .br .RI "Replace range of characters with multiple characters\&. " .ti -1c .RI "template \fBbasic_string\fP & \fBreplace\fP (iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2)" .br .RI "Replace range of characters with range\&. " .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (iterator __i1, iterator __i2, _CharT *__k1, _CharT *__k2)" .br .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (iterator __i1, iterator __i2, const _CharT *__k1, const _CharT *__k2)" .br .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (iterator __i1, iterator __i2, iterator __k1, iterator __k2)" .br .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2)" .br .ti -1c .RI "\fBbasic_string\fP & \fBreplace\fP (iterator __i1, iterator __i2, \fBinitializer_list\fP< _CharT > __l)" .br .RI "Replace range of characters with initializer_list\&. " .ti -1c .RI "void \fBreserve\fP (size_type __res_arg=0)" .br .RI "Attempt to preallocate enough memory for specified number of characters\&. " .ti -1c .RI "void \fBresize\fP (size_type __n, _CharT __c)" .br .RI "Resizes the string to the specified number of characters\&. " .ti -1c .RI "void \fBresize\fP (size_type __n)" .br .RI "Resizes the string to the specified number of characters\&. " .ti -1c .RI "size_type \fBrfind\fP (const \fBbasic_string\fP &__str, size_type __pos=\fBnpos\fP) const noexcept" .br .RI "Find last position of a string\&. " .ti -1c .RI "size_type \fBrfind\fP (const _CharT *__s, size_type __pos, size_type __n) const noexcept" .br .RI "Find last position of a C substring\&. " .ti -1c .RI "size_type \fBrfind\fP (const _CharT *__s, size_type __pos=\fBnpos\fP) const noexcept" .br .RI "Find last position of a C string\&. " .ti -1c .RI "size_type \fBrfind\fP (_CharT __c, size_type __pos=\fBnpos\fP) const noexcept" .br .RI "Find last position of a character\&. " .ti -1c .RI "void \fBshrink_to_fit\fP () noexcept" .br .RI "A non-binding request to reduce capacity() to size()\&. " .ti -1c .RI "size_type \fBsize\fP () const noexcept" .br .RI "Returns the number of characters in the string, not including any null-termination\&. " .ti -1c .RI "\fBbasic_string\fP \fBsubstr\fP (size_type __pos=0, size_type __n=\fBnpos\fP) const" .br .RI "Get a substring\&. " .ti -1c .RI "void \fBswap\fP (\fBbasic_string\fP &__s)" .br .RI "Swap contents with another string\&. " .in -1c .SS "Static Public Attributes" .in +1c .ti -1c .RI "static const size_type \fBnpos\fP" .br .RI "Value returned by various member functions when they fail\&. " .in -1c .SH "Detailed Description" .PP .SS "template .br class std::basic_string< _CharT, _Traits, _Alloc >" Managing sequences of characters and character-like objects\&. .PP \fBTemplate Parameters:\fP .RS 4 \fI_CharT\fP Type of character .br \fI_Traits\fP Traits for character type, defaults to char_traits<_CharT>\&. .br \fI_Alloc\fP Allocator type, defaults to allocator<_CharT>\&. .RE .PP Meets the requirements of a \fCcontainer\fP, a \fCreversible container\fP, and a \fCsequence\fP\&. Of the \fCoptional sequence requirements\fP, only \fCpush_back\fP, \fCat\fP, and \fCarray\fP access are supported\&. .PP \fBTodo\fP .RS 4 Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html .RE .PP .PP Documentation? What's that? Nathan Myers ncm@cantrip.org\&. .PP A string looks like this: .PP .PP .nf [_Rep] _M_length [basic_string] _M_capacity _M_dataplus _M_refcount _M_p ----------------> unnamed array of char_type .fi .PP .PP Where the _M_p points to the first character in the string, and you cast it to a pointer-to-_Rep and subtract 1 to get a pointer to the header\&. .PP This approach has the enormous advantage that a string object requires only one allocation\&. All the ugliness is confined within a single pair of inline functions, which each compile to a single \fIadd\fP instruction: _Rep::_M_data(), and string::_M_rep(); and the allocation function which gets a block of raw bytes and with room enough and constructs a _Rep object at the front\&. .PP The reason you want _M_data pointing to the character array and not the _Rep is so that the debugger can see the string contents\&. (Probably we should add a non-inline member to get the _Rep for the debugger to use, so users can check the actual string length\&.) .PP Note that the _Rep object is a POD so that you can have a static \fIempty string\fP _Rep object already \fIconstructed\fP before static constructors have run\&. The reference-count encoding is chosen so that a 0 indicates one reference, so you never try to destroy the empty-string _Rep object\&. .PP All but the last paragraph is considered pretty conventional for a C++ string implementation\&. .PP Definition at line 3104 of file basic_string\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP ()\fC [inline]\fP" .PP Default constructor creates an empty string\&. .PP Definition at line 3489 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::basic_string(), and std::basic_string< char >::substr()\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (const _Alloc & __a)\fC [explicit]\fP" .PP Construct an empty string using allocator \fIa\fP\&. .PP Definition at line 618 of file basic_string\&.tcc\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str)" .PP Construct string with copy of value of \fIstr\fP\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP Source string\&. .RE .PP .PP Definition at line 610 of file basic_string\&.tcc\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos, const _Alloc & __a = \fC_Alloc()\fP)" .PP Construct string as copy of a substring\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP Source string\&. .br \fI__pos\fP Index of first character to copy from\&. .br \fI__a\fP Allocator to use\&. .RE .PP .PP Definition at line 624 of file basic_string\&.tcc\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos, size_type __n)" .PP Construct string as copy of a substring\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP Source string\&. .br \fI__pos\fP Index of first character to copy from\&. .br \fI__n\fP Number of characters to copy\&. .RE .PP .PP Definition at line 634 of file basic_string\&.tcc\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos, size_type __n, const _Alloc & __a)" .PP Construct string as copy of a substring\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP Source string\&. .br \fI__pos\fP Index of first character to copy from\&. .br \fI__n\fP Number of characters to copy\&. .br \fI__a\fP Allocator to use\&. .RE .PP .PP Definition at line 644 of file basic_string\&.tcc\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (const _CharT * __s, size_type __n, const _Alloc & __a = \fC_Alloc()\fP)" .PP Construct string initialized by a character array\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP Source character array\&. .br \fI__n\fP Number of characters to copy\&. .br \fI__a\fP Allocator to use (default is default allocator)\&. .RE .PP NB: \fI__s\fP must have at least \fI__n\fP characters, '\\0' has no special meaning\&. .PP Definition at line 656 of file basic_string\&.tcc\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (const _CharT * __s, const _Alloc & __a = \fC_Alloc()\fP)" .PP Construct string as copy of a C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP Source C string\&. .br \fI__a\fP Allocator to use (default is default allocator)\&. .RE .PP .PP Definition at line 663 of file basic_string\&.tcc\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (size_type __n, _CharT __c, const _Alloc & __a = \fC_Alloc()\fP)" .PP Construct string as multiple characters\&. .PP \fBParameters:\fP .RS 4 \fI__n\fP Number of characters\&. .br \fI__c\fP Character to use\&. .br \fI__a\fP Allocator to use (default is default allocator)\&. .RE .PP .PP Definition at line 670 of file basic_string\&.tcc\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (\fBbasic_string\fP< _CharT, _Traits, _Alloc > && __str)\fC [inline]\fP, \fC [noexcept]\fP" .PP Move construct string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP Source string\&. .RE .PP The newly-created string contains the exact contents of \fI__str\fP\&. \fI__str\fP is a valid, but unspecified string\&. .PP Definition at line 3571 of file basic_string\&.h\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (\fBinitializer_list\fP< _CharT > __l, const _Alloc & __a = \fC_Alloc()\fP)" .PP Construct string from an initializer list\&. .PP \fBParameters:\fP .RS 4 \fI__l\fP std::initializer_list of characters\&. .br \fI__a\fP Allocator to use (default is default allocator)\&. .RE .PP .PP Definition at line 685 of file basic_string\&.tcc\&. .SS "template template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::\fBbasic_string\fP (_InputIterator __beg, _InputIterator __end, const _Alloc & __a = \fC_Alloc()\fP)" .PP Construct string as copy of a range\&. .PP \fBParameters:\fP .RS 4 \fI__beg\fP Start of range\&. .br \fI__end\fP End of range\&. .br \fI__a\fP Allocator to use (default is default allocator)\&. .RE .PP .PP Definition at line 678 of file basic_string\&.tcc\&. .SS "template \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::~\fBbasic_string\fP ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Destroy the string instance\&. .PP Definition at line 3639 of file basic_string\&.h\&. .SH "Member Function Documentation" .PP .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc > & \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::append (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str)" .PP Append a string to this string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP The string to append\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP .PP Definition at line 775 of file basic_string\&.tcc\&. .PP Referenced by std::basic_string< char >::append(), std::money_get< _CharT, _InIter >::do_get(), and std::basic_string< char >::operator+=()\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc > & \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::append (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos, size_type __n = \fC\fBnpos\fP\fP)" .PP Append a substring\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP The string to append\&. .br \fI__pos\fP Index of the first character of str to append\&. .br \fI__n\fP The number of characters to append\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP if \fI__pos\fP is not a valid index\&. .RE .PP This function appends \fI__n\fP characters from \fI__str\fP starting at \fI__pos\fP to this string\&. If \fI__n\fP is is larger than the number of available characters in \fI__str\fP, the remainder of \fI__str\fP is appended\&. .PP Definition at line 792 of file basic_string\&.tcc\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc > & \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::append (const _CharT * __s, size_type __n)" .PP Append a C substring\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP The C string to append\&. .br \fI__n\fP The number of characters to append\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP .PP Definition at line 748 of file basic_string\&.tcc\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::append (const _CharT * __s)\fC [inline]\fP" .PP Append a C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP The C string to append\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP .PP Definition at line 4174 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc > & \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::append (size_type __n, _CharT __c)" .PP Append multiple characters\&. .PP \fBParameters:\fP .RS 4 \fI__n\fP The number of characters to append\&. .br \fI__c\fP The character to use\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP Appends __n copies of __c to this string\&. .PP Definition at line 731 of file basic_string\&.tcc\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::append (\fBinitializer_list\fP< _CharT > __l)\fC [inline]\fP" .PP Append an initializer_list of characters\&. .PP \fBParameters:\fP .RS 4 \fI__l\fP The initializer_list of characters to append\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP .PP Definition at line 4198 of file basic_string\&.h\&. .SS "template template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::append (_InputIterator __first, _InputIterator __last)\fC [inline]\fP" .PP Append a range of characters\&. .PP \fBParameters:\fP .RS 4 \fI__first\fP Iterator referencing the first character to append\&. .br \fI__last\fP Iterator marking the end of the range\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP Appends characters in the range [__first,__last) to this string\&. .PP Definition at line 4212 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc > & \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::assign (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str)" .PP Set value to contents of another string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP Source string to use\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP .PP Definition at line 693 of file basic_string\&.tcc\&. .PP Referenced by std::basic_string< char >::assign(), std::money_get< _CharT, _InIter >::do_get(), std::basic_string< char >::operator=(), and std::basic_string< char >::push_back()\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::assign (\fBbasic_string\fP< _CharT, _Traits, _Alloc > && __str)\fC [inline]\fP" .PP Set value to contents of another string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP Source string to use\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP This function sets this string to the exact contents of \fI__str\fP\&. \fI__str\fP is a valid, but unspecified string\&. .PP Definition at line 4281 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::assign (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos, size_type __n = \fC\fBnpos\fP\fP)\fC [inline]\fP" .PP Set value to a substring of a string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP The string to use\&. .br \fI__pos\fP Index of the first character of str\&. .br \fI__n\fP Number of characters to use\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP if \fIpos\fP is not a valid index\&. .RE .PP This function sets this string to the substring of \fI__str\fP consisting of \fI__n\fP characters at \fI__pos\fP\&. If \fI__n\fP is is larger than the number of available characters in \fI__str\fP, the remainder of \fI__str\fP is used\&. .PP Definition at line 4302 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc > & \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::assign (const _CharT * __s, size_type __n)" .PP Set value to a C substring\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP The C string to use\&. .br \fI__n\fP Number of characters to use\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP This function sets the value of this string to the first \fI__n\fP characters of \fI__s\fP\&. If \fI__n\fP is is larger than the number of available characters in \fI__s\fP, the remainder of \fI__s\fP is used\&. .PP Definition at line 709 of file basic_string\&.tcc\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::assign (const _CharT * __s)\fC [inline]\fP" .PP Set value to contents of a C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP The C string to use\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP This function sets the value of this string to the value of \fI__s\fP\&. The data is copied, so there is no dependence on \fI__s\fP once the function returns\&. .PP Definition at line 4330 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::assign (size_type __n, _CharT __c)\fC [inline]\fP" .PP Set value to multiple characters\&. .PP \fBParameters:\fP .RS 4 \fI__n\fP Length of the resulting string\&. .br \fI__c\fP The character to use\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP This function sets the value of this string to \fI__n\fP copies of character \fI__c\fP\&. .PP Definition at line 4346 of file basic_string\&.h\&. .SS "template template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::assign (_InputIterator __first, _InputIterator __last)\fC [inline]\fP" .PP Set value to a range of characters\&. .PP \fBParameters:\fP .RS 4 \fI__first\fP Iterator referencing the first character to append\&. .br \fI__last\fP Iterator marking the end of the range\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP Sets value of string to characters in the range [__first,__last)\&. .PP Definition at line 4359 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::assign (\fBinitializer_list\fP< _CharT > __l)\fC [inline]\fP" .PP Set value to an initializer_list of characters\&. .PP \fBParameters:\fP .RS 4 \fI__l\fP The initializer_list of characters to assign\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP .PP Definition at line 4369 of file basic_string\&.h\&. .SS "template const_reference \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::at (size_type __n) const\fC [inline]\fP" .PP Provides access to the data contained in the string\&. .PP \fBParameters:\fP .RS 4 \fI__n\fP The index of the character to access\&. .RE .PP \fBReturns:\fP .RS 4 Read-only (const) reference to the character\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP If \fIn\fP is an invalid index\&. .RE .PP This function provides for safer data access\&. The parameter is first checked that it is in the range of the string\&. The function throws out_of_range if the check fails\&. .PP Definition at line 4002 of file basic_string\&.h\&. .SS "template reference \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::at (size_type __n)\fC [inline]\fP" .PP Provides access to the data contained in the string\&. .PP \fBParameters:\fP .RS 4 \fI__n\fP The index of the character to access\&. .RE .PP \fBReturns:\fP .RS 4 Read/write reference to the character\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP If \fIn\fP is an invalid index\&. .RE .PP This function provides for safer data access\&. The parameter is first checked that it is in the range of the string\&. The function throws out_of_range if the check fails\&. Success results in unsharing the string\&. .PP Definition at line 4024 of file basic_string\&.h\&. .SS "template reference \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::back ()\fC [inline]\fP" Returns a read/write reference to the data at the last element of the string\&. .PP Definition at line 4063 of file basic_string\&.h\&. .SS "template const_reference \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::back () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reference to the data at the last element of the string\&. .PP Definition at line 4074 of file basic_string\&.h\&. .SS "template iterator \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::begin ()\fC [inline]\fP" Returns a read/write iterator that points to the first character in the string\&. Unshares the string\&. .PP Definition at line 3725 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::crend(), std::regex_match(), std::regex_replace(), std::regex_search(), std::basic_string< char >::rend(), and std::basic_string< char >::replace()\&. .SS "template const_iterator \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::begin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points to the first character in the string\&. .PP Definition at line 3736 of file basic_string\&.h\&. .SS "template const _CharT* \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::c_str () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Return const pointer to null-terminated contents\&. This is a handle to internal data\&. Do not modify or dire things may happen\&. .PP Definition at line 5128 of file basic_string\&.h\&. .PP Referenced by std::collate< _CharT >::do_compare(), std::money_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::collate< _CharT >::do_transform(), std::messages< _CharT >::messages(), std::regex_replace(), and std::messages< _CharT >::~messages()\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::capacity () const\fC [inline]\fP, \fC [noexcept]\fP" Returns the total number of characters that the string can hold before needing to allocate more memory\&. .PP Definition at line 3898 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::push_back(), and std::basic_string< char >::shrink_to_fit()\&. .SS "template const_iterator \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::cbegin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points to the first character in the string\&. .PP Definition at line 3800 of file basic_string\&.h\&. .SS "template const_iterator \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::cend () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points one past the last character in the string\&. .PP Definition at line 3808 of file basic_string\&.h\&. .SS "template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::clear ()\fC [inline]\fP, \fC [noexcept]\fP" Erases the string, making it empty\&. .PP Definition at line 3926 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::clear()\&. .SS "template int \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::compare (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str) const\fC [inline]\fP" .PP Compare to a string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP String to compare against\&. .RE .PP \fBReturns:\fP .RS 4 Integer < 0, 0, or > 0\&. .RE .PP Returns an integer < 0 if this string is ordered before \fI__str\fP, 0 if their values are equivalent, or > 0 if this string is ordered after \fI__str\fP\&. Determines the effective length rlen of the strings to compare as the smallest of size() and str\&.size()\&. The function then compares the two strings by calling traits::compare(data(), str\&.data(),rlen)\&. If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first\&. .PP Definition at line 5684 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::compare(), std::operator<(), and std::operator<=()\&. .SS "template int \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::compare (size_type __pos, size_type __n, const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str) const" .PP Compare substring to a string\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Index of first character of substring\&. .br \fI__n\fP Number of characters in substring\&. .br \fI__str\fP String to compare against\&. .RE .PP \fBReturns:\fP .RS 4 Integer < 0, 0, or > 0\&. .RE .PP Form the substring of this string from the \fI__n\fP characters starting at \fI__pos\fP\&. Returns an integer < 0 if the substring is ordered before \fI__str\fP, 0 if their values are equivalent, or > 0 if the substring is ordered after \fI__str\fP\&. Determines the effective length rlen of the strings to compare as the smallest of the length of the substring and \fI__str\&.size()\fP\&. The function then compares the two strings by calling traits::compare(substring\&.data(),str\&.data(),rlen)\&. If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first\&. .PP Definition at line 1385 of file basic_string\&.tcc\&. .SS "template int \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::compare (size_type __pos1, size_type __n1, const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos2, size_type __n2 = \fC\fBnpos\fP\fP) const" .PP Compare substring to a substring\&. .PP \fBParameters:\fP .RS 4 \fI__pos1\fP Index of first character of substring\&. .br \fI__n1\fP Number of characters in substring\&. .br \fI__str\fP String to compare against\&. .br \fI__pos2\fP Index of first character of substring of str\&. .br \fI__n2\fP Number of characters in substring of str\&. .RE .PP \fBReturns:\fP .RS 4 Integer < 0, 0, or > 0\&. .RE .PP Form the substring of this string from the \fI__n1\fP characters starting at \fI__pos1\fP\&. Form the substring of \fI__str\fP from the \fI__n2\fP characters starting at \fI__pos2\fP\&. Returns an integer < 0 if this substring is ordered before the substring of \fI__str\fP, 0 if their values are equivalent, or > 0 if this substring is ordered after the substring of \fI__str\fP\&. Determines the effective length rlen of the strings to compare as the smallest of the lengths of the substrings\&. The function then compares the two strings by calling traits::compare(substring\&.data(),str\&.substr(pos2,n2)\&.data(),rlen)\&. If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first\&. .PP Definition at line 1400 of file basic_string\&.tcc\&. .SS "template int \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::compare (const _CharT * __s) const\fC [noexcept]\fP" .PP Compare to a C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string to compare against\&. .RE .PP \fBReturns:\fP .RS 4 Integer < 0, 0, or > 0\&. .RE .PP Returns an integer < 0 if this string is ordered before \fI__s\fP, 0 if their values are equivalent, or > 0 if this string is ordered after \fI__s\fP\&. Determines the effective length rlen of the strings to compare as the smallest of size() and the length of a string constructed from \fI__s\fP\&. The function then compares the two strings by calling traits::compare(data(),s,rlen)\&. If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first\&. .PP Definition at line 1418 of file basic_string\&.tcc\&. .SS "template int \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::compare (size_type __pos, size_type __n1, const _CharT * __s) const" .PP Compare substring to a C string\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Index of first character of substring\&. .br \fI__n1\fP Number of characters in substring\&. .br \fI__s\fP C string to compare against\&. .RE .PP \fBReturns:\fP .RS 4 Integer < 0, 0, or > 0\&. .RE .PP Form the substring of this string from the \fI__n1\fP characters starting at \fIpos\fP\&. Returns an integer < 0 if the substring is ordered before \fI__s\fP, 0 if their values are equivalent, or > 0 if the substring is ordered after \fI__s\fP\&. Determines the effective length rlen of the strings to compare as the smallest of the length of the substring and the length of a string constructed from \fI__s\fP\&. The function then compares the two string by calling traits::compare(substring\&.data(),__s,rlen)\&. If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first\&. .PP Definition at line 1433 of file basic_string\&.tcc\&. .SS "template int \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::compare (size_type __pos, size_type __n1, const _CharT * __s, size_type __n2) const" .PP Compare substring against a character array\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Index of first character of substring\&. .br \fI__n1\fP Number of characters in substring\&. .br \fI__s\fP character array to compare against\&. .br \fI__n2\fP Number of characters of s\&. .RE .PP \fBReturns:\fP .RS 4 Integer < 0, 0, or > 0\&. .RE .PP Form the substring of this string from the \fI__n1\fP characters starting at \fI__pos\fP\&. Form a string from the first \fI__n2\fP characters of \fI__s\fP\&. Returns an integer < 0 if this substring is ordered before the string from \fI__s\fP, 0 if their values are equivalent, or > 0 if this substring is ordered after the string from \fI__s\fP\&. Determines the effective length rlen of the strings to compare as the smallest of the length of the substring and \fI__n2\fP\&. The function then compares the two strings by calling traits::compare(substring\&.data(),s,rlen)\&. If the result of the comparison is nonzero returns it, otherwise the shorter one is ordered first\&. .PP NB: s must have at least n2 characters, '\\0' has no special meaning\&. .PP Definition at line 1449 of file basic_string\&.tcc\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::copy (_CharT * __s, size_type __n, size_type __pos = \fC0\fP) const" .PP Copy substring into C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string to copy value into\&. .br \fI__n\fP Number of characters to copy\&. .br \fI__pos\fP Index of first character to copy\&. .RE .PP \fBReturns:\fP .RS 4 Number of characters actually copied .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP If __pos > size()\&. .RE .PP Copies up to \fI__n\fP characters starting at \fI__pos\fP into the C string \fI__s\fP\&. If \fI__pos\fP is greater than size(), out_of_range is thrown\&. .PP Definition at line 1143 of file basic_string\&.tcc\&. .SS "template \fBconst_reverse_iterator\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::crbegin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reverse iterator that points to the last character in the string\&. Iteration is done in reverse element order\&. .PP Definition at line 3817 of file basic_string\&.h\&. .SS "template \fBconst_reverse_iterator\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::crend () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reverse iterator that points to one before the first character in the string\&. Iteration is done in reverse element order\&. .PP Definition at line 3826 of file basic_string\&.h\&. .SS "template const _CharT* \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::data () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Return const pointer to contents\&. This is a pointer to internal data\&. It is undefined to modify the contents through the returned pointer\&. To get a pointer that allows modifying the contents use \fC&str\fP[0] instead, (or in C++17 the non-const \fCstr\&.data()\fP overload)\&. .PP Definition at line 5140 of file basic_string\&.h\&. .PP Referenced by std::basic_regex< _Ch_type, _Rx_traits >::assign(), std::basic_string< char >::compare(), std::basic_string< char >::data(), std::collate< _CharT >::do_compare(), std::money_get< _CharT, _InIter >::do_get(), std::collate< _CharT >::do_transform(), std::match_results< _Bi_iter >::format(), std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::from_bytes(), std::operator<<(), std::basic_string< char >::operator=(), std::operator==(), std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::to_bytes(), and std::regex_traits< _CharType >::transform()\&. .SS "template bool \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::empty () const\fC [inline]\fP, \fC [noexcept]\fP" Returns true if the string is empty\&. Equivalent to \fC*this == ''\fP\&. .PP Definition at line 3948 of file basic_string\&.h\&. .SS "template iterator \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::end ()\fC [inline]\fP" Returns a read/write iterator that points one past the last character in the string\&. Unshares the string\&. .PP Definition at line 3744 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::crbegin(), std::basic_string< char >::rbegin(), std::regex_match(), std::regex_replace(), and std::regex_search()\&. .SS "template const_iterator \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::end () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) iterator that points one past the last character in the string\&. .PP Definition at line 3755 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::erase (size_type __pos = \fC0\fP, size_type __n = \fC\fBnpos\fP\fP)\fC [inline]\fP" .PP Remove characters\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Index of first character to remove (default 0)\&. .br \fI__n\fP Number of characters to remove (default remainder)\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP If \fIpos\fP is beyond the end of this string\&. .RE .PP Removes \fI__n\fP characters from this string starting at \fI__pos\fP\&. The length of the string is reduced by \fI__n\fP\&. If there are < \fI__n\fP characters to remove, the remainder of the string is truncated\&. If \fI__p\fP is beyond end of string, out_of_range is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4632 of file basic_string\&.h\&. .PP Referenced by std::money_get< _CharT, _InIter >::do_get()\&. .SS "template iterator \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::erase (iterator __position)\fC [inline]\fP" .PP Remove one character\&. .PP \fBParameters:\fP .RS 4 \fI__position\fP Iterator referencing the character to remove\&. .RE .PP \fBReturns:\fP .RS 4 iterator referencing same location after removal\&. .RE .PP Removes the character at \fI__position\fP from this string\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4648 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::iterator \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::erase (iterator __first, iterator __last)" .PP Remove a range of characters\&. .PP \fBParameters:\fP .RS 4 \fI__first\fP Iterator referencing the first character to remove\&. .br \fI__last\fP Iterator referencing the end of the range\&. .RE .PP \fBReturns:\fP .RS 4 Iterator referencing location of first after removal\&. .RE .PP Removes the characters in the range [first,last) from this string\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 841 of file basic_string\&.tcc\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find (const _CharT * __s, size_type __pos, size_type __n) const\fC [noexcept]\fP" .PP Find position of a C substring\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string to locate\&. .br \fI__pos\fP Index of character to search from\&. .br \fI__n\fP Number of characters from \fIs\fP to search for\&. .RE .PP \fBReturns:\fP .RS 4 Index of start of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for the first \fI__n\fP characters in \fI__s\fP within this string\&. If found, returns the index where it begins\&. If not found, returns npos\&. .PP Definition at line 1188 of file basic_string\&.tcc\&. .PP Referenced by std::basic_string< char >::find(), std::basic_string< char >::find_first_of(), and std::basic_string< char >::get_allocator()\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos = \fC0\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find position of a string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP String to locate\&. .br \fI__pos\fP Index of character to search from (default 0)\&. .RE .PP \fBReturns:\fP .RS 4 Index of start of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for value of \fI__str\fP within this string\&. If found, returns the index where it begins\&. If not found, returns npos\&. .PP Definition at line 5192 of file basic_string\&.h\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find (const _CharT * __s, size_type __pos = \fC0\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find position of a C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string to locate\&. .br \fI__pos\fP Index of character to search from (default 0)\&. .RE .PP \fBReturns:\fP .RS 4 Index of start of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for the value of \fI__s\fP within this string\&. If found, returns the index where it begins\&. If not found, returns npos\&. .PP Definition at line 5207 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find (_CharT __c, size_type __pos = \fC0\fP) const\fC [noexcept]\fP" .PP Find position of a character\&. .PP \fBParameters:\fP .RS 4 \fI__c\fP Character to locate\&. .br \fI__pos\fP Index of character to search from (default 0)\&. .RE .PP \fBReturns:\fP .RS 4 Index of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for \fI__c\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 1224 of file basic_string\&.tcc\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_first_not_of (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos = \fC0\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find position of a character not in string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP String containing characters to avoid\&. .br \fI__pos\fP Index of character to search from (default 0)\&. .RE .PP \fBReturns:\fP .RS 4 Index of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for a character not contained in \fI__str\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 5500 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::find_first_not_of()\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_first_not_of (const _CharT * __s, size_type __pos, size_type __n) const\fC [noexcept]\fP" .PP Find position of a character not in C substring\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string containing characters to avoid\&. .br \fI__pos\fP Index of character to search from\&. .br \fI__n\fP Number of characters from __s to consider\&. .RE .PP \fBReturns:\fP .RS 4 Index of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for a character not contained in the first \fI__n\fP characters of \fI__s\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 1319 of file basic_string\&.tcc\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_first_not_of (const _CharT * __s, size_type __pos = \fC0\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find position of a character not in C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string containing characters to avoid\&. .br \fI__pos\fP Index of character to search from (default 0)\&. .RE .PP \fBReturns:\fP .RS 4 Index of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for a character not contained in \fI__s\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 5531 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_first_not_of (_CharT __c, size_type __pos = \fC0\fP) const\fC [noexcept]\fP" .PP Find position of a different character\&. .PP \fBParameters:\fP .RS 4 \fI__c\fP Character to avoid\&. .br \fI__pos\fP Index of character to search from (default 0)\&. .RE .PP \fBReturns:\fP .RS 4 Index of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for a character other than \fI__c\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 1332 of file basic_string\&.tcc\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_first_of (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos = \fC0\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find position of a character of string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP String containing characters to locate\&. .br \fI__pos\fP Index of character to search from (default 0)\&. .RE .PP \fBReturns:\fP .RS 4 Index of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for one of the characters of \fI__str\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 5333 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::find_first_of()\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_first_of (const _CharT * __s, size_type __pos, size_type __n) const\fC [noexcept]\fP" .PP Find position of a character of C substring\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP String containing characters to locate\&. .br \fI__pos\fP Index of character to search from\&. .br \fI__n\fP Number of characters from s to search for\&. .RE .PP \fBReturns:\fP .RS 4 Index of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for one of the first \fI__n\fP characters of \fI__s\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 1281 of file basic_string\&.tcc\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_first_of (const _CharT * __s, size_type __pos = \fC0\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find position of a character of C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP String containing characters to locate\&. .br \fI__pos\fP Index of character to search from (default 0)\&. .RE .PP \fBReturns:\fP .RS 4 Index of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for one of the characters of \fI__s\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 5364 of file basic_string\&.h\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_first_of (_CharT __c, size_type __pos = \fC0\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find position of a character\&. .PP \fBParameters:\fP .RS 4 \fI__c\fP Character to locate\&. .br \fI__pos\fP Index of character to search from (default 0)\&. .RE .PP \fBReturns:\fP .RS 4 Index of first occurrence\&. .RE .PP Starting from \fI__pos\fP, searches forward for the character \fI__c\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Note: equivalent to find(__c, __pos)\&. .PP Definition at line 5384 of file basic_string\&.h\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_last_not_of (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos = \fC\fBnpos\fP\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find last position of a character not in string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP String containing characters to avoid\&. .br \fI__pos\fP Index of character to search back from (default end)\&. .RE .PP \fBReturns:\fP .RS 4 Index of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for a character not contained in \fI__str\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 5582 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::find_last_not_of()\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_last_not_of (const _CharT * __s, size_type __pos, size_type __n) const\fC [noexcept]\fP" .PP Find last position of a character not in C substring\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string containing characters to avoid\&. .br \fI__pos\fP Index of character to search back from\&. .br \fI__n\fP Number of characters from s to consider\&. .RE .PP \fBReturns:\fP .RS 4 Index of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for a character not contained in the first \fI__n\fP characters of \fI__s\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 1343 of file basic_string\&.tcc\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_last_not_of (const _CharT * __s, size_type __pos = \fC\fBnpos\fP\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find last position of a character not in C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string containing characters to avoid\&. .br \fI__pos\fP Index of character to search back from (default end)\&. .RE .PP \fBReturns:\fP .RS 4 Index of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for a character not contained in \fI__s\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 5613 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_last_not_of (_CharT __c, size_type __pos = \fC\fBnpos\fP\fP) const\fC [noexcept]\fP" .PP Find last position of a different character\&. .PP \fBParameters:\fP .RS 4 \fI__c\fP Character to avoid\&. .br \fI__pos\fP Index of character to search back from (default end)\&. .RE .PP \fBReturns:\fP .RS 4 Index of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for a character other than \fI__c\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 1365 of file basic_string\&.tcc\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_last_of (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos = \fC\fBnpos\fP\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find last position of a character of string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP String containing characters to locate\&. .br \fI__pos\fP Index of character to search back from (default end)\&. .RE .PP \fBReturns:\fP .RS 4 Index of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for one of the characters of \fI__str\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 5417 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::find_last_of()\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_last_of (const _CharT * __s, size_type __pos, size_type __n) const\fC [noexcept]\fP" .PP Find last position of a character of C substring\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string containing characters to locate\&. .br \fI__pos\fP Index of character to search back from\&. .br \fI__n\fP Number of characters from s to search for\&. .RE .PP \fBReturns:\fP .RS 4 Index of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for one of the first \fI__n\fP characters of \fI__s\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 1297 of file basic_string\&.tcc\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_last_of (const _CharT * __s, size_type __pos = \fC\fBnpos\fP\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find last position of a character of C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string containing characters to locate\&. .br \fI__pos\fP Index of character to search back from (default end)\&. .RE .PP \fBReturns:\fP .RS 4 Index of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for one of the characters of \fI__s\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 5448 of file basic_string\&.h\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::find_last_of (_CharT __c, size_type __pos = \fC\fBnpos\fP\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find last position of a character\&. .PP \fBParameters:\fP .RS 4 \fI__c\fP Character to locate\&. .br \fI__pos\fP Index of character to search back from (default end)\&. .RE .PP \fBReturns:\fP .RS 4 Index of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for \fI__c\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Note: equivalent to rfind(__c, __pos)\&. .PP Definition at line 5468 of file basic_string\&.h\&. .SS "template reference \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::front ()\fC [inline]\fP" Returns a read/write reference to the data at the first element of the string\&. .PP Definition at line 4041 of file basic_string\&.h\&. .SS "template const_reference \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::front () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reference to the data at the first element of the string\&. .PP Definition at line 4052 of file basic_string\&.h\&. .SS "template allocator_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::get_allocator () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Return copy of allocator used to construct this string\&. .PP Definition at line 5162 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::assign(), std::basic_string< char >::basic_string(), std::basic_string< char >::clear(), std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::from_bytes(), std::basic_string< char >::swap(), std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::to_bytes(), and std::basic_string< char >::~basic_string()\&. .SS "template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::insert (iterator __p, size_type __n, _CharT __c)\fC [inline]\fP" .PP Insert multiple characters\&. .PP \fBParameters:\fP .RS 4 \fI__p\fP Iterator referencing location in string to insert at\&. .br \fI__n\fP Number of characters to insert .br \fI__c\fP The character to insert\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Inserts \fI__n\fP copies of character \fI__c\fP starting at the position referenced by iterator \fI__p\fP\&. If adding characters causes the length to exceed max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4419 of file basic_string\&.h\&. .PP Referenced by std::money_get< _CharT, _InIter >::do_get(), and std::basic_string< char >::insert()\&. .SS "template template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::insert (iterator __p, _InputIterator __beg, _InputIterator __end)\fC [inline]\fP" .PP Insert a range of characters\&. .PP \fBParameters:\fP .RS 4 \fI__p\fP Iterator referencing location in string to insert at\&. .br \fI__beg\fP Start of range\&. .br \fI__end\fP End of range\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Inserts characters in range [__beg,__end)\&. If adding characters causes the length to exceed max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4436 of file basic_string\&.h\&. .SS "template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::insert (iterator __p, \fBinitializer_list\fP< _CharT > __l)\fC [inline]\fP" .PP Insert an initializer_list of characters\&. .PP \fBParameters:\fP .RS 4 \fI__p\fP Iterator referencing location in string to insert at\&. .br \fI__l\fP The initializer_list of characters to insert\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP .PP Definition at line 4447 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::insert (size_type __pos1, const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str)\fC [inline]\fP" .PP Insert value of a string\&. .PP \fBParameters:\fP .RS 4 \fI__pos1\fP Iterator referencing location in string to insert at\&. .br \fI__str\fP The string to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Inserts value of \fI__str\fP starting at \fI__pos1\fP\&. If adding characters causes the length to exceed max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4467 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::insert (size_type __pos1, const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos2, size_type __n = \fC\fBnpos\fP\fP)\fC [inline]\fP" .PP Insert a substring\&. .PP \fBParameters:\fP .RS 4 \fI__pos1\fP Iterator referencing location in string to insert at\&. .br \fI__str\fP The string to insert\&. .br \fI__pos2\fP Start of characters in str to insert\&. .br \fI__n\fP Number of characters to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .br \fIstd::out_of_range\fP If \fIpos1\fP > size() or \fI__pos2\fP > \fIstr\&.size()\fP\&. .RE .PP Starting at \fIpos1\fP, insert \fI__n\fP character of \fI__str\fP beginning with \fI__pos2\fP\&. If adding characters causes the length to exceed max_size(), length_error is thrown\&. If \fI__pos1\fP is beyond the end of this string or \fI__pos2\fP is beyond the end of \fI__str\fP, out_of_range is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4489 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc > & \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::insert (size_type __pos, const _CharT * __s, size_type __n)" .PP Insert a C substring\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Iterator referencing location in string to insert at\&. .br \fI__s\fP The C string to insert\&. .br \fI__n\fP The number of characters to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .br \fIstd::out_of_range\fP If \fI__pos\fP is beyond the end of this string\&. .RE .PP Inserts the first \fI__n\fP characters of \fI__s\fP starting at \fI__pos\fP\&. If adding characters causes the length to exceed max_size(), length_error is thrown\&. If \fI__pos\fP is beyond end(), out_of_range is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 810 of file basic_string\&.tcc\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::insert (size_type __pos, const _CharT * __s)\fC [inline]\fP" .PP Insert a C string\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Iterator referencing location in string to insert at\&. .br \fI__s\fP The C string to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .br \fIstd::out_of_range\fP If \fIpos\fP is beyond the end of this string\&. .RE .PP Inserts the first \fIn\fP characters of \fI__s\fP starting at \fI__pos\fP\&. If adding characters causes the length to exceed max_size(), length_error is thrown\&. If \fI__pos\fP is beyond end(), out_of_range is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4530 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::insert (size_type __pos, size_type __n, _CharT __c)\fC [inline]\fP" .PP Insert multiple characters\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Index in string to insert at\&. .br \fI__n\fP Number of characters to insert .br \fI__c\fP The character to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .br \fIstd::out_of_range\fP If \fI__pos\fP is beyond the end of this string\&. .RE .PP Inserts \fI__n\fP copies of character \fI__c\fP starting at index \fI__pos\fP\&. If adding characters causes the length to exceed max_size(), length_error is thrown\&. If \fI__pos\fP > length(), out_of_range is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4553 of file basic_string\&.h\&. .SS "template iterator \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::insert (iterator __p, _CharT __c)\fC [inline]\fP" .PP Insert one character\&. .PP \fBParameters:\fP .RS 4 \fI__p\fP Iterator referencing position in string to insert at\&. .br \fI__c\fP The character to insert\&. .RE .PP \fBReturns:\fP .RS 4 Iterator referencing newly inserted char\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Inserts character \fI__c\fP at position referenced by \fI__p\fP\&. If adding character causes the length to exceed max_size(), length_error is thrown\&. If \fI__p\fP is beyond end of string, out_of_range is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4571 of file basic_string\&.h\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::length () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns the number of characters in the string, not including any null-termination\&. .PP Definition at line 3841 of file basic_string\&.h\&. .PP Referenced by std::collate< _CharT >::do_compare(), and std::collate< _CharT >::do_transform()\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::max_size () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns the size() of the largest possible string\&. .PP Definition at line 3846 of file basic_string\&.h\&. .PP Referenced by std::getline()\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator+= (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str)\fC [inline]\fP" .PP Append a string to this string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP The string to append\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP .PP Definition at line 4088 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::operator+=()\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator+= (const _CharT * __s)\fC [inline]\fP" .PP Append a C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP The C string to append\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP .PP Definition at line 4097 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator+= (_CharT __c)\fC [inline]\fP" .PP Append a character\&. .PP \fBParameters:\fP .RS 4 \fI__c\fP The character to append\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP .PP Definition at line 4106 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator+= (\fBinitializer_list\fP< _CharT > __l)\fC [inline]\fP" .PP Append an initializer_list of characters\&. .PP \fBParameters:\fP .RS 4 \fI__l\fP The initializer_list of characters to be appended\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP .PP Definition at line 4119 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator= (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str)\fC [inline]\fP" .PP Assign the value of \fIstr\fP to this string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP Source string\&. .RE .PP .PP Definition at line 3647 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::operator=()\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator= (const _CharT * __s)\fC [inline]\fP" .PP Copy contents of \fIs\fP into this string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP Source null-terminated string\&. .RE .PP .PP Definition at line 3655 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator= (_CharT __c)\fC [inline]\fP" .PP Set value to string of length 1\&. .PP \fBParameters:\fP .RS 4 \fI__c\fP Source character\&. .RE .PP Assigning to a character makes this string length 1 and (*this)[0] == \fIc\fP\&. .PP Definition at line 3666 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator= (\fBbasic_string\fP< _CharT, _Traits, _Alloc > && __str)\fC [inline]\fP" .PP Move assign the value of \fIstr\fP to this string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP Source string\&. .RE .PP The contents of \fIstr\fP are moved into this string (without copying)\&. \fIstr\fP is a valid, but unspecified string\&. .PP Definition at line 3682 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator= (\fBinitializer_list\fP< _CharT > __l)\fC [inline]\fP" .PP Set value to string constructed from initializer list\&. .PP \fBParameters:\fP .RS 4 \fI__l\fP std::initializer_list\&. .RE .PP .PP Definition at line 3694 of file basic_string\&.h\&. .SS "template const_reference \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator[] (size_type __pos) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Subscript access to the data contained in the string\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP The index of the character to access\&. .RE .PP \fBReturns:\fP .RS 4 Read-only (constant) reference to the character\&. .RE .PP This operator allows for easy, array-style, data access\&. Note that data access with this operator is unchecked and out_of_range lookups are not defined\&. (For checked lookups see at()\&.) .PP Definition at line 3963 of file basic_string\&.h\&. .SS "template reference \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::operator[] (size_type __pos)\fC [inline]\fP" .PP Subscript access to the data contained in the string\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP The index of the character to access\&. .RE .PP \fBReturns:\fP .RS 4 Read/write reference to the character\&. .RE .PP This operator allows for easy, array-style, data access\&. Note that data access with this operator is unchecked and out_of_range lookups are not defined\&. (For checked lookups see at()\&.) Unshares the string\&. .PP Definition at line 3980 of file basic_string\&.h\&. .SS "template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::pop_back ()\fC [inline]\fP" .PP Remove the last character\&. The string must be non-empty\&. .PP Definition at line 4677 of file basic_string\&.h\&. .SS "template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::push_back (_CharT __c)\fC [inline]\fP" .PP Append a single character\&. .PP \fBParameters:\fP .RS 4 \fI__c\fP Character to append\&. .RE .PP .PP Definition at line 4253 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::operator+=()\&. .SS "template \fBreverse_iterator\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::rbegin ()\fC [inline]\fP" Returns a read/write reverse iterator that points to the last character in the string\&. Iteration is done in reverse element order\&. Unshares the string\&. .PP Definition at line 3764 of file basic_string\&.h\&. .SS "template \fBconst_reverse_iterator\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::rbegin () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reverse iterator that points to the last character in the string\&. Iteration is done in reverse element order\&. .PP Definition at line 3773 of file basic_string\&.h\&. .SS "template \fBreverse_iterator\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::rend ()\fC [inline]\fP" Returns a read/write reverse iterator that points to one before the first character in the string\&. Iteration is done in reverse element order\&. Unshares the string\&. .PP Definition at line 3782 of file basic_string\&.h\&. .SS "template \fBconst_reverse_iterator\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::rend () const\fC [inline]\fP, \fC [noexcept]\fP" Returns a read-only (constant) reverse iterator that points to one before the first character in the string\&. Iteration is done in reverse element order\&. .PP Definition at line 3791 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (size_type __pos, size_type __n, const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str)\fC [inline]\fP" .PP Replace characters with value from another string\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Index of first character to replace\&. .br \fI__n\fP Number of characters to be replaced\&. .br \fI__str\fP String to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP If \fIpos\fP is beyond the end of this string\&. .br \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [__pos,__pos+__n) from this string\&. In place, the value of \fI__str\fP is inserted\&. If \fI__pos\fP is beyond end of string, out_of_range is thrown\&. If the length of the result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4702 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::append(), std::basic_string< char >::assign(), std::basic_string< char >::insert(), and std::basic_string< char >::replace()\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (size_type __pos1, size_type __n1, const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos2, size_type __n2 = \fC\fBnpos\fP\fP)\fC [inline]\fP" .PP Replace characters with value from another string\&. .PP \fBParameters:\fP .RS 4 \fI__pos1\fP Index of first character to replace\&. .br \fI__n1\fP Number of characters to be replaced\&. .br \fI__str\fP String to insert\&. .br \fI__pos2\fP Index of first character of str to use\&. .br \fI__n2\fP Number of characters from str to use\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP If \fI__pos1\fP > size() or \fI__pos2\fP > __str\&.size()\&. .br \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [__pos1,__pos1 + n) from this string\&. In place, the value of \fI__str\fP is inserted\&. If \fI__pos\fP is beyond end of string, out_of_range is thrown\&. If the length of the result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4724 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc > & \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (size_type __pos, size_type __n1, const _CharT * __s, size_type __n2)" .PP Replace characters with value of a C substring\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Index of first character to replace\&. .br \fI__n1\fP Number of characters to be replaced\&. .br \fI__s\fP C string to insert\&. .br \fI__n2\fP Number of characters from \fIs\fP to use\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP If \fIpos1\fP > size()\&. .br \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [__pos,__pos + __n1) from this string\&. In place, the first \fI__n2\fP characters of \fI__s\fP are inserted, or all of \fI__s\fP if \fI__n2\fP is too large\&. If \fI__pos\fP is beyond end of string, out_of_range is thrown\&. If the length of result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 864 of file basic_string\&.tcc\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (size_type __pos, size_type __n1, const _CharT * __s)\fC [inline]\fP" .PP Replace characters with value of a C string\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Index of first character to replace\&. .br \fI__n1\fP Number of characters to be replaced\&. .br \fI__s\fP C string to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP If \fIpos\fP > size()\&. .br \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [__pos,__pos + __n1) from this string\&. In place, the characters of \fI__s\fP are inserted\&. If \fI__pos\fP is beyond end of string, out_of_range is thrown\&. If the length of result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4769 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (size_type __pos, size_type __n1, size_type __n2, _CharT __c)\fC [inline]\fP" .PP Replace characters with multiple characters\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Index of first character to replace\&. .br \fI__n1\fP Number of characters to be replaced\&. .br \fI__n2\fP Number of characters to insert\&. .br \fI__c\fP Character to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP If \fI__pos\fP > size()\&. .br \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [pos,pos + n1) from this string\&. In place, \fI__n2\fP copies of \fI__c\fP are inserted\&. If \fI__pos\fP is beyond end of string, out_of_range is thrown\&. If the length of result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4793 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (iterator __i1, iterator __i2, const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str)\fC [inline]\fP" .PP Replace range of characters with string\&. .PP \fBParameters:\fP .RS 4 \fI__i1\fP Iterator referencing start of range to replace\&. .br \fI__i2\fP Iterator referencing end of range to replace\&. .br \fI__str\fP String value to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [__i1,__i2)\&. In place, the value of \fI__str\fP is inserted\&. If the length of result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4811 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (iterator __i1, iterator __i2, const _CharT * __s, size_type __n)\fC [inline]\fP" .PP Replace range of characters with C substring\&. .PP \fBParameters:\fP .RS 4 \fI__i1\fP Iterator referencing start of range to replace\&. .br \fI__i2\fP Iterator referencing end of range to replace\&. .br \fI__s\fP C string value to insert\&. .br \fI__n\fP Number of characters from s to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [__i1,__i2)\&. In place, the first \fI__n\fP characters of \fI__s\fP are inserted\&. If the length of result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4830 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (iterator __i1, iterator __i2, const _CharT * __s)\fC [inline]\fP" .PP Replace range of characters with C string\&. .PP \fBParameters:\fP .RS 4 \fI__i1\fP Iterator referencing start of range to replace\&. .br \fI__i2\fP Iterator referencing end of range to replace\&. .br \fI__s\fP C string value to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [__i1,__i2)\&. In place, the characters of \fI__s\fP are inserted\&. If the length of result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4851 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (iterator __i1, iterator __i2, size_type __n, _CharT __c)\fC [inline]\fP" .PP Replace range of characters with multiple characters\&. .PP \fBParameters:\fP .RS 4 \fI__i1\fP Iterator referencing start of range to replace\&. .br \fI__i2\fP Iterator referencing end of range to replace\&. .br \fI__n\fP Number of characters to insert\&. .br \fI__c\fP Character to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [__i1,__i2)\&. In place, \fI__n\fP copies of \fI__c\fP are inserted\&. If the length of result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4872 of file basic_string\&.h\&. .SS "template template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (iterator __i1, iterator __i2, _InputIterator __k1, _InputIterator __k2)\fC [inline]\fP" .PP Replace range of characters with range\&. .PP \fBParameters:\fP .RS 4 \fI__i1\fP Iterator referencing start of range to replace\&. .br \fI__i2\fP Iterator referencing end of range to replace\&. .br \fI__k1\fP Iterator referencing start of range to insert\&. .br \fI__k2\fP Iterator referencing end of range to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [__i1,__i2)\&. In place, characters in the range [__k1,__k2) are inserted\&. If the length of result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4896 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP& \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::replace (iterator __i1, iterator __i2, \fBinitializer_list\fP< _CharT > __l)\fC [inline]\fP" .PP Replace range of characters with initializer_list\&. .PP \fBParameters:\fP .RS 4 \fI__i1\fP Iterator referencing start of range to replace\&. .br \fI__i2\fP Iterator referencing end of range to replace\&. .br \fI__l\fP The initializer_list of characters to insert\&. .RE .PP \fBReturns:\fP .RS 4 Reference to this string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If new length exceeds \fCmax_size()\fP\&. .RE .PP Removes the characters in the range [__i1,__i2)\&. In place, characters in the range [__k1,__k2) are inserted\&. If the length of result exceeds max_size(), length_error is thrown\&. The value of the string doesn't change if an error is thrown\&. .PP Definition at line 4965 of file basic_string\&.h\&. .SS "template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::reserve (size_type __res_arg = \fC0\fP)" .PP Attempt to preallocate enough memory for specified number of characters\&. .PP \fBParameters:\fP .RS 4 \fI__res_arg\fP Number of characters required\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::length_error\fP If \fI__res_arg\fP exceeds \fCmax_size()\fP\&. .RE .PP This function attempts to reserve enough memory for the string to hold the specified number of characters\&. If the number requested is more than max_size(), length_error is thrown\&. .PP The advantage of this function is that if optimal code is a necessity and the user can determine the string length that will be required, the user can reserve the memory in advance, and thus prevent a possible reallocation of memory and copying of string data\&. .PP Definition at line 952 of file basic_string\&.tcc\&. .PP Referenced by std::basic_string< char >::capacity(), std::money_get< _CharT, _InIter >::do_get(), std::num_get< _CharT, _InIter >::do_get(), std::tr2::operator>>(), std::basic_string< char >::push_back(), and std::basic_string< char >::shrink_to_fit()\&. .SS "template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::resize (size_type __n, _CharT __c)" .PP Resizes the string to the specified number of characters\&. .PP \fBParameters:\fP .RS 4 \fI__n\fP Number of characters the string should contain\&. .br \fI__c\fP Character to fill any new elements\&. .RE .PP This function will resize the string to the specified number of characters\&. If the number is smaller than the string's current size the string is truncated, otherwise the string is extended and new elements are set to \fI__c\fP\&. .PP Definition at line 1090 of file basic_string\&.tcc\&. .PP Referenced by std::money_get< _CharT, _InIter >::do_get(), std::basic_string< char >::max_size(), and std::basic_string< char >::resize()\&. .SS "template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::resize (size_type __n)\fC [inline]\fP" .PP Resizes the string to the specified number of characters\&. .PP \fBParameters:\fP .RS 4 \fI__n\fP Number of characters the string should contain\&. .RE .PP This function will resize the string to the specified length\&. If the new size is smaller than the string's current size the string is truncated, otherwise the string is extended and new characters are default-constructed\&. For basic types such as char, this means setting them to 0\&. .PP Definition at line 3873 of file basic_string\&.h\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::rfind (const \fBbasic_string\fP< _CharT, _Traits, _Alloc > & __str, size_type __pos = \fC\fBnpos\fP\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find last position of a string\&. .PP \fBParameters:\fP .RS 4 \fI__str\fP String to locate\&. .br \fI__pos\fP Index of character to search back from (default end)\&. .RE .PP \fBReturns:\fP .RS 4 Index of start of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for value of \fI__str\fP within this string\&. If found, returns the index where it begins\&. If not found, returns npos\&. .PP Definition at line 5254 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::find_last_of(), and std::basic_string< char >::rfind()\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::rfind (const _CharT * __s, size_type __pos, size_type __n) const\fC [noexcept]\fP" .PP Find last position of a C substring\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string to locate\&. .br \fI__pos\fP Index of character to search back from\&. .br \fI__n\fP Number of characters from s to search for\&. .RE .PP \fBReturns:\fP .RS 4 Index of start of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for the first \fI__n\fP characters in \fI__s\fP within this string\&. If found, returns the index where it begins\&. If not found, returns npos\&. .PP Definition at line 1242 of file basic_string\&.tcc\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::rfind (const _CharT * __s, size_type __pos = \fC\fBnpos\fP\fP) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Find last position of a C string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP C string to locate\&. .br \fI__pos\fP Index of character to start search at (default end)\&. .RE .PP \fBReturns:\fP .RS 4 Index of start of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for the value of \fI__s\fP within this string\&. If found, returns the index where it begins\&. If not found, returns npos\&. .PP Definition at line 5285 of file basic_string\&.h\&. .SS "template \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::rfind (_CharT __c, size_type __pos = \fC\fBnpos\fP\fP) const\fC [noexcept]\fP" .PP Find last position of a character\&. .PP \fBParameters:\fP .RS 4 \fI__c\fP Character to locate\&. .br \fI__pos\fP Index of character to search back from (default end)\&. .RE .PP \fBReturns:\fP .RS 4 Index of last occurrence\&. .RE .PP Starting from \fI__pos\fP, searches backward for \fI__c\fP within this string\&. If found, returns the index where it was found\&. If not found, returns npos\&. .PP Definition at line 1264 of file basic_string\&.tcc\&. .SS "template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::shrink_to_fit ()\fC [inline]\fP, \fC [noexcept]\fP" .PP A non-binding request to reduce capacity() to size()\&. .PP Definition at line 3879 of file basic_string\&.h\&. .SS "template size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::size () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Returns the number of characters in the string, not including any null-termination\&. .PP Definition at line 3835 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::append(), std::basic_regex< _Ch_type, _Rx_traits >::assign(), std::basic_string< char >::assign(), std::basic_string< char >::at(), std::basic_string< char >::cend(), std::basic_string< char >::clear(), std::basic_string< char >::compare(), std::money_get< _CharT, _InIter >::do_get(), std::basic_string< char >::empty(), std::basic_string< char >::end(), std::match_results< _Bi_iter >::format(), std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::from_bytes(), std::operator<<(), std::basic_string< char >::operator=(), std::operator==(), std::basic_string< char >::push_back(), std::basic_string< char >::shrink_to_fit(), std::wstring_convert< _Codecvt, _Elem, _Wide_alloc, _Byte_alloc >::to_bytes(), and std::regex_traits< _CharType >::transform()\&. .SS "template \fBbasic_string\fP \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::substr (size_type __pos = \fC0\fP, size_type __n = \fC\fBnpos\fP\fP) const\fC [inline]\fP" .PP Get a substring\&. .PP \fBParameters:\fP .RS 4 \fI__pos\fP Index of first character (default 0)\&. .br \fI__n\fP Number of characters in substring (default remainder)\&. .RE .PP \fBReturns:\fP .RS 4 The new string\&. .RE .PP \fBExceptions:\fP .RS 4 \fIstd::out_of_range\fP If __pos > size()\&. .RE .PP Construct and return a new string using the \fI__n\fP characters starting at \fI__pos\fP\&. If the string is too short, use the remainder of the characters\&. If \fI__pos\fP is beyond the end of the string, out_of_range is thrown\&. .PP Definition at line 5665 of file basic_string\&.h\&. .PP Referenced by std::basic_string< char >::basic_string()\&. .SS "template void \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::swap (\fBbasic_string\fP< _CharT, _Traits, _Alloc > & __s)" .PP Swap contents with another string\&. .PP \fBParameters:\fP .RS 4 \fI__s\fP String to swap with\&. .RE .PP Exchanges the contents of this string with that of \fI__s\fP in constant time\&. .PP Definition at line 969 of file basic_string\&.tcc\&. .PP Referenced by std::basic_string< char >::assign(), and std::basic_string< char >::operator=()\&. .SH "Member Data Documentation" .PP .SS "template const \fBbasic_string\fP< _CharT, _Traits, _Alloc >::size_type \fBstd::basic_string\fP< _CharT, _Traits, _Alloc >::npos\fC [static]\fP" .PP Value returned by various member functions when they fail\&. .PP Definition at line 3306 of file basic_string\&.h\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.