STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Macros | Typedefs | Functions
xstring File Reference
#include <xmemory0>

Classes

class  _String_const_iterator< _Mystr >
 
class  _String_iterator< _Mystr >
 
struct  _String_iter_types< _Value_type, _Size_type, _Difference_type, _Pointer, _Const_pointer, _Reference, _Const_reference >
 
struct  _String_base_types< _Ty, _Alloc0 >
 
class  _String_val< _Val_types >
 
union  _String_val< _Val_types >::_Bxty
 
class  _String_alloc< _Alloc_types >
 
class  basic_string< _Elem, _Traits, _Alloc >
 
struct  hash< basic_string< _Elem, _Traits, _Alloc > >
 

Macros

#define _XSTRING_
 

Typedefs

template<class _Traits >
using _Traits_ch_t = typename _Traits::char_type
 
template<class _Traits >
using _Traits_ptr_t = const typename _Traits::char_type *
 
typedef basic_string< char, char_traits< char >, allocator< char > > string
 
typedef basic_string< wchar_t, char_traits< wchar_t >, allocator< wchar_t > > wstring
 
typedef basic_string< char16_t, char_traits< char16_t >, allocator< char16_t > > u16string
 
typedef basic_string< char32_t, char_traits< char32_t >, allocator< char32_t > > u32string
 

Functions

template<class _Traits >
constexpr bool _Traits_equal (_In_reads_(_Left_size) const _Traits_ptr_t< _Traits > _Left, const size_t _Left_size, _In_reads_(_Right_size) const _Traits_ptr_t< _Traits > _Right, const size_t _Right_size) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 int _Traits_compare (_In_reads_(_Left_size) const _Traits_ptr_t< _Traits > _Left, const size_t _Left_size, _In_reads_(_Right_size) const _Traits_ptr_t< _Traits > _Right, const size_t _Right_size) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find (_In_reads_(_Hay_size) const _Traits_ptr_t< _Traits > _Haystack, const size_t _Hay_size, const size_t _Start_at, _In_reads_(_Needle_size) const _Traits_ptr_t< _Traits > _Needle, const size_t _Needle_size) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_ch (_In_reads_(_Hay_size) const _Traits_ptr_t< _Traits > _Haystack, const size_t _Hay_size, const size_t _Start_at, const _Traits_ch_t< _Traits > _Ch) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 size_t _Traits_rfind (_In_reads_(_Hay_size) const _Traits_ptr_t< _Traits > _Haystack, const size_t _Hay_size, const size_t _Start_at, _In_reads_(_Needle_size) const _Traits_ptr_t< _Traits > _Needle, const size_t _Needle_size) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 size_t _Traits_rfind_ch (_In_reads_(_Hay_size) const _Traits_ptr_t< _Traits > _Haystack, const size_t _Hay_size, const size_t _Start_at, const _Traits_ch_t< _Traits > _Ch) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_first_of (_In_reads_(_Hay_size) const _Traits_ptr_t< _Traits > _Haystack, const size_t _Hay_size, const size_t _Start_at, _In_reads_(_Needle_size) const _Traits_ptr_t< _Traits > _Needle, const size_t _Needle_size) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_last_of (_In_reads_(_Hay_size) const _Traits_ptr_t< _Traits > _Haystack, const size_t _Hay_size, const size_t _Start_at, _In_reads_(_Needle_size) const _Traits_ptr_t< _Traits > _Needle, const size_t _Needle_size) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_first_not_of (_In_reads_(_Hay_size) const _Traits_ptr_t< _Traits > _Haystack, const size_t _Hay_size, const size_t _Start_at, _In_reads_(_Needle_size) const _Traits_ptr_t< _Traits > _Needle, const size_t _Needle_size) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_not_ch (_In_reads_(_Hay_size) const _Traits_ptr_t< _Traits > _Haystack, const size_t _Hay_size, const size_t _Start_at, const _Traits_ch_t< _Traits > _Ch) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_last_not_of (_In_reads_(_Hay_size) const _Traits_ptr_t< _Traits > _Haystack, const size_t _Hay_size, const size_t _Start_at, _In_reads_(_Needle_size) const _Traits_ptr_t< _Traits > _Needle, const size_t _Needle_size) _NOEXCEPT
 
template<class _Traits >
_CONSTEXPR14 size_t _Traits_rfind_not_ch (_In_reads_(_Hay_size) const _Traits_ptr_t< _Traits > _Haystack, const size_t _Hay_size, const size_t _Start_at, const _Traits_ch_t< _Traits > _Ch) _NOEXCEPT
 
template<class _Mystr >
_String_const_iterator< _Mystr >::_Unchecked_type _Unchecked (_String_const_iterator< _Mystr > _Iter)
 
template<class _Mystr >
_String_const_iterator< _Mystr > _Rechecked (_String_const_iterator< _Mystr > &_Iter, typename _String_const_iterator< _Mystr >::_Unchecked_type _Right)
 
template<class _Mystr >
_String_const_iterator< _Mystr > operator+ (typename _String_const_iterator< _Mystr >::difference_type _Off, _String_const_iterator< _Mystr > _Next)
 
template<class _Mystr >
_String_iterator< _Mystr >::_Unchecked_type _Unchecked (_String_iterator< _Mystr > _Iter)
 
template<class _Mystr >
_String_iterator< _Mystr > _Rechecked (_String_iterator< _Mystr > &_Iter, typename _String_iterator< _Mystr >::_Unchecked_type _Right)
 
template<class _Mystr >
_String_iterator< _Mystr > operator+ (typename _String_iterator< _Mystr >::difference_type _Off, _String_iterator< _Mystr > _Next)
 
template<class _Elem , class _Traits , class _Alloc >
void swap (basic_string< _Elem, _Traits, _Alloc > &_Left, basic_string< _Elem, _Traits, _Alloc > &_Right) _NOEXCEPT_OP(_NOEXCEPT_OP(_Left.swap(_Right)))
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (const basic_string< _Elem, _Traits, _Alloc > &_Left, const basic_string< _Elem, _Traits, _Alloc > &_Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (_In_z_ const _Elem *const _Left, const basic_string< _Elem, _Traits, _Alloc > &_Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (const _Elem _Left, const basic_string< _Elem, _Traits, _Alloc > &_Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (const basic_string< _Elem, _Traits, _Alloc > &_Left, _In_z_ const _Elem *const _Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (const basic_string< _Elem, _Traits, _Alloc > &_Left, const _Elem _Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (const basic_string< _Elem, _Traits, _Alloc > &_Left, basic_string< _Elem, _Traits, _Alloc > &&_Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (basic_string< _Elem, _Traits, _Alloc > &&_Left, const basic_string< _Elem, _Traits, _Alloc > &_Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (basic_string< _Elem, _Traits, _Alloc > &&_Left, basic_string< _Elem, _Traits, _Alloc > &&_Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (_In_z_ const _Elem *const _Left, basic_string< _Elem, _Traits, _Alloc > &&_Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (const _Elem _Left, basic_string< _Elem, _Traits, _Alloc > &&_Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (basic_string< _Elem, _Traits, _Alloc > &&_Left, _In_z_ const _Elem *const _Right)
 
template<class _Elem , class _Traits , class _Alloc >
basic_string< _Elem, _Traits, _Alloc > operator+ (basic_string< _Elem, _Traits, _Alloc > &&_Left, const _Elem _Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator== (const basic_string< _Elem, _Traits, _Alloc > &_Left, const basic_string< _Elem, _Traits, _Alloc > &_Right) _NOEXCEPT
 
template<class _Elem , class _Traits , class _Alloc >
bool operator== (_In_z_ const _Elem *const _Left, const basic_string< _Elem, _Traits, _Alloc > &_Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator== (const basic_string< _Elem, _Traits, _Alloc > &_Left, _In_z_ const _Elem *const _Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator!= (const basic_string< _Elem, _Traits, _Alloc > &_Left, const basic_string< _Elem, _Traits, _Alloc > &_Right) _NOEXCEPT
 
template<class _Elem , class _Traits , class _Alloc >
bool operator!= (_In_z_ const _Elem *const _Left, const basic_string< _Elem, _Traits, _Alloc > &_Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator!= (const basic_string< _Elem, _Traits, _Alloc > &_Left, _In_z_ const _Elem *const _Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator< (const basic_string< _Elem, _Traits, _Alloc > &_Left, const basic_string< _Elem, _Traits, _Alloc > &_Right) _NOEXCEPT
 
template<class _Elem , class _Traits , class _Alloc >
bool operator< (_In_z_ const _Elem *const _Left, const basic_string< _Elem, _Traits, _Alloc > &_Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator< (const basic_string< _Elem, _Traits, _Alloc > &_Left, _In_z_ const _Elem *const _Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator> (const basic_string< _Elem, _Traits, _Alloc > &_Left, const basic_string< _Elem, _Traits, _Alloc > &_Right) _NOEXCEPT
 
template<class _Elem , class _Traits , class _Alloc >
bool operator> (_In_z_ const _Elem *const _Left, const basic_string< _Elem, _Traits, _Alloc > &_Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator> (const basic_string< _Elem, _Traits, _Alloc > &_Left, _In_z_ const _Elem *const _Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator<= (const basic_string< _Elem, _Traits, _Alloc > &_Left, const basic_string< _Elem, _Traits, _Alloc > &_Right) _NOEXCEPT
 
template<class _Elem , class _Traits , class _Alloc >
bool operator<= (_In_z_ const _Elem *const _Left, const basic_string< _Elem, _Traits, _Alloc > &_Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator<= (const basic_string< _Elem, _Traits, _Alloc > &_Left, _In_z_ const _Elem *const _Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator>= (const basic_string< _Elem, _Traits, _Alloc > &_Left, const basic_string< _Elem, _Traits, _Alloc > &_Right) _NOEXCEPT
 
template<class _Elem , class _Traits , class _Alloc >
bool operator>= (_In_z_ const _Elem *const _Left, const basic_string< _Elem, _Traits, _Alloc > &_Right)
 
template<class _Elem , class _Traits , class _Alloc >
bool operator>= (const basic_string< _Elem, _Traits, _Alloc > &_Left, _In_z_ const _Elem *const _Right)
 

Macro Definition Documentation

#define _XSTRING_

Typedef Documentation

template<class _Traits >
using _Traits_ch_t = typename _Traits::char_type
template<class _Traits >
using _Traits_ptr_t = const typename _Traits::char_type *

Function Documentation

template<class _Mystr >
_String_const_iterator<_Mystr> _Rechecked ( _String_const_iterator< _Mystr > &  _Iter,
typename _String_const_iterator< _Mystr >::_Unchecked_type  _Right 
)
inline
1387  { // convert to checked
1388  return (_Iter._Rechecked(_Right));
1389  }
_Myiter & _Rechecked(_Unchecked_type _Right)
Definition: xstring:1202
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Mystr >
_String_iterator<_Mystr> _Rechecked ( _String_iterator< _Mystr > &  _Iter,
typename _String_iterator< _Mystr >::_Unchecked_type  _Right 
)
inline
1519  { // convert to checked
1520  return (_Iter._Rechecked(_Right));
1521  }
_Myiter & _Rechecked(_Unchecked_type _Right)
Definition: xstring:1426
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Traits >
_CONSTEXPR14 int _Traits_compare ( _In_reads_(_Left_size) const _Traits_ptr_t< _Traits >  _Left,
const size_t  _Left_size,
_In_reads_(_Right_size) const _Traits_ptr_t< _Traits >  _Right,
const size_t  _Right_size 
)
31  { // compare [_Left, _Left + _Left_size) to [_Right, _Right + _Right_size) using _Traits
32  const int _Ans = _Traits::compare(_Left, _Right, _Min_value(_Left_size, _Right_size));
33 
34  if (_Ans != 0)
35  {
36  return (_Ans);
37  }
38 
39  if (_Left_size < _Right_size)
40  {
41  return (-1);
42  }
43 
44  if (_Left_size > _Right_size)
45  {
46  return (1);
47  }
48 
49  return (0);
50  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Traits >
constexpr bool _Traits_equal ( _In_reads_(_Left_size) const _Traits_ptr_t< _Traits >  _Left,
const size_t  _Left_size,
_In_reads_(_Right_size) const _Traits_ptr_t< _Traits >  _Right,
const size_t  _Right_size 
)
24  { // compare [_Left, _Left + _Left_size) to [_Right, _Right + _Right_size) for equality using _Traits
25  return (_Left_size == _Right_size && _Traits::compare(_Left, _Right, _Left_size) == 0);
26  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find ( _In_reads_(_Hay_size) const _Traits_ptr_t< _Traits >  _Haystack,
const size_t  _Hay_size,
const size_t  _Start_at,
_In_reads_(_Needle_size) const _Traits_ptr_t< _Traits >  _Needle,
const size_t  _Needle_size 
)
56  { // search [_Haystack, _Haystack + _Hay_size) for [_Needle, _Needle + _Needle_size), at/after _Start_at
57  if (_Needle_size > _Hay_size || _Start_at > _Hay_size - _Needle_size)
58  { // xpos cannot exist, report failure
59  // C++14 21.4.7.2 [string::find]/1.1 says:
60  // 1. _Start_at <= xpos
61  // 2. xpos + _Needle_size <= _Hay_size;
62  // therefore:
63  // 3. _Needle_size <= _Hay_size (by 2) (checked above)
64  // 4. _Start_at + _Needle_size <= _Hay_size (substitute 1 into 2)
65  // 5. _Start_at <= _Hay_size - _Needle_size (4, move _Needle_size to other side) (also checked above)
66  return (static_cast<size_t>(-1));
67  }
68 
69  if (_Needle_size == 0)
70  { // empty string always matches if xpos is possible
71  return (_Start_at);
72  }
73 
74  const auto _Possible_matches_end = _Haystack + (_Hay_size - _Needle_size) + 1;
75  for (auto _Match_try = _Haystack + _Start_at; ; ++_Match_try)
76  {
77  _Match_try = _Traits::find(_Match_try, _Possible_matches_end - _Match_try, *_Needle);
78  if (!_Match_try)
79  { // didn't find first character; report failure
80  return (static_cast<size_t>(-1));
81  }
82 
83  if (_Traits::compare(_Match_try, _Needle, _Needle_size) == 0)
84  { // found match
85  return (_Match_try - _Haystack);
86  }
87  }
88  }
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3185
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_ch ( _In_reads_(_Hay_size) const _Traits_ptr_t< _Traits >  _Haystack,
const size_t  _Hay_size,
const size_t  _Start_at,
const _Traits_ch_t< _Traits >  _Ch 
)
94  { // search [_Haystack, _Haystack + _Hay_size) for _Ch, at/after _Start_at
95  if (_Start_at < _Hay_size)
96  {
97  const auto _Found_at = _Traits::find(_Haystack + _Start_at, _Hay_size - _Start_at, _Ch);
98  if (_Found_at)
99  {
100  return (_Found_at - _Haystack);
101  }
102  }
103 
104  return (static_cast<size_t>(-1)); // (npos) no match
105  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3185
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_first_not_of ( _In_reads_(_Hay_size) const _Traits_ptr_t< _Traits >  _Haystack,
const size_t  _Hay_size,
const size_t  _Start_at,
_In_reads_(_Needle_size) const _Traits_ptr_t< _Traits >  _Needle,
const size_t  _Needle_size 
)
209  { // in [_Haystack, _Haystack + _Hay_size), look for none of [_Needle, _Needle + _Needle_size), at/after _Start_at
210  if (_Start_at < _Hay_size)
211  { // room for match, look for it
212  const auto _End = _Haystack + _Hay_size;
213  for (auto _Match_try = _Haystack + _Start_at; _Match_try < _End; ++_Match_try)
214  {
215  if (!_Traits::find(_Needle, _Needle_size, *_Match_try))
216  {
217  return (_Match_try - _Haystack); // found a match
218  }
219  }
220  }
221 
222  return (static_cast<size_t>(-1)); // no match
223  }
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3185
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_first_of ( _In_reads_(_Hay_size) const _Traits_ptr_t< _Traits >  _Haystack,
const size_t  _Hay_size,
const size_t  _Start_at,
_In_reads_(_Needle_size) const _Traits_ptr_t< _Traits >  _Needle,
const size_t  _Needle_size 
)
165  { // in [_Haystack, _Haystack + _Hay_size), look for one of [_Needle, _Needle + _Needle_size), at/after _Start_at
166  if (_Needle_size != 0 && _Start_at < _Hay_size)
167  { // room for match, look for it
168  const auto _End = _Haystack + _Hay_size;
169  for (auto _Match_try = _Haystack + _Start_at; _Match_try < _End; ++_Match_try)
170  {
171  if (_Traits::find(_Needle, _Needle_size, *_Match_try))
172  {
173  return (_Match_try - _Haystack); // found a match
174  }
175  }
176  }
177 
178  return (static_cast<size_t>(-1)); // no match
179  }
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3185
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_last_not_of ( _In_reads_(_Hay_size) const _Traits_ptr_t< _Traits >  _Haystack,
const size_t  _Hay_size,
const size_t  _Start_at,
_In_reads_(_Needle_size) const _Traits_ptr_t< _Traits >  _Needle,
const size_t  _Needle_size 
)
249  { // in [_Haystack, _Haystack + _Hay_size), look for none of [_Needle, _Needle + _Needle_size), before _Start_at
250  if (_Hay_size != 0)
251  { // worth searching, do it
252  for (auto _Match_try = _Haystack + _Min_value(_Start_at, _Hay_size - 1); ; --_Match_try)
253  {
254  if (!_Traits::find(_Needle, _Needle_size, *_Match_try))
255  {
256  return (_Match_try - _Haystack); // found a match
257  }
258 
259  if (_Match_try == _Haystack)
260  {
261  break; // at beginning, no more chance for match
262  }
263  }
264  }
265 
266  return (static_cast<size_t>(-1)); // no match
267  }
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3185
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_last_of ( _In_reads_(_Hay_size) const _Traits_ptr_t< _Traits >  _Haystack,
const size_t  _Hay_size,
const size_t  _Start_at,
_In_reads_(_Needle_size) const _Traits_ptr_t< _Traits >  _Needle,
const size_t  _Needle_size 
)
185  { // in [_Haystack, _Haystack + _Hay_size), look for last of [_Needle, _Needle + _Needle_size), before _Start_at
186  if (_Needle_size != 0 && _Hay_size != 0)
187  { // worth searching, do it
188  for (auto _Match_try = _Haystack + _Min_value(_Start_at, _Hay_size - 1); ; --_Match_try)
189  {
190  if (_Traits::find(_Needle, _Needle_size, *_Match_try))
191  {
192  return (_Match_try - _Haystack); // found a match
193  }
194 
195  if (_Match_try == _Haystack)
196  {
197  break; // at beginning, no more chance for match
198  }
199  }
200  }
201 
202  return (static_cast<size_t>(-1)); // no match
203  }
_InIt find(_InIt _First, _InIt _Last, const _Ty &_Val)
Definition: xutility:3185
template<class _Traits >
_CONSTEXPR14 size_t _Traits_find_not_ch ( _In_reads_(_Hay_size) const _Traits_ptr_t< _Traits >  _Haystack,
const size_t  _Hay_size,
const size_t  _Start_at,
const _Traits_ch_t< _Traits >  _Ch 
)
229  { // search [_Haystack, _Haystack + _Hay_size) for any value other than _Ch, at/after _Start_at
230  if (_Start_at < _Hay_size)
231  { // room for match, look for it
232  const auto _End = _Haystack + _Hay_size;
233  for (auto _Match_try = _Haystack + _Start_at; _Match_try < _End; ++_Match_try)
234  {
235  if (!_Traits::eq(*_Match_try, _Ch))
236  {
237  return (_Match_try - _Haystack); // found a match
238  }
239  }
240  }
241 
242  return (static_cast<size_t>(-1)); // no match
243  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
template<class _Traits >
_CONSTEXPR14 size_t _Traits_rfind ( _In_reads_(_Hay_size) const _Traits_ptr_t< _Traits >  _Haystack,
const size_t  _Hay_size,
const size_t  _Start_at,
_In_reads_(_Needle_size) const _Traits_ptr_t< _Traits >  _Needle,
const size_t  _Needle_size 
)
111  { // search [_Haystack, _Haystack + _Hay_size) for [_Needle, _Needle + _Needle_size) beginning before _Start_at
112  if (_Needle_size == 0)
113  {
114  return (_Min_value(_Start_at, _Hay_size)); // empty string always matches
115  }
116 
117  if (_Needle_size <= _Hay_size)
118  { // room for match, look for it
119  for (auto _Match_try = _Haystack + _Min_value(_Start_at, _Hay_size - _Needle_size); ; --_Match_try)
120  {
121  if (_Traits::eq(*_Match_try, *_Needle)
122  && _Traits::compare(_Match_try, _Needle, _Needle_size) == 0)
123  {
124  return (_Match_try - _Haystack); // found a match
125  }
126 
127  if (_Match_try == _Haystack)
128  {
129  break; // at beginning, no more chance for match
130  }
131  }
132  }
133 
134  return (static_cast<size_t>(-1)); // no match
135  }
template<class _Traits >
_CONSTEXPR14 size_t _Traits_rfind_ch ( _In_reads_(_Hay_size) const _Traits_ptr_t< _Traits >  _Haystack,
const size_t  _Hay_size,
const size_t  _Start_at,
const _Traits_ch_t< _Traits >  _Ch 
)
141  { // search [_Haystack, _Haystack + _Hay_size) for _Ch before _Start_at
142  if (_Hay_size != 0)
143  { // room for match, look for it
144  for (auto _Match_try = _Haystack + _Min_value(_Start_at, _Hay_size - 1); ; --_Match_try)
145  {
146  if (_Traits::eq(*_Match_try, _Ch))
147  {
148  return (_Match_try - _Haystack); // found a match
149  }
150 
151  if (_Match_try == _Haystack)
152  {
153  break; // at beginning, no more chance for match
154  }
155  }
156  }
157 
158  return (static_cast<size_t>(-1)); // no match
159  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
template<class _Traits >
_CONSTEXPR14 size_t _Traits_rfind_not_ch ( _In_reads_(_Hay_size) const _Traits_ptr_t< _Traits >  _Haystack,
const size_t  _Hay_size,
const size_t  _Start_at,
const _Traits_ch_t< _Traits >  _Ch 
)
273  { // search [_Haystack, _Haystack + _Hay_size) for any value other than _Ch before _Start_at
274  if (_Hay_size != 0)
275  { // room for match, look for it
276  for (auto _Match_try = _Haystack + _Min_value(_Start_at, _Hay_size - 1); ; --_Match_try)
277  {
278  if (!_Traits::eq(*_Match_try, _Ch))
279  {
280  return (_Match_try - _Haystack); // found a match
281  }
282 
283  if (_Match_try == _Haystack)
284  {
285  break; // at beginning, no more chance for match
286  }
287  }
288  }
289 
290  return (static_cast<size_t>(-1)); // no match
291  }
_Check_return_ _In_ wchar_t _Ch
Definition: vcruntime_string.h:89
template<class _Mystr >
_String_const_iterator<_Mystr>::_Unchecked_type _Unchecked ( _String_const_iterator< _Mystr >  _Iter)
inline
1378  { // convert to unchecked
1379  return (_Iter._Unchecked());
1380  }
_Unchecked_type _Unchecked() const
Definition: xstring:1208
template<class _Mystr >
_String_iterator<_Mystr>::_Unchecked_type _Unchecked ( _String_iterator< _Mystr >  _Iter)
inline
1510  { // convert to unchecked
1511  return (_Iter._Unchecked());
1512  }
_Unchecked_type _Unchecked() const
Definition: xstring:1432
template<class _Elem , class _Traits , class _Alloc >
bool operator!= ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3853  { // test for string inequality
3854  return (!(_Left == _Right));
3855  }
template<class _Elem , class _Traits , class _Alloc >
bool operator!= ( _In_z_ const _Elem *const  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3863  { // test for NTCTS vs. string inequality
3864  return (!(_Left == _Right));
3865  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
template<class _Elem , class _Traits , class _Alloc >
bool operator!= ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
_In_z_ const _Elem *const  _Right 
)
inline
3873  { // test for string vs. NTCTS inequality
3874  return (!(_Left == _Right));
3875  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Mystr >
_String_const_iterator<_Mystr> operator+ ( typename _String_const_iterator< _Mystr >::difference_type  _Off,
_String_const_iterator< _Mystr >  _Next 
)
inline
1396  { // add offset to iterator
1397  return (_Next += _Off);
1398  }
template<class _Mystr >
_String_iterator<_Mystr> operator+ ( typename _String_iterator< _Mystr >::difference_type  _Off,
_String_iterator< _Mystr >  _Next 
)
inline
1528  { // add offset to iterator
1529  return (_Next += _Off);
1530  }
template<class _Elem , class _Traits , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3676  { // return string + string
3678  _Ans.reserve(_Left.size() + _Right.size());
3679  _Ans += _Left;
3680  _Ans += _Right;
3681  return (_Ans);
3682  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
size_type size() const _NOEXCEPT
Definition: xstring:3023
Definition: xstring:1866
constexpr const _Ty &() _Right
Definition: algorithm:3723
void reserve(_CRT_GUARDOVERFLOW const size_type _Newcap=0)
Definition: xstring:3056
template<class _Elem , class _Traits , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( _In_z_ const _Elem *const  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3690  { // return NTCTS + string
3692  _Ans.reserve(_Traits::length(_Left) + _Right.size());
3693  _Ans += _Left;
3694  _Ans += _Right;
3695  return (_Ans);
3696  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
size_type size() const _NOEXCEPT
Definition: xstring:3023
Definition: xstring:1866
constexpr const _Ty &() _Right
Definition: algorithm:3723
void reserve(_CRT_GUARDOVERFLOW const size_type _Newcap=0)
Definition: xstring:3056
template<class _Elem , class _Traits , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( const _Elem  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3704  { // return character + string
3706  _Ans.reserve(1 + _Right.size());
3707  _Ans += _Left;
3708  _Ans += _Right;
3709  return (_Ans);
3710  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
size_type size() const _NOEXCEPT
Definition: xstring:3023
Definition: xstring:1866
constexpr const _Ty &() _Right
Definition: algorithm:3723
void reserve(_CRT_GUARDOVERFLOW const size_type _Newcap=0)
Definition: xstring:3056
template<class _Elem , class _Traits , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
_In_z_ const _Elem *const  _Right 
)
inline
3718  { // return string + NTCTS
3720  _Ans.reserve(_Left.size() + _Traits::length(_Right));
3721  _Ans += _Left;
3722  _Ans += _Right;
3723  return (_Ans);
3724  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
size_type size() const _NOEXCEPT
Definition: xstring:3023
Definition: xstring:1866
constexpr const _Ty &() _Right
Definition: algorithm:3723
void reserve(_CRT_GUARDOVERFLOW const size_type _Newcap=0)
Definition: xstring:3056
template<class _Elem , class _Traits , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
const _Elem  _Right 
)
inline
3732  { // return string + character
3734  _Ans.reserve(_Left.size() + 1);
3735  _Ans += _Left;
3736  _Ans += _Right;
3737  return (_Ans);
3738  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
size_type size() const _NOEXCEPT
Definition: xstring:3023
Definition: xstring:1866
constexpr const _Ty &() _Right
Definition: algorithm:3723
void reserve(_CRT_GUARDOVERFLOW const size_type _Newcap=0)
Definition: xstring:3056
template<class _Elem , class _Traits , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
basic_string< _Elem, _Traits, _Alloc > &&  _Right 
)
inline
3746  { // return string + string
3747  return (_STD move(_Right.insert(0, _Left)));
3748  }
iterator insert(const const_iterator _Where, const initializer_list< _Elem > _Ilist)
Definition: xstring:2204
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Elem , class _Traits , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( basic_string< _Elem, _Traits, _Alloc > &&  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3756  { // return string + string
3757  return (_STD move(_Left.append(_Right)));
3758  }
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Elem , class _Traits , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( basic_string< _Elem, _Traits, _Alloc > &&  _Left,
basic_string< _Elem, _Traits, _Alloc > &&  _Right 
)
inline
3766  { // return string + string
3767  if (_Right.size() <= _Left.capacity() - _Left.size()
3768  || _Right.capacity() - _Right.size() < _Left.size())
3769  return (_STD move(_Left.append(_Right)));
3770  else
3771  return (_STD move(_Right.insert(0, _Left)));
3772  }
iterator insert(const const_iterator _Where, const initializer_list< _Elem > _Ilist)
Definition: xstring:2204
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
size_type size() const _NOEXCEPT
Definition: xstring:3023
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
size_type capacity() const _NOEXCEPT
Definition: xstring:3051
template<class _Elem , class _Traits , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( _In_z_ const _Elem *const  _Left,
basic_string< _Elem, _Traits, _Alloc > &&  _Right 
)
inline
3780  { // return NTCTS + string
3781  return (_STD move(_Right.insert(0, _Left)));
3782  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
iterator insert(const const_iterator _Where, const initializer_list< _Elem > _Ilist)
Definition: xstring:2204
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
template<class _Elem , class _Traits , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( const _Elem  _Left,
basic_string< _Elem, _Traits, _Alloc > &&  _Right 
)
inline
3790  { // return character + string
3792  size_type;
3793  return (_STD move(_Right.insert((size_type)0, (size_type)1, _Left)));
3794  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
iterator insert(const const_iterator _Where, const initializer_list< _Elem > _Ilist)
Definition: xstring:2204
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 , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( basic_string< _Elem, _Traits, _Alloc > &&  _Left,
_In_z_ const _Elem *const  _Right 
)
inline
3802  { // return string + NTCTS
3803  return (_STD move(_Left.append(_Right)));
3804  }
_Myt & append(initializer_list< _Elem > _Ilist)
Definition: xstring:2199
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 , class _Alloc >
basic_string<_Elem, _Traits, _Alloc> operator+ ( basic_string< _Elem, _Traits, _Alloc > &&  _Left,
const _Elem  _Right 
)
inline
3812  { // return string + character
3813  _Left.push_back(_Right);
3814  return (_STD move(_Left));
3815  }
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
void push_back(const _Elem _Ch)
Definition: xstring:2961
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem , class _Traits , class _Alloc >
bool operator< ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3883  { // test if string < string
3884  return (_Left.compare(_Right) < 0);
3885  }
template<class _Elem , class _Traits , class _Alloc >
bool operator< ( _In_z_ const _Elem *const  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3893  { // test if NTCTS < string
3894  return (_Right.compare(_Left) > 0);
3895  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
template<class _Elem , class _Traits , class _Alloc >
bool operator< ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
_In_z_ const _Elem *const  _Right 
)
inline
3903  { // test if string < NTCTS
3904  return (_Left.compare(_Right) < 0);
3905  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem , class _Traits , class _Alloc >
bool operator<= ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3943  { // test if string <= string
3944  return (!(_Right < _Left));
3945  }
template<class _Elem , class _Traits , class _Alloc >
bool operator<= ( _In_z_ const _Elem *const  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3953  { // test if NTCTS <= string
3954  return (!(_Right < _Left));
3955  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
template<class _Elem , class _Traits , class _Alloc >
bool operator<= ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
_In_z_ const _Elem *const  _Right 
)
inline
3963  { // test if string <= NTCTS
3964  return (!(_Right < _Left));
3965  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem , class _Traits , class _Alloc >
bool operator== ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3823  { // test for string equality
3824  return (_Left._Equal(_Right));
3825  }
template<class _Elem , class _Traits , class _Alloc >
bool operator== ( _In_z_ const _Elem *const  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3833  { // test for NTCTS vs. string equality
3834  return (_Right._Equal(_Left));
3835  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
template<class _Elem , class _Traits , class _Alloc >
bool operator== ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
_In_z_ const _Elem *const  _Right 
)
inline
3843  { // test for string vs. NTCTS equality
3844  return (_Left._Equal(_Right));
3845  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem , class _Traits , class _Alloc >
bool operator> ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3913  { // test if string > string
3914  return (_Right < _Left);
3915  }
template<class _Elem , class _Traits , class _Alloc >
bool operator> ( _In_z_ const _Elem *const  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3923  { // test if NTCTS > string
3924  return (_Right < _Left);
3925  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
template<class _Elem , class _Traits , class _Alloc >
bool operator> ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
_In_z_ const _Elem *const  _Right 
)
inline
3933  { // test if string > NTCTS
3934  return (_Right < _Left);
3935  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem , class _Traits , class _Alloc >
bool operator>= ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3973  { // test if string >= string
3974  return (!(_Left < _Right));
3975  }
template<class _Elem , class _Traits , class _Alloc >
bool operator>= ( _In_z_ const _Elem *const  _Left,
const basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3983  { // test if NTCTS >= string
3984  return (!(_Left < _Right));
3985  }
constexpr const _Ty &() _Left
Definition: algorithm:3722
template<class _Elem , class _Traits , class _Alloc >
bool operator>= ( const basic_string< _Elem, _Traits, _Alloc > &  _Left,
_In_z_ const _Elem *const  _Right 
)
inline
3993  { // test if string >= NTCTS
3994  return (!(_Left < _Right));
3995  }
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<class _Elem , class _Traits , class _Alloc >
void swap ( basic_string< _Elem, _Traits, _Alloc > &  _Left,
basic_string< _Elem, _Traits, _Alloc > &  _Right 
)
inline
3666  { // swap _Left and _Right strings
3667  _Left.swap(_Right);
3668  }