STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
basic_string< _Elem, _Traits, _Alloc > Class Template Reference
Inheritance diagram for basic_string< _Elem, _Traits, _Alloc >:
_String_alloc< _String_base_types< _Elem, _Alloc > >

Public Types

typedef basic_string< _Elem, _Traits, _Alloc_Myt
 
typedef _String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
 
typedef _Traits traits_type
 
typedef _Alloc allocator_type
 
typedef _Mybase::_Alty _Alty
 
typedef _Mybase::_Mydata_t _Mydata_t
 
typedef _Mybase::value_type value_type
 
typedef _Mybase::size_type size_type
 
typedef _Mybase::difference_type difference_type
 
typedef _Mybase::pointer pointer
 
typedef _Mybase::const_pointer const_pointer
 
typedef _Mybase::reference reference
 
typedef _Mybase::const_reference const_reference
 
typedef _Mybase::iterator iterator
 
typedef _Mybase::const_iterator const_iterator
 
typedef _STD reverse_iterator< iteratorreverse_iterator
 
typedef _STD reverse_iterator< const_iteratorconst_reverse_iterator
 
using _Use_memcpy_move = bool_constant< _Is_specialization< _Traits, char_traits >::value &&is_trivial< pointer >::value >
 
template<class _Iter >
using _Is_elem_cptr = _Disjunction_t< is_same< _Iter, const _Elem *const >, is_same< _Iter, _Elem *const >, is_same< _Iter, const _Elem * >, is_same< _Iter, _Elem * >>
 
- Public Types inherited from _String_alloc< _String_base_types< _Elem, _Alloc > >
enum  
 
enum  
 
typedef _String_alloc< _String_base_types< _Elem, _Alloc > > _Myt
 
typedef _String_base_types< _Elem, _Alloc >::_Alloc _Alloc
 
typedef _String_base_types< _Elem, _Alloc >::_Alty _Alty
 
typedef _String_base_types< _Elem, _Alloc >::_Val_types _Val_types
 
typedef _String_val< _Val_types_Mydata_t
 
typedef _Mydata_t::_Bxty _Bxty
 
typedef _Val_types::value_type value_type
 
typedef _Val_types::size_type size_type
 
typedef _Val_types::difference_type difference_type
 
typedef _Val_types::pointer pointer
 
typedef _Val_types::const_pointer const_pointer
 
typedef _Val_types::reference reference
 
typedef _Val_types::const_reference const_reference
 
typedef _String_iterator< _Mydata_titerator
 
typedef _String_const_iterator< _Mydata_tconst_iterator
 

Public Member Functions

 basic_string (const _Myt &_Right)
 
 basic_string (const _Myt &_Right, const _Alloc &_Al)
 
 basic_string () _NOEXCEPT_OP(is_nothrow_default_constructible< _Alloc >
 
 basic_string (const _Alloc &_Al) _NOEXCEPT
 
 basic_string (const _Myt &_Right, const size_type _Roff, const _Alloc &_Al=_Alloc())
 
 basic_string (const _Myt &_Right, const size_type _Roff, const size_type _Count, const _Alloc &_Al=_Alloc())
 
 basic_string (_In_reads_(_Count) const _Elem *const _Ptr, _CRT_GUARDOVERFLOW const size_type _Count)
 
 basic_string (_In_reads_(_Count) const _Elem *const _Ptr, _CRT_GUARDOVERFLOW const size_type _Count, const _Alloc &_Al)
 
 basic_string (_In_z_ const _Elem *const _Ptr)
 
 basic_string (_In_z_ const _Elem *const _Ptr, const _Alloc &_Al)
 
 basic_string (_CRT_GUARDOVERFLOW const size_type _Count, const _Elem _Ch)
 
 basic_string (_CRT_GUARDOVERFLOW const size_type _Count, const _Elem _Ch, const _Alloc &_Al)
 
template<class _Iter , class = enable_if_t<_Is_iterator<_Iter>::value>>
 basic_string (_Iter _First, _Iter _Last, const _Alloc &_Al=_Alloc())
 
template<class _Iter >
void _Construct (_Iter _First, const _Iter _Last, input_iterator_tag)
 
template<class _Iter >
void _Construct (const _Iter _First, const _Iter _Last, forward_iterator_tag)
 
void _Construct (_Elem *const _First, _Elem *const _Last, random_access_iterator_tag)
 
void _Construct (const _Elem *const _First, const _Elem *const _Last, random_access_iterator_tag)
 
 basic_string (_Myt &&_Right) _NOEXCEPT
 
 basic_string (_Myt &&_Right, const _Alloc &_Al)
 
_Mytoperator= (_Myt &&_Right) _NOEXCEPT_OP(_Alty
 
_Mytassign (_Myt &&_Right) _NOEXCEPT_OP(_Alty
 
void _Assign_rv_contents (_Myt &&_Right, true_type)
 
void _Assign_rv_contents (_Myt &&_Right, false_type)
 
void _Assign_rv_contents_with_alloc_always_equal (_Myt &&_Right, true_type)
 
void _Assign_rv_contents_with_alloc_always_equal (_Myt &&_Right, false_type)
 
void _Assign_lv_contents (const _Myt &_Right)
 
 basic_string (initializer_list< _Elem > _Ilist, const _Alloc &_Al=allocator_type())
 
_Mytoperator= (initializer_list< _Elem > _Ilist)
 
_Mytoperator+= (initializer_list< _Elem > _Ilist)
 
_Mytassign (initializer_list< _Elem > _Ilist)
 
_Mytappend (initializer_list< _Elem > _Ilist)
 
iterator insert (const const_iterator _Where, const initializer_list< _Elem > _Ilist)
 
_Mytreplace (const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
 
 ~basic_string () _NOEXCEPT
 
_Mytoperator= (const _Myt &_Right)
 
_Mytoperator= (_In_z_ const _Elem *const _Ptr)
 
_Mytoperator= (const _Elem _Ch)
 
_Mytoperator+= (const _Myt &_Right)
 
_Mytoperator+= (_In_z_ const _Elem *const _Ptr)
 
_Mytoperator+= (_Elem _Ch)
 
_Mytappend (const _Myt &_Right)
 
_Mytappend (const _Myt &_Right, const size_type _Roff, size_type _Count=npos)
 
_Mytappend (_In_reads_(_Count) const _Elem *const _Ptr, _CRT_GUARDOVERFLOW const size_type _Count)
 
_Mytappend (_In_z_ const _Elem *const _Ptr)
 
_Mytappend (_CRT_GUARDOVERFLOW const size_type _Count, const _Elem _Ch)
 
template<class _Iter , class = enable_if_t<_Is_iterator<_Iter>::value>>
_Mytappend (const _Iter _First, const _Iter _Last)
 
_Mytassign (const _Myt &_Right)
 
_Mytassign (const _Myt &_Right, const size_type _Roff, size_type _Count=npos)
 
_Mytassign (_In_reads_(_Count) const _Elem *const _Ptr, _CRT_GUARDOVERFLOW const size_type _Count)
 
_Mytassign (_In_z_ const _Elem *const _Ptr)
 
_Mytassign (_CRT_GUARDOVERFLOW const size_type _Count, const _Elem _Ch)
 
template<class _Iter , class = enable_if_t<_Is_iterator<_Iter>::value>>
_Mytassign (const _Iter _First, const _Iter _Last)
 
_Mytinsert (const size_type _Off, const _Myt &_Right)
 
_Mytinsert (const size_type _Off, const _Myt &_Right, const size_type _Roff, size_type _Count=npos)
 
_Mytinsert (const size_type _Off, _In_reads_(_Count) const _Elem *const _Ptr, _CRT_GUARDOVERFLOW const size_type _Count)
 
_Mytinsert (const size_type _Off, _In_z_ const _Elem *const _Ptr)
 
_Mytinsert (const size_type _Off, _CRT_GUARDOVERFLOW const size_type _Count, const _Elem _Ch)
 
iterator insert (const const_iterator _Where, const _Elem _Ch)
 
iterator insert (const const_iterator _Where, _CRT_GUARDOVERFLOW const size_type _Count, const _Elem _Ch)
 
template<class _Iter , class = enable_if_t<_Is_iterator<_Iter>::value>>
iterator insert (const const_iterator _Where, const _Iter _First, const _Iter _Last)
 
_Myterase (const size_type _Off=0)
 
_Myterase (const size_type _Off, const size_type _Count)
 
iterator erase (const const_iterator _Where)
 
iterator erase (const const_iterator _First, const const_iterator _Last)
 
void clear () _NOEXCEPT
 
_Mytreplace (const size_type _Off, const size_type _N0, const _Myt &_Right)
 
_Mytreplace (const size_type _Off, size_type _N0, const _Myt &_Right, const size_type _Roff, size_type _Count=npos)
 
_Mytreplace (const size_type _Off, size_type _N0, _In_reads_(_Count) const _Elem *const _Ptr, const size_type _Count)
 
_Mytreplace (const size_type _Off, const size_type _N0, _In_z_ const _Elem *const _Ptr)
 
_Mytreplace (const size_type _Off, size_type _N0, const size_type _Count, const _Elem _Ch)
 
_Mytreplace (const const_iterator _First, const const_iterator _Last, const _Myt &_Right)
 
_Mytreplace (const const_iterator _First, const const_iterator _Last, _In_reads_(_Count) const _Elem *const _Ptr, const size_type _Count)
 
_Mytreplace (const const_iterator _First, const const_iterator _Last, _In_z_ const _Elem *const _Ptr)
 
_Mytreplace (const const_iterator _First, const const_iterator _Last, const size_type _Count, const _Elem _Ch)
 
template<class _Iter >
_Myt_Replace_range (const const_iterator _First, const const_iterator _Last, const _Iter _First2, const _Iter _Last2, false_type)
 
template<class _Ptr >
_Myt_Replace_range (const const_iterator _First, const const_iterator _Last, const _Ptr _First2, const _Ptr _Last2, true_type)
 
template<class _Iter , class = enable_if_t<_Is_iterator<_Iter>::value>>
_Mytreplace (const const_iterator _First, const const_iterator _Last, const _Iter _First2, const _Iter _Last2)
 
iterator begin () _NOEXCEPT
 
const_iterator begin () const _NOEXCEPT
 
iterator end () _NOEXCEPT
 
const_iterator end () const _NOEXCEPT
 
reverse_iterator rbegin () _NOEXCEPT
 
const_reverse_iterator rbegin () const _NOEXCEPT
 
reverse_iterator rend () _NOEXCEPT
 
const_reverse_iterator rend () const _NOEXCEPT
 
const_iterator cbegin () const _NOEXCEPT
 
const_iterator cend () const _NOEXCEPT
 
const_reverse_iterator crbegin () const _NOEXCEPT
 
const_reverse_iterator crend () const _NOEXCEPT
 
void shrink_to_fit ()
 
reference at (const size_type _Off)
 
const_reference at (const size_type _Off) const
 
reference operator[] (const size_type _Off)
 
const_reference operator[] (const size_type _Off) const
 
void push_back (const _Elem _Ch)
 
void pop_back ()
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
_Ret_z_ const _Elem * c_str () const _NOEXCEPT
 
_Ret_z_ const _Elem * data () const _NOEXCEPT
 
size_type length () const _NOEXCEPT
 
size_type size () const _NOEXCEPT
 
size_type max_size () const _NOEXCEPT
 
void resize (_CRT_GUARDOVERFLOW const size_type _Newsize)
 
void resize (_CRT_GUARDOVERFLOW const size_type _Newsize, const _Elem _Ch)
 
size_type capacity () const _NOEXCEPT
 
void reserve (_CRT_GUARDOVERFLOW const size_type _Newcap=0)
 
bool empty () const _NOEXCEPT
 
size_type copy (_Out_writes_(_Count) _Elem *const _Ptr, size_type _Count, const size_type _Off=0) const
 
 _Pre_satisfies_ (_Dest_size >=_Count) size_type _Copy_s(_Out_writes_all_(_Dest_size) _Elem *const _Dest
 
- Public Member Functions inherited from _String_alloc< _String_base_types< _Elem, _Alloc > >
value_type_Myptr ()
 
const value_type_Myptr () const
 
 _String_alloc ()
 
 _String_alloc (_Any_alloc &&_Al)
 
void _Copy_alloc (const _Alty &_Al)
 
void _Move_alloc (_Alty &_Al)
 
void _Orphan_all ()
 
void _Swap_all (_Myt &_Right)
 
_Alty_Getal () _NOEXCEPT
 
const _Alty_Getal () const _NOEXCEPT
 
_Mydata_t_Get_data () _NOEXCEPT
 
const _Mydata_t_Get_data () const _NOEXCEPT
 
size_type_Mysize () _NOEXCEPT
 
const size_type_Mysize () const _NOEXCEPT
 
size_type_Myres () _NOEXCEPT
 
const size_type_Myres () const _NOEXCEPT
 

Public Attributes

const size_type _Dest_size
 
const size_type size_type _Count
 

Static Public Attributes

static constexpr size_t _Memcpy_move_offset = offsetof(_Mydata_t, _Bx)
 
static constexpr size_t _Memcpy_move_size = sizeof(_Mydata_t) - _Memcpy_move_offset
 
static _PGLOBAL const size_type npos
 

Member Typedef Documentation

template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::_Alty basic_string< _Elem, _Traits, _Alloc >::_Alty
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
template<class _Iter >
using basic_string< _Elem, _Traits, _Alloc >::_Is_elem_cptr = _Disjunction_t< is_same<_Iter, const _Elem * const>, is_same<_Iter, _Elem * const>, is_same<_Iter, const _Elem *>, is_same<_Iter, _Elem *>>
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _String_alloc<_String_base_types<_Elem, _Alloc> > basic_string< _Elem, _Traits, _Alloc >::_Mybase
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::_Mydata_t basic_string< _Elem, _Traits, _Alloc >::_Mydata_t
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef basic_string<_Elem, _Traits, _Alloc> basic_string< _Elem, _Traits, _Alloc >::_Myt
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
using basic_string< _Elem, _Traits, _Alloc >::_Use_memcpy_move = bool_constant< _Is_specialization<_Traits, char_traits>::value && is_trivial<pointer>::value>
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Alloc basic_string< _Elem, _Traits, _Alloc >::allocator_type
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::const_iterator basic_string< _Elem, _Traits, _Alloc >::const_iterator
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::const_pointer basic_string< _Elem, _Traits, _Alloc >::const_pointer
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::const_reference basic_string< _Elem, _Traits, _Alloc >::const_reference
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _STD reverse_iterator<const_iterator> basic_string< _Elem, _Traits, _Alloc >::const_reverse_iterator
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::difference_type basic_string< _Elem, _Traits, _Alloc >::difference_type
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::iterator basic_string< _Elem, _Traits, _Alloc >::iterator
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::pointer basic_string< _Elem, _Traits, _Alloc >::pointer
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::reference basic_string< _Elem, _Traits, _Alloc >::reference
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _STD reverse_iterator<iterator> basic_string< _Elem, _Traits, _Alloc >::reverse_iterator
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::size_type basic_string< _Elem, _Traits, _Alloc >::size_type
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Traits basic_string< _Elem, _Traits, _Alloc >::traits_type
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
typedef _Mybase::value_type basic_string< _Elem, _Traits, _Alloc >::value_type

Constructor & Destructor Documentation

template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Myt _Right)
inline
1924  : _Mybase(_Right._Getal().select_on_container_copy_construction())
1925  { // construct by copying _Right
1926  _Tidy_init();
1928  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
void _Assign_lv_contents(const _Myt &_Right)
Definition: xstring:2171
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Myt _Right,
const _Alloc _Al 
)
inline
1931  : _Mybase(_Al)
1932  { // construct by copying with allocator
1933  _Tidy_init();
1935  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
void _Assign_lv_contents(const _Myt &_Right)
Definition: xstring:2171
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( )
inline
1938  : _Mybase()
1939  { // construct empty string
1940  _Tidy_init();
1941  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Alloc _Al)
inlineexplicit
1944  : _Mybase(_Al)
1945  { // construct empty string with allocator
1946  _Tidy_init();
1947  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Myt _Right,
const size_type  _Roff,
const _Alloc _Al = _Alloc() 
)
inline
1950  : _Mybase(_Al)
1951  { // construct from _Right [_Roff, <end>)
1952  _Tidy_init();
1953  assign(_Right, _Roff, npos);
1954  }
static _PGLOBAL const size_type npos
Definition: xstring:2219
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( const _Myt _Right,
const size_type  _Roff,
const size_type  _Count,
const _Alloc _Al = _Alloc() 
)
inline
1957  : _Mybase(_Al)
1958  { // construct from _Right [_Roff, _Roff + _Count)
1959  _Tidy_init();
1960  assign(_Right, _Roff, _Count);
1961  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
const size_type size_type _Count
Definition: xstring:3106
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _In_reads_(_Count) const _Elem *const  _Ptr,
_CRT_GUARDOVERFLOW const size_type  _Count 
)
inline
1964  : _Mybase()
1965  { // construct from [_Ptr, _Ptr + _Count)
1966  _Tidy_init();
1967  assign(_Ptr, _Count);
1968  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
const size_type size_type _Count
Definition: xstring:3106
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _In_reads_(_Count) const _Elem *const  _Ptr,
_CRT_GUARDOVERFLOW const size_type  _Count,
const _Alloc _Al 
)
inline
1972  : _Mybase(_Al)
1973  { // construct from [_Ptr, _Ptr + _Count) with allocator
1974  _Tidy_init();
1975  assign(_Ptr, _Count);
1976  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
const size_type size_type _Count
Definition: xstring:3106
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _In_z_ const _Elem *const  _Ptr)
inline
1979  : _Mybase()
1980  { // construct from [_Ptr, <null>)
1981  _Tidy_init();
1982  assign(_Ptr);
1983  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _In_z_ const _Elem *const  _Ptr,
const _Alloc _Al 
)
inline
1986  : _Mybase(_Al)
1987  { // construct from [_Ptr, <null>) with allocator
1988  _Tidy_init();
1989  assign(_Ptr);
1990  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _CRT_GUARDOVERFLOW const size_type  _Count,
const _Elem  _Ch 
)
inline
1993  : _Mybase()
1994  { // construct from _Count * _Ch
1995  _Tidy_init();
1996  assign(_Count, _Ch);
1997  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
const size_type size_type _Count
Definition: xstring:3106
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _CRT_GUARDOVERFLOW const size_type  _Count,
const _Elem  _Ch,
const _Alloc _Al 
)
inline
2000  : _Mybase(_Al)
2001  { // construct from _Count * _Ch with allocator
2002  _Tidy_init();
2003  assign(_Count, _Ch);
2004  }
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
const size_type size_type _Count
Definition: xstring:3106
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
template<class _Iter , class = enable_if_t<_Is_iterator<_Iter>::value>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _Iter  _First,
_Iter  _Last,
const _Alloc _Al = _Alloc() 
)
inline
2009  : _Mybase(_Al)
2010  { // construct from [_First, _Last) with optional allocator
2011  _DEBUG_RANGE(_First, _Last);
2012  _Tidy_init();
2014  }
#define _DEBUG_RANGE(first, last)
Definition: xutility:902
typename iterator_traits< _Iter >::iterator_category _Iter_cat_t
Definition: xutility:657
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
_String_const_iterator< _Mystr >::_Unchecked_type _Unchecked(_String_const_iterator< _Mystr > _Iter)
Definition: xstring:1377
void _Construct(_Iter _First, const _Iter _Last, input_iterator_tag)
Definition: xstring:2017
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _Myt &&  _Right)
inline
2053  : _Mybase(_STD move(_Right._Getal()))
2054  { // construct by moving _Right
2056  }
bool_constant< _Is_specialization< _Traits, char_traits >::value &&is_trivial< pointer >::value > _Use_memcpy_move
Definition: xstring:1903
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
void _Assign_rv_contents_with_alloc_always_equal(_Myt &&_Right, true_type)
Definition: xstring:2121
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( _Myt &&  _Right,
const _Alloc _Al 
)
inline
2059  : _Mybase(_Al)
2060  { // construct by moving _Right, allocator
2061  _Assign_rv_contents(_STD move(_Right), typename _Alty::is_always_equal{});
2062  }
void _Assign_rv_contents(_Myt &&_Right, true_type)
Definition: xstring:2097
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::basic_string ( initializer_list< _Elem >  _Ilist,
const _Alloc _Al = allocator_type() 
)
inline
2178  : _Mybase(_Al)
2179  { // construct from initializer_list
2180  _Tidy_init();
2181  assign(_Ilist.begin(), _Ilist.end());
2182  }
constexpr const _Elem * end() const _NOEXCEPT
Definition: initializer_list:44
_String_alloc< _String_base_types< _Elem, _Alloc > > _Mybase
Definition: xstring:1871
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
constexpr const _Elem * begin() const _NOEXCEPT
Definition: initializer_list:39
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::~basic_string ( )
inline
2215  { // destroy the string
2216  _Tidy_deallocate();
2217  }

Member Function Documentation

template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::_Assign_lv_contents ( const _Myt _Right)
inline
2172  { // assign by copying the data stored in _Right
2173  // pre: *this is in a valid but unspecified state
2174  assign(_Right, 0, npos);
2175  }
static _PGLOBAL const size_type npos
Definition: xstring:2219
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::_Assign_rv_contents ( _Myt &&  _Right,
true_type   
)
inline
2098  { // assign either as an rvalue or as an lvalue copy, allocators always equal optimization
2099  // pre: this != &_Right
2100  // pre: allocator propagation (POCMA) from _Right, if necessary, is complete
2101  // pre: *this owns no memory, iterators orphaned (note: _Buf/_Ptr/_Mysize/_Myres may be garbage init)
2103  }
bool_constant< _Is_specialization< _Traits, char_traits >::value &&is_trivial< pointer >::value > _Use_memcpy_move
Definition: xstring:1903
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
void _Assign_rv_contents_with_alloc_always_equal(_Myt &&_Right, true_type)
Definition: xstring:2121
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::_Assign_rv_contents ( _Myt &&  _Right,
false_type   
)
inline
2106  { // assign either as an rvalue or as an lvalue copy, allocators potentially unequal
2107  // pre: this != &_Right
2108  // pre: allocator propagation (POCMA) from _Right, if necessary, is complete
2109  // pre: *this owns no memory, iterators orphaned (note: _Buf/_Ptr/_Mysize/_Myres may be garbage init)
2110  if (this->_Getal() == _Right._Getal())
2111  {
2113  }
2114  else
2115  {
2116  _Tidy_init();
2118  }
2119  }
bool_constant< _Is_specialization< _Traits, char_traits >::value &&is_trivial< pointer >::value > _Use_memcpy_move
Definition: xstring:1903
_Alty & _Getal() _NOEXCEPT
Definition: xstring:1817
void _Assign_lv_contents(const _Myt &_Right)
Definition: xstring:2171
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
void _Assign_rv_contents_with_alloc_always_equal(_Myt &&_Right, true_type)
Definition: xstring:2121
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::_Assign_rv_contents_with_alloc_always_equal ( _Myt &&  _Right,
true_type   
)
inline
2122  { // assign by stealing _Right's buffer, memcpy optimization
2123  // pre: this != &_Right
2124  // pre: allocator propagation (POCMA) from _Right, if necessary, is complete
2125  // pre: *this owns no memory, iterators orphaned (note: _Buf/_Ptr/_Mysize/_Myres may be garbage init)
2126  auto& _Right_data = _Right._Get_data();
2127 
2128 #if _ITERATOR_DEBUG_LEVEL != 0
2129  if (_Right_data._Large_string_engaged())
2130  { // take ownership of _Right's iterators along with its buffer
2131  this->_Swap_all(_Right);
2132  }
2133  else
2134  {
2135  _Right._Orphan_all();
2136  }
2137 #endif /* _ITERATOR_DEBUG_LEVEL != 0 */
2138 
2139  const auto _My_data_mem = reinterpret_cast<unsigned char *>(_STD addressof(this->_Get_data()))
2141  const auto _Right_data_mem = reinterpret_cast<unsigned char *>(_STD addressof(_Right_data))
2143  _CSTD memcpy(_My_data_mem, _Right_data_mem, _Memcpy_move_size);
2144  _Right._Tidy_init();
2145  }
_Mydata_t & _Get_data() _NOEXCEPT
Definition: xstring:1827
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
void _Swap_all(_Myt &_Right)
Definition: xstring:1812
static constexpr size_t _Memcpy_move_offset
Definition: xstring:1905
memcpy(_Destination, _Source, _SourceSize)
#define _CSTD
Definition: yvals.h:570
static constexpr size_t _Memcpy_move_size
Definition: xstring:1906
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::_Assign_rv_contents_with_alloc_always_equal ( _Myt &&  _Right,
false_type   
)
inline
2148  { // assign by stealing _Right's buffer, general case
2149  // pre: this != &_Right
2150  // pre: allocator propagation (POCMA) from _Right, if necessary, is complete
2151  // pre: *this owns no memory, iterators orphaned (note: _Buf/_Ptr/_Mysize/_Myres may be garbage init)
2152  auto& _My_data = this->_Get_data();
2153  auto& _Right_data = _Right._Get_data();
2154  if (_Right_data._Large_string_engaged())
2155  { // steal buffer
2156  this->_Getal().construct(_STD addressof(_My_data._Bx._Ptr), _Right_data._Bx._Ptr);
2157  _Right_data._Bx._Ptr = pointer();
2158  this->_Swap_all(_Right);
2159  }
2160  else
2161  { // copy small string buffer
2162  _Traits::copy(_My_data._Bx._Buf, _Right_data._Bx._Buf, _Right_data._Mysize + 1);
2163  _Right._Orphan_all();
2164  }
2165 
2166  _My_data._Mysize = _Right_data._Mysize;
2167  _My_data._Myres = _Right_data._Myres;
2168  _Right._Tidy_init();
2169  }
_Mydata_t & _Get_data() _NOEXCEPT
Definition: xstring:1827
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Alty & _Getal() _NOEXCEPT
Definition: xstring:1817
void _Swap_all(_Myt &_Right)
Definition: xstring:1812
_Mybase::pointer pointer
Definition: xstring:1881
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
template<class _Iter >
void basic_string< _Elem, _Traits, _Alloc >::_Construct ( _Iter  _First,
const _Iter  _Last,
input_iterator_tag   
)
inline
2018  { // initialize from [_First, _Last), input iterators
2019  _TRY_BEGIN
2020  for (; _First != _Last; ++_First)
2021  push_back(static_cast<_Elem>(*_First));
2022  _CATCH_ALL
2023  _Tidy_deallocate();
2024  _RERAISE;
2025  _CATCH_END
2026  }
#define _TRY_BEGIN
Definition: xstddef:26
#define _CATCH_END
Definition: xstddef:29
#define _CATCH_ALL
Definition: xstddef:28
#define _RERAISE
Definition: xstddef:32
void push_back(const _Elem _Ch)
Definition: xstring:2961
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
template<class _Iter >
void basic_string< _Elem, _Traits, _Alloc >::_Construct ( const _Iter  _First,
const _Iter  _Last,
forward_iterator_tag   
)
inline
2030  { // initialize from [_First, _Last), forward iterators
2031  const size_type _Count = _STD distance(_First, _Last);
2032  reserve(_Count);
2033  _Construct(_First, _Last, input_iterator_tag());
2034  }
_Iter_diff_t< _InIt > distance(_InIt _First, _InIt _Last)
Definition: xutility:1111
Definition: xutility:508
const size_type size_type _Count
Definition: xstring:3106
void _Construct(_Iter _First, const _Iter _Last, input_iterator_tag)
Definition: xstring:2017
_Mybase::size_type size_type
Definition: xstring:1879
_FwdIt _Last
Definition: algorithm:1936
void reserve(_CRT_GUARDOVERFLOW const size_type _Newcap=0)
Definition: xstring:3056
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::_Construct ( _Elem *const  _First,
_Elem *const  _Last,
random_access_iterator_tag   
)
inline
2037  { // initialize from [_First, _Last), pointers
2038  if (_First != _Last)
2039  {
2040  assign(_First, _Last - _First);
2041  }
2042  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::_Construct ( const _Elem *const  _First,
const _Elem *const  _Last,
random_access_iterator_tag   
)
inline
2045  { // initialize from [_First, _Last), const pointers
2046  if (_First != _Last)
2047  {
2048  assign(_First, _Last - _First);
2049  }
2050  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
basic_string< _Elem, _Traits, _Alloc >::_Pre_satisfies_ ( _Dest_size >=  _Count) const
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
template<class _Iter >
_Myt& basic_string< _Elem, _Traits, _Alloc >::_Replace_range ( const const_iterator  _First,
const const_iterator  _Last,
const _Iter  _First2,
const _Iter  _Last2,
false_type   
)
inline
2825  { // replace [_First, _Last) with [_First2, _Last2), input iterators
2826  const _Myt _Right(_First2, _Last2, get_allocator());
2827  replace(_First, _Last, _Right);
2828  return (*this);
2829  }
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:1870
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
_FwdIt _Last
Definition: algorithm:1936
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
template<class _Ptr >
_Myt& basic_string< _Elem, _Traits, _Alloc >::_Replace_range ( const const_iterator  _First,
const const_iterator  _Last,
const _Ptr  _First2,
const _Ptr  _Last2,
true_type   
)
inline
2834  { // replace [_First, _Last) with [_First2, _Last2), pointers
2835  if (_First2 == _Last2)
2836  {
2837  erase(_First - cbegin(), _Last - _First);
2838  }
2839  else
2840  {
2841  replace(_First - cbegin(), _Last - _First, _First2, _Last2 - _First2);
2842  }
2843 
2844  return (*this);
2845  }
_Myt & erase(const size_type _Off=0)
Definition: xstring:2584
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
const_iterator cbegin() const _NOEXCEPT
Definition: xstring:2901
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( initializer_list< _Elem >  _Ilist)
inline
2200  { // append initializer_list
2201  return (append(_Ilist.begin(), _Ilist.end()));
2202  }
constexpr const _Elem * end() const _NOEXCEPT
Definition: initializer_list:44
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
constexpr const _Elem * begin() const _NOEXCEPT
Definition: initializer_list:39
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Myt _Right)
inline
2283  { // append _Right
2284  return (append(_Right, 0, npos));
2285  }
static _PGLOBAL const size_type npos
Definition: xstring:2219
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Myt _Right,
const size_type  _Roff,
size_type  _Count = npos 
)
inline
2288  { // append _Right [_Roff, _Roff + _Count)
2289  _Right._Check_offset(_Roff);
2290  _Count = _Right._Clamp_suffix_size(_Roff, _Count);
2291  if (npos - this->_Mysize() <= _Count)
2292  {
2293  _Xlen(); // result too long
2294  }
2295 
2296  const size_type _Num = this->_Mysize() + _Count;
2297  if (_Count != 0 && _Grow(_Num))
2298  { // make room and append new stuff
2299  _Traits::copy(this->_Myptr() + this->_Mysize(), _Right._Myptr() + _Roff, _Count);
2300  _Eos(_Num);
2301  }
2302  return (*this);
2303  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
static _PGLOBAL const size_type npos
Definition: xstring:2219
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
_Mybase::size_type size_type
Definition: xstring:1879
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( _In_reads_(_Count) const _Elem *const  _Ptr,
_CRT_GUARDOVERFLOW const size_type  _Count 
)
inline
2321  { // append [_Ptr, _Ptr + _Count)
2322  if (_Inside(_Ptr))
2323  {
2324  return (append(*this, _Ptr - this->_Myptr(), _Count)); // substring
2325  }
2326 
2327  if (npos - this->_Mysize() <= _Count)
2328  {
2329  _Xlen(); // result too long
2330  }
2331 
2332  const size_type _Num = this->_Mysize() + _Count;
2333  if (_Count != 0 && _Grow(_Num))
2334  { // make room and append new stuff
2335  _Traits::copy(this->_Myptr() + this->_Mysize(), _Ptr, _Count);
2336  _Eos(_Num);
2337  }
2338 
2339  return (*this);
2340  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
static _PGLOBAL const size_type npos
Definition: xstring:2219
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( _In_z_ const _Elem *const  _Ptr)
inline
2343  { // append [_Ptr, <null>)
2344  return (append(_Ptr, _Traits::length(_Ptr)));
2345  }
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( _CRT_GUARDOVERFLOW const size_type  _Count,
const _Elem  _Ch 
)
inline
2348  { // append _Count * _Ch
2349  if (npos - this->_Mysize() <= _Count)
2350  {
2351  _Xlen(); // result too long
2352  }
2353 
2354  const size_type _Num = this->_Mysize() + _Count;
2355  if (_Count != 0 && _Grow(_Num))
2356  { // make room and append new stuff using assign
2357  _Chassign(this->_Mysize(), _Count, _Ch);
2358  _Eos(_Num);
2359  }
2360 
2361  return (*this);
2362  }
static _PGLOBAL const size_type npos
Definition: xstring:2219
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
const size_type size_type _Count
Definition: xstring:3106
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
template<class _Iter , class = enable_if_t<_Is_iterator<_Iter>::value>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::append ( const _Iter  _First,
const _Iter  _Last 
)
inline
2367  { // append [_First, _Last), input iterators
2368  return (replace(end(), end(), _First, _Last));
2369  }
iterator end() _NOEXCEPT
Definition: xstring:2869
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( _Myt &&  _Right)
inline
2092  { // assign by moving _Right
2093  *this = _STD move(_Right);
2094  return (*this);
2095  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( initializer_list< _Elem >  _Ilist)
inline
2195  { // assign initializer_list
2196  return (assign(_Ilist.begin(), _Ilist.end()));
2197  }
constexpr const _Elem * end() const _NOEXCEPT
Definition: initializer_list:44
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
constexpr const _Elem * begin() const _NOEXCEPT
Definition: initializer_list:39
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Myt _Right)
inline
2372  { // assign _Right
2373  *this = _Right;
2374  return (*this);
2375  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Myt _Right,
const size_type  _Roff,
size_type  _Count = npos 
)
inline
2378  { // assign _Right [_Roff, _Roff + _Count)
2379  _Right._Check_offset(_Roff);
2380  _Count = _Right._Clamp_suffix_size(_Roff, _Count);
2381 
2382  if (this == _STD addressof(_Right))
2383  { // substring
2384  erase(_Roff + _Count);
2385  erase(0, _Roff);
2386  }
2387  else if (_Grow(_Count))
2388  { // make room and assign new stuff
2389  _Traits::copy(this->_Myptr(), _Right._Myptr() + _Roff, _Count);
2390  _Eos(_Count);
2391  }
2392 
2393  return (*this);
2394  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Myt & erase(const size_type _Off=0)
Definition: xstring:2584
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( _In_reads_(_Count) const _Elem *const  _Ptr,
_CRT_GUARDOVERFLOW const size_type  _Count 
)
inline
2412  { // assign [_Ptr, _Ptr + _Count)
2413  if (_Inside(_Ptr))
2414  {
2415  return (assign(*this, _Ptr - this->_Myptr(), _Count)); // substring
2416  }
2417 
2418  if (_Grow(_Count))
2419  { // make room and assign new stuff
2420  _Traits::copy(this->_Myptr(), _Ptr, _Count);
2421  _Eos(_Count);
2422  }
2423 
2424  return (*this);
2425  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( _In_z_ const _Elem *const  _Ptr)
inline
2428  { // assign [_Ptr, <null>)
2429  return (assign(_Ptr, _Traits::length(_Ptr)));
2430  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( _CRT_GUARDOVERFLOW const size_type  _Count,
const _Elem  _Ch 
)
inline
2433  { // assign _Count * _Ch
2434  if (_Count == npos)
2435  {
2436  _Xlen(); // result too long
2437  }
2438 
2439  if (_Grow(_Count))
2440  { // make room and assign new stuff
2441  _Chassign(0, _Count, _Ch);
2442  _Eos(_Count);
2443  }
2444 
2445  return (*this);
2446  }
static _PGLOBAL const size_type npos
Definition: xstring:2219
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
const size_type size_type _Count
Definition: xstring:3106
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
template<class _Iter , class = enable_if_t<_Is_iterator<_Iter>::value>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::assign ( const _Iter  _First,
const _Iter  _Last 
)
inline
2451  { // assign [_First, _Last), input iterators
2452  return (replace(begin(), end(), _First, _Last));
2453  }
iterator end() _NOEXCEPT
Definition: xstring:2869
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
iterator begin() _NOEXCEPT
Definition: xstring:2857
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
reference basic_string< _Elem, _Traits, _Alloc >::at ( const size_type  _Off)
inline
2931  { // subscript mutable sequence with checking
2932  _Check_offset_exclusive(_Off);
2933  return (this->_Myptr()[_Off]);
2934  }
value_type * _Myptr()
Definition: xstring:1683
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_reference basic_string< _Elem, _Traits, _Alloc >::at ( const size_type  _Off) const
inline
2937  { // subscript immutable sequence with checking
2938  _Check_offset_exclusive(_Off);
2939  return (this->_Myptr()[_Off]);
2940  }
value_type * _Myptr()
Definition: xstring:1683
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
reference basic_string< _Elem, _Traits, _Alloc >::back ( )
inline
2992  { // return last element of mutable sequence
2993  return (*(end() - 1));
2994  }
iterator end() _NOEXCEPT
Definition: xstring:2869
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_reference basic_string< _Elem, _Traits, _Alloc >::back ( ) const
inline
2997  { // return last element of immutable sequence
2998  return (*(end() - 1));
2999  }
iterator end() _NOEXCEPT
Definition: xstring:2869
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
iterator basic_string< _Elem, _Traits, _Alloc >::begin ( )
inline
2858  { // return iterator for beginning of mutable sequence
2859  auto _My_data = _STD addressof(this->_Get_data());
2860  return (iterator(this->_Getal().address(*_My_data->_Myptr()), _My_data));
2861  }
_Mydata_t & _Get_data() _NOEXCEPT
Definition: xstring:1827
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Mybase::iterator iterator
Definition: xstring:1886
_Alty & _Getal() _NOEXCEPT
Definition: xstring:1817
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_iterator basic_string< _Elem, _Traits, _Alloc >::begin ( ) const
inline
2864  { // return iterator for beginning of immutable sequence
2865  auto _My_data = _STD addressof(this->_Get_data());
2866  return (const_iterator(this->_Getal().address(*_My_data->_Myptr()), _My_data));
2867  }
_Mydata_t & _Get_data() _NOEXCEPT
Definition: xstring:1827
_Mybase::const_iterator const_iterator
Definition: xstring:1887
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Alty & _Getal() _NOEXCEPT
Definition: xstring:1817
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Ret_z_ const _Elem* basic_string< _Elem, _Traits, _Alloc >::c_str ( ) const
inline
3002  { // return pointer to null-terminated immutable array
3003  return (this->_Myptr());
3004  }
value_type * _Myptr()
Definition: xstring:1683
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
size_type basic_string< _Elem, _Traits, _Alloc >::capacity ( ) const
inline
3052  { // return current length of allocated storage
3053  return (this->_Myres());
3054  }
size_type & _Myres() _NOEXCEPT
Definition: xstring:1847
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_iterator basic_string< _Elem, _Traits, _Alloc >::cbegin ( ) const
inline
2902  { // return iterator for beginning of immutable sequence
2903  return (begin());
2904  }
iterator begin() _NOEXCEPT
Definition: xstring:2857
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_iterator basic_string< _Elem, _Traits, _Alloc >::cend ( ) const
inline
2907  { // return iterator for end of immutable sequence
2908  return (end());
2909  }
iterator end() _NOEXCEPT
Definition: xstring:2869
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::clear ( )
inline
2625  { // erase all
2626  _Eos(0);
2627  }
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
size_type basic_string< _Elem, _Traits, _Alloc >::copy ( _Out_writes_(_Count) _Elem *const  _Ptr,
size_type  _Count,
const size_type  _Off = 0 
) const
inline
3098  { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
3099  _Check_offset(_Off);
3100  _Count = _Clamp_suffix_size(_Off, _Count);
3101  _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
3102  return (_Count);
3103  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::crbegin ( ) const
inline
2912  { // return iterator for beginning of reversed immutable sequence
2913  return (rbegin());
2914  }
reverse_iterator rbegin() _NOEXCEPT
Definition: xstring:2881
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::crend ( ) const
inline
2917  { // return iterator for end of reversed immutable sequence
2918  return (rend());
2919  }
reverse_iterator rend() _NOEXCEPT
Definition: xstring:2891
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Ret_z_ const _Elem* basic_string< _Elem, _Traits, _Alloc >::data ( ) const
inline
3007  { // return pointer to immutable array
3008  return (this->_Myptr());
3009  }
value_type * _Myptr()
Definition: xstring:1683
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
bool basic_string< _Elem, _Traits, _Alloc >::empty ( ) const
inline
3091  { // test if sequence is empty
3092  return (this->_Mysize() == 0);
3093  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
iterator basic_string< _Elem, _Traits, _Alloc >::end ( )
inline
2870  { // return iterator for end of mutable sequence
2871  auto _My_data = _STD addressof(this->_Get_data());
2872  return (iterator(this->_Getal().address(*_My_data->_Myptr()) + _My_data->_Mysize, _My_data));
2873  }
_Mydata_t & _Get_data() _NOEXCEPT
Definition: xstring:1827
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Mybase::iterator iterator
Definition: xstring:1886
_Alty & _Getal() _NOEXCEPT
Definition: xstring:1817
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_iterator basic_string< _Elem, _Traits, _Alloc >::end ( ) const
inline
2876  { // return iterator for end of immutable sequence
2877  auto _My_data = _STD addressof(this->_Get_data());
2878  return (const_iterator(this->_Getal().address(*_My_data->_Myptr()) + _My_data->_Mysize, _My_data));
2879  }
_Mydata_t & _Get_data() _NOEXCEPT
Definition: xstring:1827
_Mybase::const_iterator const_iterator
Definition: xstring:1887
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Alty & _Getal() _NOEXCEPT
Definition: xstring:1817
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::erase ( const size_type  _Off = 0)
inline
2585  { // erase elements [_Off, ...)
2586  _Check_offset(_Off);
2587  _Eos(_Off);
2588  return (*this);
2589  }
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::erase ( const size_type  _Off,
const size_type  _Count 
)
inline
2592  { // erase elements [_Off, _Off + _Count)
2593  _Check_offset(_Off);
2594  if (this->_Mysize() - _Off <= _Count)
2595  {
2596  _Eos(_Off); // erase elements [_Off, ...)
2597  }
2598  else if (_Count != 0)
2599  { // move elements down
2600  value_type *_Ptr = this->_Myptr() + _Off;
2601  size_type _Newsize = this->_Mysize() - _Count;
2602  _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
2603  _Eos(_Newsize);
2604  }
2605 
2606  return (*this);
2607  }
_Mybase::value_type value_type
Definition: xstring:1878
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
iterator basic_string< _Elem, _Traits, _Alloc >::erase ( const const_iterator  _Where)
inline
2610  { // erase element at _Where
2611  const size_type _Count = _Where - begin();
2612  erase(_Count, 1);
2613  return (begin() + _Count);
2614  }
_Myt & erase(const size_type _Off=0)
Definition: xstring:2584
const size_type size_type _Count
Definition: xstring:3106
iterator begin() _NOEXCEPT
Definition: xstring:2857
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
iterator basic_string< _Elem, _Traits, _Alloc >::erase ( const const_iterator  _First,
const const_iterator  _Last 
)
inline
2617  { // erase substring [_First, _Last)
2618  _DEBUG_RANGE(_First, _Last);
2619  const size_type _Count = _First - begin();
2620  erase(_Count, _Last - _First);
2621  return (begin() + _Count);
2622  }
#define _DEBUG_RANGE(first, last)
Definition: xutility:902
_Myt & erase(const size_type _Off=0)
Definition: xstring:2584
const size_type size_type _Count
Definition: xstring:3106
iterator begin() _NOEXCEPT
Definition: xstring:2857
_Mybase::size_type size_type
Definition: xstring:1879
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
reference basic_string< _Elem, _Traits, _Alloc >::front ( )
inline
2982  { // return first element of mutable sequence
2983  return (*begin());
2984  }
iterator begin() _NOEXCEPT
Definition: xstring:2857
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_reference basic_string< _Elem, _Traits, _Alloc >::front ( ) const
inline
2987  { // return first element of immutable sequence
2988  return (*begin());
2989  }
iterator begin() _NOEXCEPT
Definition: xstring:2857
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const const_iterator  _Where,
const initializer_list< _Elem >  _Ilist 
)
inline
2205  { // insert initializer_list
2206  return (insert(_Where, _Ilist.begin(), _Ilist.end()));
2207  }
constexpr const _Elem * end() const _NOEXCEPT
Definition: initializer_list:44
iterator insert(const const_iterator _Where, const initializer_list< _Elem > _Ilist)
Definition: xstring:2204
constexpr const _Elem * begin() const _NOEXCEPT
Definition: initializer_list:39
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( const size_type  _Off,
const _Myt _Right 
)
inline
2456  { // insert _Right at _Off
2457  return (insert(_Off, _Right, 0, npos));
2458  }
static _PGLOBAL const size_type npos
Definition: xstring:2219
iterator insert(const const_iterator _Where, const initializer_list< _Elem > _Ilist)
Definition: xstring:2204
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( const size_type  _Off,
const _Myt _Right,
const size_type  _Roff,
size_type  _Count = npos 
)
inline
2461  { // insert _Right [_Roff, _Roff + _Count) at _Off
2462  _Check_offset(_Off);
2463  _Right._Check_offset(_Roff);
2464  _Count = _Right._Clamp_suffix_size(_Roff, _Count);
2465  if (npos - this->_Mysize() <= _Count)
2466  {
2467  _Xlen(); // result too long
2468  }
2469 
2470  const size_type _Num = this->_Mysize() + _Count;
2471  if (_Count != 0 && _Grow(_Num))
2472  { // make room and insert new stuff
2473  _Traits::move(this->_Myptr() + _Off + _Count,
2474  this->_Myptr() + _Off,
2475  this->_Mysize() - _Off); // empty out hole
2476  if (this == _STD addressof(_Right))
2477  {
2478  _Traits::move(this->_Myptr() + _Off, this->_Myptr() + _Min_value(_Off, _Roff), _Count); // substring
2479  }
2480  else
2481  {
2482  _Traits::copy(this->_Myptr() + _Off, _Right._Myptr() + _Roff, _Count); // fill hole
2483  }
2484 
2485  _Eos(_Num);
2486  }
2487 
2488  return (*this);
2489  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
static _PGLOBAL const size_type npos
Definition: xstring:2219
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Mybase::size_type size_type
Definition: xstring:1879
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( const size_type  _Off,
_In_reads_(_Count) const _Elem *const  _Ptr,
_CRT_GUARDOVERFLOW const size_type  _Count 
)
inline
2509  { // insert [_Ptr, _Ptr + _Count) at _Off
2510  if (_Inside(_Ptr))
2511  {
2512  return (insert(_Off, *this,
2513  _Ptr - this->_Myptr(), _Count)); // substring
2514  }
2515 
2516  _Check_offset(_Off);
2517  if (npos - this->_Mysize() <= _Count)
2518  {
2519  _Xlen(); // result too long
2520  }
2521 
2522  const size_type _Num = this->_Mysize() + _Count;
2523  if (_Count != 0 && _Grow(_Num))
2524  { // make room and insert new stuff
2525  _Traits::move(this->_Myptr() + _Off + _Count,
2526  this->_Myptr() + _Off,
2527  this->_Mysize() - _Off); // empty out hole
2528  _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
2529  _Eos(_Num);
2530  }
2531 
2532  return (*this);
2533  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
static _PGLOBAL const size_type npos
Definition: xstring:2219
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
iterator insert(const const_iterator _Where, const initializer_list< _Elem > _Ilist)
Definition: xstring:2204
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( const size_type  _Off,
_In_z_ const _Elem *const  _Ptr 
)
inline
2536  { // insert [_Ptr, <null>) at _Off
2537  return (insert(_Off, _Ptr, _Traits::length(_Ptr)));
2538  }
iterator insert(const const_iterator _Where, const initializer_list< _Elem > _Ilist)
Definition: xstring:2204
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::insert ( const size_type  _Off,
_CRT_GUARDOVERFLOW const size_type  _Count,
const _Elem  _Ch 
)
inline
2541  { // insert _Count * _Ch at _Off
2542  _Check_offset(_Off);
2543  if (npos - this->_Mysize() <= _Count)
2544  {
2545  _Xlen(); // result too long
2546  }
2547 
2548  const size_type _Num = this->_Mysize() + _Count;
2549  if (_Count != 0 && _Grow(_Num))
2550  { // make room and insert new stuff
2551  _Traits::move(this->_Myptr() + _Off + _Count,
2552  this->_Myptr() + _Off,
2553  this->_Mysize() - _Off); // empty out hole
2554  _Chassign(_Off, _Count, _Ch); // fill hole
2555  _Eos(_Num);
2556  }
2557 
2558  return (*this);
2559  }
static _PGLOBAL const size_type npos
Definition: xstring:2219
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const const_iterator  _Where,
const _Elem  _Ch 
)
inline
2562  { // insert _Ch at _Where
2563  size_type _Off = _Where - begin();
2564  insert(_Off, 1, _Ch);
2565  return (begin() + _Off);
2566  }
iterator insert(const const_iterator _Where, const initializer_list< _Elem > _Ilist)
Definition: xstring:2204
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
iterator begin() _NOEXCEPT
Definition: xstring:2857
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const const_iterator  _Where,
_CRT_GUARDOVERFLOW const size_type  _Count,
const _Elem  _Ch 
)
inline
2569  { // insert _Count * _Elem at _Where
2570  const size_type _Off = _Where - begin();
2571  insert(_Off, _Count, _Ch);
2572  return (begin() + _Off);
2573  }
iterator insert(const const_iterator _Where, const initializer_list< _Elem > _Ilist)
Definition: xstring:2204
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
const size_type size_type _Count
Definition: xstring:3106
iterator begin() _NOEXCEPT
Definition: xstring:2857
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
template<class _Iter , class = enable_if_t<_Is_iterator<_Iter>::value>>
iterator basic_string< _Elem, _Traits, _Alloc >::insert ( const const_iterator  _Where,
const _Iter  _First,
const _Iter  _Last 
)
inline
2578  { // insert [_First, _Last) at _Where, input iterators
2579  const size_type _Off = _Where - begin();
2580  replace(_Where, _Where, _First, _Last);
2581  return (begin() + _Off);
2582  }
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
iterator begin() _NOEXCEPT
Definition: xstring:2857
_Mybase::size_type size_type
Definition: xstring:1879
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
size_type basic_string< _Elem, _Traits, _Alloc >::length ( ) const
inline
3019  { // return length of sequence
3020  return (this->_Mysize());
3021  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
size_type basic_string< _Elem, _Traits, _Alloc >::max_size ( ) const
inline
3029  { // return maximum possible length of sequence
3030  const size_type _Num = this->_Getal().max_size();
3031  return (_Num <= 1 ? 1 : _Num - 1);
3032  }
_Alty & _Getal() _NOEXCEPT
Definition: xstring:1817
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( initializer_list< _Elem >  _Ilist)
inline
2190  { // append initializer_list
2191  return (append(_Ilist.begin(), _Ilist.end()));
2192  }
constexpr const _Elem * end() const _NOEXCEPT
Definition: initializer_list:44
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
constexpr const _Elem * begin() const _NOEXCEPT
Definition: initializer_list:39
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( const _Myt _Right)
inline
2260  { // append _Right
2261  return (append(_Right));
2262  }
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( _In_z_ const _Elem *const  _Ptr)
inline
2272  { // append [_Ptr, <null>)
2273  return (append(_Ptr));
2274  }
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator+= ( _Elem  _Ch)
inline
2277  { // append 1 * _Ch
2278  push_back(_Ch);
2279  return (*this);
2280  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
void push_back(const _Elem _Ch)
Definition: xstring:2961
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( _Myt &&  _Right)
inline
2075  { // assign by moving _Right
2076  if (this != _STD addressof(_Right))
2077  { // different, assign it
2078  _Tidy_deallocate();
2079  this->_Move_alloc(_Right._Getal());
2080  // tag dispatch to remove unnecessary exception handling codegen in the
2081  // equal allocators case
2083  bool_constant<_Alty::propagate_on_container_move_assignment::value
2084  || _Alty::is_always_equal::value>{});
2085  }
2086 
2087  return (*this);
2088  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
void _Assign_rv_contents(_Myt &&_Right, true_type)
Definition: xstring:2097
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
void _Move_alloc(_Alty &_Al)
Definition: xstring:1712
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( initializer_list< _Elem >  _Ilist)
inline
2185  { // assign initializer_list
2186  return (assign(_Ilist.begin(), _Ilist.end()));
2187  }
constexpr const _Elem * end() const _NOEXCEPT
Definition: initializer_list:44
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
constexpr const _Elem * begin() const _NOEXCEPT
Definition: initializer_list:39
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( const _Myt _Right)
inline
2222  { // assign _Right
2223  if (this != _STD addressof(_Right))
2224  { // different, assign it
2225 #pragma warning(push)
2226 #pragma warning(disable: 4127) // conditional expression is constant
2227  if (_Alty::propagate_on_container_copy_assignment::value
2228  && this->_Getal() != _Right._Getal())
2229  { // change allocator before copying
2230  _Tidy_deallocate();
2231  }
2232 #pragma warning(pop)
2233 
2234  this->_Copy_alloc(_Right._Getal());
2235 
2237  }
2238 
2239  return (*this);
2240  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Alty & _Getal() _NOEXCEPT
Definition: xstring:1817
void _Copy_alloc(const _Alty &_Al)
Definition: xstring:1707
void _Assign_lv_contents(const _Myt &_Right)
Definition: xstring:2171
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( _In_z_ const _Elem *const  _Ptr)
inline
2250  { // assign [_Ptr, <null>)
2251  return (assign(_Ptr));
2252  }
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::operator= ( const _Elem  _Ch)
inline
2255  { // assign 1 * _Ch
2256  return (assign(1, _Ch));
2257  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Myt & assign(_Myt &&_Right) _NOEXCEPT_OP(_Alty
Definition: xstring:2090
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
reference basic_string< _Elem, _Traits, _Alloc >::operator[] ( const size_type  _Off)
inline
2943  { // subscript mutable sequence
2944  _IDL_VERIFY(_Off <= this->_Mysize(), "string subscript out of range");
2945  return (this->_Myptr()[_Off]);
2946  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
#define _IDL_VERIFY(assertion, message)
Definition: xutility:43
value_type * _Myptr()
Definition: xstring:1683
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_reference basic_string< _Elem, _Traits, _Alloc >::operator[] ( const size_type  _Off) const
inline
2949  { // subscript immutable sequence
2950  _IDL_VERIFY(_Off <= this->_Mysize(), "string subscript out of range");
2951  return (this->_Myptr()[_Off]);
2952  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
#define _IDL_VERIFY(assertion, message)
Definition: xutility:43
value_type * _Myptr()
Definition: xstring:1683
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::pop_back ( )
inline
2977  { // erase element at end
2978  erase(this->_Mysize() - 1); // throws if _Mysize() == 0
2979  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
_Myt & erase(const size_type _Off=0)
Definition: xstring:2584
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::push_back ( const _Elem  _Ch)
inline
2962  { // insert element at end
2963  auto& _My_data = this->_Get_data();
2964  auto& _Sz = _My_data._Mysize;
2965  if (_Sz == _My_data._Myres)
2966  {
2967  _Grow(_Sz + 1); // _Grow checks for overflow
2968  }
2969 
2970  auto _Ptr = _My_data._Myptr();
2971  _Traits::assign(_Ptr[_Sz], _Ch);
2972  ++_Sz;
2973  _Traits::assign(_Ptr[_Sz], _Elem());
2974  }
_Mydata_t & _Get_data() _NOEXCEPT
Definition: xstring:1827
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rbegin ( )
inline
2882  { // return iterator for beginning of reversed mutable sequence
2883  return (reverse_iterator(end()));
2884  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: xstring:1889
iterator end() _NOEXCEPT
Definition: xstring:2869
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rbegin ( ) const
inline
2887  { // return iterator for beginning of reversed immutable sequence
2888  return (const_reverse_iterator(end()));
2889  }
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: xstring:1890
iterator end() _NOEXCEPT
Definition: xstring:2869
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rend ( )
inline
2892  { // return iterator for end of reversed mutable sequence
2893  return (reverse_iterator(begin()));
2894  }
_STD reverse_iterator< iterator > reverse_iterator
Definition: xstring:1889
iterator begin() _NOEXCEPT
Definition: xstring:2857
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const_reverse_iterator basic_string< _Elem, _Traits, _Alloc >::rend ( ) const
inline
2897  { // return iterator for end of reversed immutable sequence
2898  return (const_reverse_iterator(begin()));
2899  }
_STD reverse_iterator< const_iterator > const_reverse_iterator
Definition: xstring:1890
iterator begin() _NOEXCEPT
Definition: xstring:2857
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const const_iterator  _First,
const const_iterator  _Last,
const initializer_list< _Elem >  _Ilist 
)
inline
2210  { // replace with initializer_list
2211  return (replace(_First, _Last, _Ilist.begin(), _Ilist.end()));
2212  }
constexpr const _Elem * end() const _NOEXCEPT
Definition: initializer_list:44
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
constexpr const _Elem * begin() const _NOEXCEPT
Definition: initializer_list:39
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const size_type  _Off,
const size_type  _N0,
const _Myt _Right 
)
inline
2630  { // replace [_Off, _Off + _N0) with _Right
2631  return (replace(_Off, _N0, _Right, 0, npos));
2632  }
static _PGLOBAL const size_type npos
Definition: xstring:2219
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const size_type  _Off,
size_type  _N0,
const _Myt _Right,
const size_type  _Roff,
size_type  _Count = npos 
)
inline
2636  { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
2637  _Check_offset(_Off);
2638  _Right._Check_offset(_Roff);
2639  _N0 = _Clamp_suffix_size(_Off, _N0);
2640  _Count = _Right._Clamp_suffix_size(_Roff, _Count);
2641  if (npos - _Count <= this->_Mysize() - _N0)
2642  {
2643  _Xlen(); // result too long
2644  }
2645 
2646  const size_type _Nm = this->_Mysize() - _N0 - _Off; // length of kept tail
2647  const size_type _Newsize = this->_Mysize() + _Count - _N0;
2648  if (this->_Mysize() < _Newsize)
2649  {
2650  _Grow(_Newsize);
2651  }
2652 
2653  if (_Count == _N0)
2654  { // only one movement required, so _Traits::move handles any overlap
2655  _Traits::move(this->_Myptr() + _Off,
2656  _Right._Myptr() + _Roff, _Count); // fill hole
2657  }
2658  else if (this != _STD addressof(_Right))
2659  { // no overlap, just move down and copy in new stuff
2660  _Traits::move(this->_Myptr() + _Off + _Count,
2661  this->_Myptr() + _Off + _N0, _Nm); // empty hole
2662  _Traits::copy(this->_Myptr() + _Off,
2663  _Right._Myptr() + _Roff, _Count); // fill hole
2664  }
2665  else if (_Count < _N0)
2666  { // hole doesn't get larger, just copy in substring
2667  _Traits::move(this->_Myptr() + _Off,
2668  this->_Myptr() + _Roff, _Count); // fill hole
2669  _Traits::move(this->_Myptr() + _Off + _Count,
2670  this->_Myptr() + _Off + _N0, _Nm); // move tail down
2671  }
2672  else if (_Roff <= _Off)
2673  { // hole gets larger, substring begins before hole
2674  _Traits::move(this->_Myptr() + _Off + _Count,
2675  this->_Myptr() + _Off + _N0, _Nm); // move tail down
2676  _Traits::move(this->_Myptr() + _Off,
2677  this->_Myptr() + _Roff, _Count); // fill hole
2678  }
2679  else if (_Off + _N0 <= _Roff)
2680  { // hole gets larger, substring begins after hole
2681  _Traits::move(this->_Myptr() + _Off + _Count,
2682  this->_Myptr() + _Off + _N0, _Nm); // move tail down
2683  _Traits::move(this->_Myptr() + _Off,
2684  this->_Myptr() + (_Roff + _Count - _N0),
2685  _Count); // fill hole
2686  }
2687  else
2688  { // hole gets larger, substring begins in hole
2689  _Traits::move(this->_Myptr() + _Off,
2690  this->_Myptr() + _Roff, _N0); // fill old hole
2691  _Traits::move(this->_Myptr() + _Off + _Count,
2692  this->_Myptr() + _Off + _N0, _Nm); // move tail down
2693  _Traits::move(this->_Myptr() + _Off + _N0,
2694  this->_Myptr() + _Roff + _Count,
2695  _Count - _N0); // fill rest of new hole
2696  }
2697 
2698  _Eos(_Newsize);
2699  return (*this);
2700  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
static _PGLOBAL const size_type npos
Definition: xstring:2219
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Mybase::size_type size_type
Definition: xstring:1879
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const size_type  _Off,
size_type  _N0,
_In_reads_(_Count) const _Elem *const  _Ptr,
const size_type  _Count 
)
inline
2720  { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
2721  if (_Inside(_Ptr))
2722  {
2723  return (replace(_Off, _N0, *this,
2724  _Ptr - this->_Myptr(),
2725  _Count)); // substring, replace carefully
2726  }
2727 
2728  _Check_offset(_Off);
2729  _N0 = _Clamp_suffix_size(_Off, _N0);
2730  if (npos - _Count <= this->_Mysize() - _N0)
2731  {
2732  _Xlen(); // result too long
2733  }
2734 
2735  size_type _Nm = this->_Mysize() - _N0 - _Off;
2736  if (_Count < _N0)
2737  {
2738  _Traits::move(this->_Myptr() + _Off + _Count,
2739  this->_Myptr() + _Off + _N0, _Nm); // smaller hole, move tail up
2740  }
2741 
2742  const size_type _Num = this->_Mysize() + _Count - _N0;
2743  if ((_Count != 0 || _N0 != 0)
2744  && _Grow(_Num))
2745  { // make room and rearrange
2746  if (_N0 < _Count)
2747  {
2748  _Traits::move(this->_Myptr() + _Off + _Count,
2749  this->_Myptr() + _Off + _N0, _Nm); // move tail down
2750  }
2751  _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
2752  _Eos(_Num);
2753  }
2754 
2755  return (*this);
2756  }
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
static _PGLOBAL const size_type npos
Definition: xstring:2219
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
value_type * _Myptr()
Definition: xstring:1683
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
const size_type size_type _Count
Definition: xstring:3106
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const size_type  _Off,
const size_type  _N0,
_In_z_ const _Elem *const  _Ptr 
)
inline
2759  { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
2760  return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
2761  }
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const size_type  _Off,
size_type  _N0,
const size_type  _Count,
const _Elem  _Ch 
)
inline
2764  { // replace [_Off, _Off + _N0) with _Count * _Ch
2765  _Check_offset(_Off);
2766  _N0 = _Clamp_suffix_size(_Off, _N0);
2767  if (npos - _Count <= this->_Mysize() - _N0)
2768  {
2769  _Xlen(); // result too long
2770  }
2771 
2772  const size_type _Nm = this->_Mysize() - _N0 - _Off;
2773  if (_Count < _N0)
2774  {
2775  _Traits::move(this->_Myptr() + _Off + _Count,
2776  this->_Myptr() + _Off + _N0, _Nm); // smaller hole, move tail up
2777  }
2778 
2779  const size_type _Num = this->_Mysize() + _Count - _N0;
2780  if ((_Count != 0 || _N0 != 0) && _Grow(_Num))
2781  { // make room and rearrange
2782  if (_N0 < _Count)
2783  {
2784  _Traits::move(this->_Myptr() + _Off + _Count,
2785  this->_Myptr() + _Off + _N0, _Nm); // move tail down
2786  }
2787  _Chassign(_Off, _Count, _Ch); // fill hole
2788  _Eos(_Num);
2789  }
2790  return (*this);
2791  }
static _PGLOBAL const size_type npos
Definition: xstring:2219
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
value_type * _Myptr()
Definition: xstring:1683
const size_type size_type _Count
Definition: xstring:3106
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
_Mybase::size_type size_type
Definition: xstring:1879
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const const_iterator  _First,
const const_iterator  _Last,
const _Myt _Right 
)
inline
2794  { // replace [_First, _Last) with _Right
2795  return (replace(_First - begin(), _Last - _First, _Right));
2796  }
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
iterator begin() _NOEXCEPT
Definition: xstring:2857
_FwdIt _Last
Definition: algorithm:1936
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const const_iterator  _First,
const const_iterator  _Last,
_In_reads_(_Count) const _Elem *const  _Ptr,
const size_type  _Count 
)
inline
2808  { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
2809  return (replace(_First - begin(), _Last - _First, _Ptr, _Count));
2810  }
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
const size_type size_type _Count
Definition: xstring:3106
iterator begin() _NOEXCEPT
Definition: xstring:2857
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const const_iterator  _First,
const const_iterator  _Last,
_In_z_ const _Elem *const  _Ptr 
)
inline
2813  { // replace [_First, _Last) with [_Ptr, <null>)
2814  return (replace(_First - begin(), _Last - _First, _Ptr));
2815  }
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
iterator begin() _NOEXCEPT
Definition: xstring:2857
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const const_iterator  _First,
const const_iterator  _Last,
const size_type  _Count,
const _Elem  _Ch 
)
inline
2818  { // replace [_First, _Last) with _Count * _Ch
2819  return (replace(_First - begin(), _Last - _First, _Count, _Ch));
2820  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Myt & replace(const const_iterator _First, const const_iterator _Last, const initializer_list< _Elem > _Ilist)
Definition: xstring:2209
const size_type size_type _Count
Definition: xstring:3106
iterator begin() _NOEXCEPT
Definition: xstring:2857
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
template<class _Iter , class = enable_if_t<_Is_iterator<_Iter>::value>>
_Myt& basic_string< _Elem, _Traits, _Alloc >::replace ( const const_iterator  _First,
const const_iterator  _Last,
const _Iter  _First2,
const _Iter  _Last2 
)
inline
2850  { // replace [_First, _Last) with [_First2, _Last2), input iterators
2851  _DEBUG_RANGE(_First2, _Last2);
2852  const auto _UFirst2 = _Unchecked(_First2);
2853  const auto _ULast2 = _Unchecked(_Last2);
2854  return (_Replace_range(_First, _Last, _UFirst2, _ULast2, _Is_elem_cptr<decltype(_UFirst2)>()));
2855  }
_Disjunction_t< is_same< _Iter, const _Elem *const >, is_same< _Iter, _Elem *const >, is_same< _Iter, const _Elem * >, is_same< _Iter, _Elem * >> _Is_elem_cptr
Definition: xstring:1913
#define _DEBUG_RANGE(first, last)
Definition: xutility:902
_String_const_iterator< _Mystr >::_Unchecked_type _Unchecked(_String_const_iterator< _Mystr > _Iter)
Definition: xstring:1377
_Myt & _Replace_range(const const_iterator _First, const const_iterator _Last, const _Iter _First2, const _Iter _Last2, false_type)
Definition: xstring:2823
_FwdIt _Last
Definition: algorithm:1936
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::reserve ( _CRT_GUARDOVERFLOW const size_type  _Newcap = 0)
inline
3057  { // determine new minimum length of allocated storage
3058  auto& _My_data = this->_Get_data();
3059  if (_My_data._Mysize > _Newcap)
3060  { // requested capacity is not large enough for current size, ignore
3061  return; // nothing to do
3062  }
3063 
3064  if (_My_data._Myres == _Newcap)
3065  { // we're already at the requested capacity
3066  return; // nothing to do
3067  }
3068 
3069  if (_My_data._Myres < _Newcap)
3070  { // reallocate to grow
3071  _Copy(_Newcap);
3072  return;
3073  }
3074 
3075  if (this->_BUF_SIZE > _Newcap && _My_data._Large_string_engaged())
3076  { // deallocate everything; switch back to "small" mode
3077  this->_Orphan_all();
3078  pointer _Ptr = _My_data._Bx._Ptr;
3079  auto& _Al = this->_Getal();
3080  _Al.destroy(_STD addressof(_My_data._Bx._Ptr));
3081  _Traits::copy(_My_data._Bx._Buf, _Unfancy(_Ptr), _My_data._Mysize + 1);
3082  _Al.deallocate(_Ptr, _My_data._Myres + 1);
3083  _My_data._Myres = this->_BUF_SIZE - 1;
3084  return;
3085  }
3086 
3087  // ignore requests to reserve to [_BUF_SIZE, _Myres)
3088  }
_Mydata_t & _Get_data() _NOEXCEPT
Definition: xstring:1827
_OutIt copy(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2347
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
_Alty & _Getal() _NOEXCEPT
Definition: xstring:1817
_Mybase::pointer pointer
Definition: xstring:1881
auto _Unfancy(_Ptrty _Ptr)
Definition: xstddef:635
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::resize ( _CRT_GUARDOVERFLOW const size_type  _Newsize)
inline
3035  { // determine new length, padding with null elements as needed
3036  resize(_Newsize, _Elem());
3037  }
void resize(_CRT_GUARDOVERFLOW const size_type _Newsize)
Definition: xstring:3034
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::resize ( _CRT_GUARDOVERFLOW const size_type  _Newsize,
const _Elem  _Ch 
)
inline
3040  { // determine new length, padding with _Ch elements as needed
3041  if (_Newsize <= this->_Mysize())
3042  {
3043  _Eos(_Newsize);
3044  }
3045  else
3046  {
3047  append(_Newsize - this->_Mysize(), _Ch);
3048  }
3049  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
void basic_string< _Elem, _Traits, _Alloc >::shrink_to_fit ( )
inline
2922  { // reduce capacity
2923  if ((size() | this->_ALLOC_MASK) < capacity())
2924  { // worth shrinking, do it
2925  _Myt _Tmp(*this);
2926  swap(_Tmp);
2927  }
2928  }
void swap(basic_string< _Elem, _Traits, _Alloc > &_Left, basic_string< _Elem, _Traits, _Alloc > &_Right) _NOEXCEPT_OP(_NOEXCEPT_OP(_Left.swap(_Right)))
Definition: xstring:3663
basic_string< _Elem, _Traits, _Alloc > _Myt
Definition: xstring:1870
size_type size() const _NOEXCEPT
Definition: xstring:3023
size_type capacity() const _NOEXCEPT
Definition: xstring:3051
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
size_type basic_string< _Elem, _Traits, _Alloc >::size ( ) const
inline
3024  { // return length of sequence
3025  return (this->_Mysize());
3026  }
size_type & _Mysize() _NOEXCEPT
Definition: xstring:1837

Member Data Documentation

template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const size_type size_type basic_string< _Elem, _Traits, _Alloc >::_Count
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
const size_type basic_string< _Elem, _Traits, _Alloc >::_Dest_size
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
constexpr size_t basic_string< _Elem, _Traits, _Alloc >::_Memcpy_move_offset = offsetof(_Mydata_t, _Bx)
static
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
constexpr size_t basic_string< _Elem, _Traits, _Alloc >::_Memcpy_move_size = sizeof(_Mydata_t) - _Memcpy_move_offset
static
template<class _Elem, class _Traits = char_traits<_Elem>, class _Alloc = allocator<_Elem>>
_PGLOBAL const basic_string< _Elem, _Traits, _Alloc >::size_type basic_string< _Elem, _Traits, _Alloc >::npos
static
Initial value:

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