Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mov DWORD PTR [esi+16], edi
- ; 517 : : this->_Bx._Buf);
- jb SHORT $LN108@assign
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov eax, DWORD PTR [esi]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax+edi], 0
- pop edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1138 : return (*this);
- mov eax, esi
- pop esi
- pop ebx
- ; 1139 : }
- pop ebp
- ret 8
- $LN108@assign:
- ; 517 : : this->_Bx._Buf);
- mov eax, esi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax+edi], 0
- $LN112@assign:
- pop edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1138 : return (*this);
- mov eax, esi
- pop esi
- pop ebx
- ; 1139 : }
- pop ebp
- ret 8
- $LN118@assign:
- ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@PBDI@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z
- _TEXT SEGMENT
- __Newsize$ = 8 ; size = 4
- ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Eos, COMDAT
- ; _this$ = ecx
- ; 2217 : { // set new length and null terminator
- push ebp
- mov ebp, esp
- ; 517 : : this->_Bx._Buf);
- cmp DWORD PTR [ecx+20], 16 ; 00000010H
- ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
- mov edx, DWORD PTR __Newsize$[ebp]
- mov DWORD PTR [ecx+16], edx
- ; 517 : : this->_Bx._Buf);
- jb SHORT $LN5@Eos
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov eax, DWORD PTR [ecx]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax+edx], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 2219 : }
- pop ebp
- ret 4
- $LN5@Eos:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [ecx+edx], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 2219 : }
- pop ebp
- ret 4
- ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Eos
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?_Xran@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ
- _TEXT SEGMENT
- ?_Xran@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Xran, COMDAT
- ; _this$dead$ = ecx
- ; 2276 : _Xout_of_range("invalid string position");
- push OFFSET ??_C@_0BI@CFPLBAOH@invalid?5string?5position?$AA@
- call DWORD PTR __imp_?_Xout_of_range@std@@YAXPBD@Z
- $LN4@Xran:
- $LN3@Xran:
- int 3
- ?_Xran@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Xran
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??0?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAE@XZ
- _TEXT SEGMENT
- ??0?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAE@XZ PROC ; std::_Wrap_alloc<std::allocator<char> >::_Wrap_alloc<std::allocator<char> >, COMDAT
- ; _this$ = ecx
- ; 831 : }
- mov eax, ecx
- ret 0
- ??0?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAE@XZ ENDP ; std::_Wrap_alloc<std::allocator<char> >::_Wrap_alloc<std::allocator<char> >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?deallocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPADI@Z
- _TEXT SEGMENT
- __Ptr$ = 8 ; size = 4
- __Count$dead$ = 12 ; size = 4
- ?deallocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPADI@Z PROC ; std::_Wrap_alloc<std::allocator<char> >::deallocate, COMDAT
- ; _this$dead$ = ecx
- ; 886 : { // deallocate object at _Ptr, ignore size
- push ebp
- mov ebp, esp
- ; 586 : ::operator delete(_Ptr);
- push DWORD PTR __Ptr$[ebp]
- call DWORD PTR __imp_??3@YAXPAX@Z
- add esp, 4
- ; 887 : _Mybase::deallocate(_Ptr, _Count);
- ; 888 : }
- pop ebp
- ret 8
- ?deallocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPADI@Z ENDP ; std::_Wrap_alloc<std::allocator<char> >::deallocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ
- _TEXT SEGMENT
- ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ PROC ; std::_String_val<std::_Simple_types<char> >::_String_val<std::_Simple_types<char> >, COMDAT
- ; _this$ = ecx
- ; 497 : { // initialize values
- ; 498 : _Mysize = 0;
- mov DWORD PTR [ecx+16], 0
- ; 499 : _Myres = 0;
- mov DWORD PTR [ecx+20], 0
- ; 500 : }
- mov eax, ecx
- ret 0
- ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ ENDP ; std::_String_val<std::_Simple_types<char> >::_String_val<std::_Simple_types<char> >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Destroy@?$vector@HV?$allocator@H@std@@@std@@IAEXPAH0@Z
- _TEXT SEGMENT
- __First$dead$ = 8 ; size = 4
- __Last$dead$ = 12 ; size = 4
- ?_Destroy@?$vector@HV?$allocator@H@std@@@std@@IAEXPAH0@Z PROC ; std::vector<int,std::allocator<int> >::_Destroy, COMDAT
- ; _this$dead$ = ecx
- ; 1479 : _Alty _Alval(this->_Getal());
- ; 1480 : _Destroy_range(_First, _Last, _Alval);
- ; 1481 : }
- ret 8
- ?_Destroy@?$vector@HV?$allocator@H@std@@@std@@IAEXPAH0@Z ENDP ; std::vector<int,std::allocator<int> >::_Destroy
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Getal@?$_Vector_alloc@$0A@U?$_Vec_base_types@HV?$allocator@H@std@@@std@@@std@@QBE?AU?$_Wrap_alloc@V?$allocator@H@std@@@2@XZ
- _TEXT SEGMENT
- ___$ReturnUdt$ = 8 ; size = 4
- ?_Getal@?$_Vector_alloc@$0A@U?$_Vec_base_types@HV?$allocator@H@std@@@std@@@std@@QBE?AU?$_Wrap_alloc@V?$allocator@H@std@@@2@XZ PROC ; std::_Vector_alloc<0,std::_Vec_base_types<int,std::allocator<int> > >::_Getal, COMDAT
- ; _this$dead$ = ecx
- ; 646 : { // get reference to allocator
- push ebp
- mov ebp, esp
- ; 647 : return (_Alty());
- mov eax, DWORD PTR ___$ReturnUdt$[ebp]
- ; 648 : }
- pop ebp
- ret 4
- ?_Getal@?$_Vector_alloc@$0A@U?$_Vec_base_types@HV?$allocator@H@std@@@std@@@std@@QBE?AU?$_Wrap_alloc@V?$allocator@H@std@@@2@XZ ENDP ; std::_Vector_alloc<0,std::_Vec_base_types<int,std::allocator<int> > >::_Getal
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?deallocate@?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAEXPAHI@Z
- _TEXT SEGMENT
- __Ptr$ = 8 ; size = 4
- __Count$dead$ = 12 ; size = 4
- ?deallocate@?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAEXPAHI@Z PROC ; std::_Wrap_alloc<std::allocator<int> >::deallocate, COMDAT
- ; _this$dead$ = ecx
- ; 886 : { // deallocate object at _Ptr, ignore size
- push ebp
- mov ebp, esp
- ; 586 : ::operator delete(_Ptr);
- push DWORD PTR __Ptr$[ebp]
- call DWORD PTR __imp_??3@YAXPAX@Z
- add esp, 4
- ; 887 : _Mybase::deallocate(_Ptr, _Count);
- ; 888 : }
- pop ebp
- ret 8
- ?deallocate@?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAEXPAHI@Z ENDP ; std::_Wrap_alloc<std::allocator<int> >::deallocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ??0?$_Vector_val@U?$_Simple_types@H@std@@@std@@QAE@XZ
- _TEXT SEGMENT
- ??0?$_Vector_val@U?$_Simple_types@H@std@@@std@@QAE@XZ PROC ; std::_Vector_val<std::_Simple_types<int> >::_Vector_val<std::_Simple_types<int> >, COMDAT
- ; _this$ = ecx
- ; 485 : { // initialize values
- ; 486 : _Myfirst = pointer();
- mov DWORD PTR [ecx], 0
- ; 487 : _Mylast = pointer();
- mov DWORD PTR [ecx+4], 0
- ; 488 : _Myend = pointer();
- mov DWORD PTR [ecx+8], 0
- ; 489 : }
- mov eax, ecx
- ret 0
- ??0?$_Vector_val@U?$_Simple_types@H@std@@@std@@QAE@XZ ENDP ; std::_Vector_val<std::_Simple_types<int> >::_Vector_val<std::_Simple_types<int> >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?begin@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@XZ
- _TEXT SEGMENT
- ___$ReturnUdt$ = 8 ; size = 4
- ?begin@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@XZ PROC ; std::vector<double,std::allocator<double> >::begin, COMDAT
- ; _this$ = ecx
- ; 981 : { // return iterator for beginning of mutable sequence
- push ebp
- mov ebp, esp
- ; 47 : { // construct with pointer _Parg
- mov eax, DWORD PTR ___$ReturnUdt$[ebp]
- mov ecx, DWORD PTR [ecx]
- mov DWORD PTR [eax], ecx
- ; 982 : return (iterator(this->_Myfirst, this));
- ; 983 : }
- pop ebp
- ret 4
- ?begin@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@XZ ENDP ; std::vector<double,std::allocator<double> >::begin
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?end@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@XZ
- _TEXT SEGMENT
- ___$ReturnUdt$ = 8 ; size = 4
- ?end@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@XZ PROC ; std::vector<double,std::allocator<double> >::end, COMDAT
- ; _this$ = ecx
- ; 991 : { // return iterator for end of mutable sequence
- push ebp
- mov ebp, esp
- ; 47 : { // construct with pointer _Parg
- mov eax, DWORD PTR ___$ReturnUdt$[ebp]
- mov ecx, DWORD PTR [ecx+4]
- mov DWORD PTR [eax], ecx
- ; 992 : return (iterator(this->_Mylast, this));
- ; 993 : }
- pop ebp
- ret 4
- ?end@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@XZ ENDP ; std::vector<double,std::allocator<double> >::end
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ
- _TEXT SEGMENT
- ?size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ PROC ; std::vector<double,std::allocator<double> >::size, COMDAT
- ; _this$ = ecx
- ; 1087 : return (this->_Mylast - this->_Myfirst);
- mov eax, DWORD PTR [ecx+4]
- sub eax, DWORD PTR [ecx]
- sar eax, 3
- ; 1088 : }
- ret 0
- ?size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ ENDP ; std::vector<double,std::allocator<double> >::size
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?erase@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@V?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@0@Z
- _TEXT SEGMENT
- ___$ReturnUdt$ = 8 ; size = 4
- __First_arg$ = 12 ; size = 4
- __Last_arg$ = 16 ; size = 4
- ?erase@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@V?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@0@Z PROC ; std::vector<double,std::allocator<double> >::erase, COMDAT
- ; _this$ = ecx
- ; 1381 : { // erase [_First, _Last)
- push ebp
- mov ebp, esp
- ; 1382 : if (_First_arg == begin() && _Last_arg == end())
- mov eax, DWORD PTR __Last_arg$[ebp]
- push ebx
- mov ebx, ecx
- push edi
- ; 48 : this->_Adopt(_Pvector);
- ; 49 : }
- ; 50 :
- ; 51 : typedef pointer _Unchecked_type;
- ; 52 :
- ; 53 : _Myiter& _Rechecked(_Unchecked_type _Right)
- ; 54 : { // reset from unchecked iterator
- ; 55 : this->_Ptr = (_Tptr)_Right;
- ; 56 : return (*this);
- ; 57 : }
- ; 58 :
- ; 59 : _Unchecked_type _Unchecked() const
- ; 60 : { // make an unchecked iterator
- ; 61 : return (_Unchecked_type(this->_Ptr));
- ; 62 : }
- ; 63 :
- ; 64 : reference operator*() const
- ; 65 : { // return designated object
- ; 66 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 67 : if (this->_Getcont() == 0
- ; 68 : || this->_Ptr == 0
- ; 69 : || this->_Ptr < ((_Myvec *)this->_Getcont())->_Myfirst
- ; 70 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
- ; 71 : { // report error
- ; 72 : _DEBUG_ERROR("vector iterator not dereferencable");
- ; 73 : _SCL_SECURE_OUT_OF_RANGE;
- ; 74 : }
- ; 75 :
- ; 76 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 77 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 78 : _SCL_SECURE_VALIDATE_RANGE(
- ; 79 : this->_Ptr != _Tptr()
- ; 80 : && ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr
- ; 81 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
- ; 82 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 83 :
- ; 84 : _Analysis_assume_(this->_Ptr != _Tptr());
- ; 85 :
- ; 86 : return (*this->_Ptr);
- ; 87 : }
- ; 88 :
- ; 89 : pointer operator->() const
- ; 90 : { // return pointer to class object
- ; 91 : return (_STD pointer_traits<pointer>::pointer_to(**this));
- ; 92 : }
- ; 93 :
- ; 94 : _Myiter& operator++()
- ; 95 : { // preincrement
- ; 96 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 97 : if (this->_Getcont() == 0
- ; 98 : || this->_Ptr == 0
- ; 99 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
- ; 100 : { // report error
- ; 101 : _DEBUG_ERROR("vector iterator not incrementable");
- ; 102 : _SCL_SECURE_OUT_OF_RANGE;
- ; 103 : }
- ; 104 :
- ; 105 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 106 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 107 : _SCL_SECURE_VALIDATE_RANGE(
- ; 108 : this->_Ptr != _Tptr()
- ; 109 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
- ; 110 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 111 :
- ; 112 : ++this->_Ptr;
- ; 113 : return (*this);
- ; 114 : }
- ; 115 :
- ; 116 : _Myiter operator++(int)
- ; 117 : { // postincrement
- ; 118 : _Myiter _Tmp = *this;
- ; 119 : ++*this;
- ; 120 : return (_Tmp);
- ; 121 : }
- ; 122 :
- ; 123 : _Myiter& operator--()
- ; 124 : { // predecrement
- ; 125 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 126 : if (this->_Getcont() == 0
- ; 127 : || this->_Ptr == 0
- ; 128 : || this->_Ptr <= ((_Myvec *)this->_Getcont())->_Myfirst)
- ; 129 : { // report error
- ; 130 : _DEBUG_ERROR("vector iterator not decrementable");
- ; 131 : _SCL_SECURE_OUT_OF_RANGE;
- ; 132 : }
- ; 133 :
- ; 134 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 135 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 136 : _SCL_SECURE_VALIDATE_RANGE(
- ; 137 : this->_Ptr != _Tptr()
- ; 138 : && ((_Myvec *)this->_Getcont())->_Myfirst < this->_Ptr);
- ; 139 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 140 :
- ; 141 : --this->_Ptr;
- ; 142 : return (*this);
- ; 143 : }
- ; 144 :
- ; 145 : _Myiter operator--(int)
- ; 146 : { // postdecrement
- ; 147 : _Myiter _Tmp = *this;
- ; 148 : --*this;
- ; 149 : return (_Tmp);
- ; 150 : }
- ; 151 :
- ; 152 : _Myiter& operator+=(difference_type _Off)
- ; 153 : { // increment by integer
- ; 154 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 155 : if (this->_Getcont() == 0
- ; 156 : || this->_Ptr + _Off < ((_Myvec *)this->_Getcont())->_Myfirst
- ; 157 : || ((_Myvec *)this->_Getcont())->_Mylast < this->_Ptr + _Off)
- ; 158 : { // report error
- ; 159 : _DEBUG_ERROR("vector iterator + offset out of range");
- ; 160 : _SCL_SECURE_OUT_OF_RANGE;
- ; 161 : }
- ; 162 :
- ; 163 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 164 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 165 : _SCL_SECURE_VALIDATE_RANGE(
- ; 166 : ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr + _Off
- ; 167 : && this->_Ptr + _Off <= ((_Myvec *)this->_Getcont())->_Mylast);
- ; 168 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 169 :
- ; 170 : _Ptr += _Off;
- ; 171 : return (*this);
- ; 172 : }
- ; 173 :
- ; 174 : _Myiter operator+(difference_type _Off) const
- ; 175 : { // return this + integer
- ; 176 : _Myiter _Tmp = *this;
- ; 177 : return (_Tmp += _Off);
- ; 178 : }
- ; 179 :
- ; 180 : _Myiter& operator-=(difference_type _Off)
- ; 181 : { // decrement by integer
- ; 182 : return (*this += -_Off);
- ; 183 : }
- ; 184 :
- ; 185 : _Myiter operator-(difference_type _Off) const
- ; 186 : { // return this - integer
- ; 187 : _Myiter _Tmp = *this;
- ; 188 : return (_Tmp -= _Off);
- ; 189 : }
- ; 190 :
- ; 191 : difference_type operator-(const _Myiter& _Right) const
- ; 192 : { // return difference of iterators
- ; 193 : _Compat(_Right);
- ; 194 : return (this->_Ptr - _Right._Ptr);
- ; 195 : }
- ; 196 :
- ; 197 : reference operator[](difference_type _Off) const
- ; 198 : { // subscript
- ; 199 : return (*(*this + _Off));
- ; 200 : }
- ; 201 :
- ; 202 : bool operator==(const _Myiter& _Right) const
- ; 203 : { // test for iterator equality
- ; 204 : _Compat(_Right);
- ; 205 : return (this->_Ptr == _Right._Ptr);
- mov ecx, DWORD PTR [ebx]
- mov edi, DWORD PTR __First_arg$[ebp]
- cmp edi, ecx
- ; 1382 : if (_First_arg == begin() && _Last_arg == end())
- jne SHORT $LN4@erase
- ; 48 : this->_Adopt(_Pvector);
- ; 49 : }
- ; 50 :
- ; 51 : typedef pointer _Unchecked_type;
- ; 52 :
- ; 53 : _Myiter& _Rechecked(_Unchecked_type _Right)
- ; 54 : { // reset from unchecked iterator
- ; 55 : this->_Ptr = (_Tptr)_Right;
- ; 56 : return (*this);
- ; 57 : }
- ; 58 :
- ; 59 : _Unchecked_type _Unchecked() const
- ; 60 : { // make an unchecked iterator
- ; 61 : return (_Unchecked_type(this->_Ptr));
- ; 62 : }
- ; 63 :
- ; 64 : reference operator*() const
- ; 65 : { // return designated object
- ; 66 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 67 : if (this->_Getcont() == 0
- ; 68 : || this->_Ptr == 0
- ; 69 : || this->_Ptr < ((_Myvec *)this->_Getcont())->_Myfirst
- ; 70 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
- ; 71 : { // report error
- ; 72 : _DEBUG_ERROR("vector iterator not dereferencable");
- ; 73 : _SCL_SECURE_OUT_OF_RANGE;
- ; 74 : }
- ; 75 :
- ; 76 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 77 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 78 : _SCL_SECURE_VALIDATE_RANGE(
- ; 79 : this->_Ptr != _Tptr()
- ; 80 : && ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr
- ; 81 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
- ; 82 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 83 :
- ; 84 : _Analysis_assume_(this->_Ptr != _Tptr());
- ; 85 :
- ; 86 : return (*this->_Ptr);
- ; 87 : }
- ; 88 :
- ; 89 : pointer operator->() const
- ; 90 : { // return pointer to class object
- ; 91 : return (_STD pointer_traits<pointer>::pointer_to(**this));
- ; 92 : }
- ; 93 :
- ; 94 : _Myiter& operator++()
- ; 95 : { // preincrement
- ; 96 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 97 : if (this->_Getcont() == 0
- ; 98 : || this->_Ptr == 0
- ; 99 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
- ; 100 : { // report error
- ; 101 : _DEBUG_ERROR("vector iterator not incrementable");
- ; 102 : _SCL_SECURE_OUT_OF_RANGE;
- ; 103 : }
- ; 104 :
- ; 105 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 106 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 107 : _SCL_SECURE_VALIDATE_RANGE(
- ; 108 : this->_Ptr != _Tptr()
- ; 109 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
- ; 110 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 111 :
- ; 112 : ++this->_Ptr;
- ; 113 : return (*this);
- ; 114 : }
- ; 115 :
- ; 116 : _Myiter operator++(int)
- ; 117 : { // postincrement
- ; 118 : _Myiter _Tmp = *this;
- ; 119 : ++*this;
- ; 120 : return (_Tmp);
- ; 121 : }
- ; 122 :
- ; 123 : _Myiter& operator--()
- ; 124 : { // predecrement
- ; 125 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 126 : if (this->_Getcont() == 0
- ; 127 : || this->_Ptr == 0
- ; 128 : || this->_Ptr <= ((_Myvec *)this->_Getcont())->_Myfirst)
- ; 129 : { // report error
- ; 130 : _DEBUG_ERROR("vector iterator not decrementable");
- ; 131 : _SCL_SECURE_OUT_OF_RANGE;
- ; 132 : }
- ; 133 :
- ; 134 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 135 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 136 : _SCL_SECURE_VALIDATE_RANGE(
- ; 137 : this->_Ptr != _Tptr()
- ; 138 : && ((_Myvec *)this->_Getcont())->_Myfirst < this->_Ptr);
- ; 139 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 140 :
- ; 141 : --this->_Ptr;
- ; 142 : return (*this);
- ; 143 : }
- ; 144 :
- ; 145 : _Myiter operator--(int)
- ; 146 : { // postdecrement
- ; 147 : _Myiter _Tmp = *this;
- ; 148 : --*this;
- ; 149 : return (_Tmp);
- ; 150 : }
- ; 151 :
- ; 152 : _Myiter& operator+=(difference_type _Off)
- ; 153 : { // increment by integer
- ; 154 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 155 : if (this->_Getcont() == 0
- ; 156 : || this->_Ptr + _Off < ((_Myvec *)this->_Getcont())->_Myfirst
- ; 157 : || ((_Myvec *)this->_Getcont())->_Mylast < this->_Ptr + _Off)
- ; 158 : { // report error
- ; 159 : _DEBUG_ERROR("vector iterator + offset out of range");
- ; 160 : _SCL_SECURE_OUT_OF_RANGE;
- ; 161 : }
- ; 162 :
- ; 163 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 164 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 165 : _SCL_SECURE_VALIDATE_RANGE(
- ; 166 : ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr + _Off
- ; 167 : && this->_Ptr + _Off <= ((_Myvec *)this->_Getcont())->_Mylast);
- ; 168 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 169 :
- ; 170 : _Ptr += _Off;
- ; 171 : return (*this);
- ; 172 : }
- ; 173 :
- ; 174 : _Myiter operator+(difference_type _Off) const
- ; 175 : { // return this + integer
- ; 176 : _Myiter _Tmp = *this;
- ; 177 : return (_Tmp += _Off);
- ; 178 : }
- ; 179 :
- ; 180 : _Myiter& operator-=(difference_type _Off)
- ; 181 : { // decrement by integer
- ; 182 : return (*this += -_Off);
- ; 183 : }
- ; 184 :
- ; 185 : _Myiter operator-(difference_type _Off) const
- ; 186 : { // return this - integer
- ; 187 : _Myiter _Tmp = *this;
- ; 188 : return (_Tmp -= _Off);
- ; 189 : }
- ; 190 :
- ; 191 : difference_type operator-(const _Myiter& _Right) const
- ; 192 : { // return difference of iterators
- ; 193 : _Compat(_Right);
- ; 194 : return (this->_Ptr - _Right._Ptr);
- ; 195 : }
- ; 196 :
- ; 197 : reference operator[](difference_type _Off) const
- ; 198 : { // subscript
- ; 199 : return (*(*this + _Off));
- ; 200 : }
- ; 201 :
- ; 202 : bool operator==(const _Myiter& _Right) const
- ; 203 : { // test for iterator equality
- ; 204 : _Compat(_Right);
- ; 205 : return (this->_Ptr == _Right._Ptr);
- cmp eax, DWORD PTR [ebx+4]
- ; 1382 : if (_First_arg == begin() && _Last_arg == end())
- jne SHORT $LN4@erase
- ; 1411 :
- ; 1412 : void clear() _NOEXCEPT
- ; 1413 : { // erase all
- ; 1414 : this->_Orphan_all();
- ; 1415 : _Destroy(this->_Myfirst, this->_Mylast);
- ; 1416 : this->_Mylast = this->_Myfirst;
- mov DWORD PTR [ebx+4], ecx
- $LN77@erase:
- ; 47 : { // construct with pointer _Parg
- mov eax, DWORD PTR ___$ReturnUdt$[ebp]
- mov DWORD PTR [eax], edi
- pop edi
- pop ebx
- ; 1407 : }
- ; 1408 : }
- ; 1409 : return (_Make_iter(_First_arg));
- ; 1410 : }
- pop ebp
- ret 12 ; 0000000cH
- $LN4@erase:
- ; 48 : this->_Adopt(_Pvector);
- ; 49 : }
- ; 50 :
- ; 51 : typedef pointer _Unchecked_type;
- ; 52 :
- ; 53 : _Myiter& _Rechecked(_Unchecked_type _Right)
- ; 54 : { // reset from unchecked iterator
- ; 55 : this->_Ptr = (_Tptr)_Right;
- ; 56 : return (*this);
- ; 57 : }
- ; 58 :
- ; 59 : _Unchecked_type _Unchecked() const
- ; 60 : { // make an unchecked iterator
- ; 61 : return (_Unchecked_type(this->_Ptr));
- ; 62 : }
- ; 63 :
- ; 64 : reference operator*() const
- ; 65 : { // return designated object
- ; 66 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 67 : if (this->_Getcont() == 0
- ; 68 : || this->_Ptr == 0
- ; 69 : || this->_Ptr < ((_Myvec *)this->_Getcont())->_Myfirst
- ; 70 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
- ; 71 : { // report error
- ; 72 : _DEBUG_ERROR("vector iterator not dereferencable");
- ; 73 : _SCL_SECURE_OUT_OF_RANGE;
- ; 74 : }
- ; 75 :
- ; 76 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 77 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 78 : _SCL_SECURE_VALIDATE_RANGE(
- ; 79 : this->_Ptr != _Tptr()
- ; 80 : && ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr
- ; 81 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
- ; 82 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 83 :
- ; 84 : _Analysis_assume_(this->_Ptr != _Tptr());
- ; 85 :
- ; 86 : return (*this->_Ptr);
- ; 87 : }
- ; 88 :
- ; 89 : pointer operator->() const
- ; 90 : { // return pointer to class object
- ; 91 : return (_STD pointer_traits<pointer>::pointer_to(**this));
- ; 92 : }
- ; 93 :
- ; 94 : _Myiter& operator++()
- ; 95 : { // preincrement
- ; 96 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 97 : if (this->_Getcont() == 0
- ; 98 : || this->_Ptr == 0
- ; 99 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
- ; 100 : { // report error
- ; 101 : _DEBUG_ERROR("vector iterator not incrementable");
- ; 102 : _SCL_SECURE_OUT_OF_RANGE;
- ; 103 : }
- ; 104 :
- ; 105 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 106 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 107 : _SCL_SECURE_VALIDATE_RANGE(
- ; 108 : this->_Ptr != _Tptr()
- ; 109 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
- ; 110 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 111 :
- ; 112 : ++this->_Ptr;
- ; 113 : return (*this);
- ; 114 : }
- ; 115 :
- ; 116 : _Myiter operator++(int)
- ; 117 : { // postincrement
- ; 118 : _Myiter _Tmp = *this;
- ; 119 : ++*this;
- ; 120 : return (_Tmp);
- ; 121 : }
- ; 122 :
- ; 123 : _Myiter& operator--()
- ; 124 : { // predecrement
- ; 125 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 126 : if (this->_Getcont() == 0
- ; 127 : || this->_Ptr == 0
- ; 128 : || this->_Ptr <= ((_Myvec *)this->_Getcont())->_Myfirst)
- ; 129 : { // report error
- ; 130 : _DEBUG_ERROR("vector iterator not decrementable");
- ; 131 : _SCL_SECURE_OUT_OF_RANGE;
- ; 132 : }
- ; 133 :
- ; 134 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 135 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 136 : _SCL_SECURE_VALIDATE_RANGE(
- ; 137 : this->_Ptr != _Tptr()
- ; 138 : && ((_Myvec *)this->_Getcont())->_Myfirst < this->_Ptr);
- ; 139 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 140 :
- ; 141 : --this->_Ptr;
- ; 142 : return (*this);
- ; 143 : }
- ; 144 :
- ; 145 : _Myiter operator--(int)
- ; 146 : { // postdecrement
- ; 147 : _Myiter _Tmp = *this;
- ; 148 : --*this;
- ; 149 : return (_Tmp);
- ; 150 : }
- ; 151 :
- ; 152 : _Myiter& operator+=(difference_type _Off)
- ; 153 : { // increment by integer
- ; 154 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 155 : if (this->_Getcont() == 0
- ; 156 : || this->_Ptr + _Off < ((_Myvec *)this->_Getcont())->_Myfirst
- ; 157 : || ((_Myvec *)this->_Getcont())->_Mylast < this->_Ptr + _Off)
- ; 158 : { // report error
- ; 159 : _DEBUG_ERROR("vector iterator + offset out of range");
- ; 160 : _SCL_SECURE_OUT_OF_RANGE;
- ; 161 : }
- ; 162 :
- ; 163 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 164 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 165 : _SCL_SECURE_VALIDATE_RANGE(
- ; 166 : ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr + _Off
- ; 167 : && this->_Ptr + _Off <= ((_Myvec *)this->_Getcont())->_Mylast);
- ; 168 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 169 :
- ; 170 : _Ptr += _Off;
- ; 171 : return (*this);
- ; 172 : }
- ; 173 :
- ; 174 : _Myiter operator+(difference_type _Off) const
- ; 175 : { // return this + integer
- ; 176 : _Myiter _Tmp = *this;
- ; 177 : return (_Tmp += _Off);
- ; 178 : }
- ; 179 :
- ; 180 : _Myiter& operator-=(difference_type _Off)
- ; 181 : { // decrement by integer
- ; 182 : return (*this += -_Off);
- ; 183 : }
- ; 184 :
- ; 185 : _Myiter operator-(difference_type _Off) const
- ; 186 : { // return this - integer
- ; 187 : _Myiter _Tmp = *this;
- ; 188 : return (_Tmp -= _Off);
- ; 189 : }
- ; 190 :
- ; 191 : difference_type operator-(const _Myiter& _Right) const
- ; 192 : { // return difference of iterators
- ; 193 : _Compat(_Right);
- ; 194 : return (this->_Ptr - _Right._Ptr);
- ; 195 : }
- ; 196 :
- ; 197 : reference operator[](difference_type _Off) const
- ; 198 : { // subscript
- ; 199 : return (*(*this + _Off));
- ; 200 : }
- ; 201 :
- ; 202 : bool operator==(const _Myiter& _Right) const
- ; 203 : { // test for iterator equality
- ; 204 : _Compat(_Right);
- ; 205 : return (this->_Ptr == _Right._Ptr);
- cmp edi, eax
- ; 1383 : clear();
- ; 1384 : else if (_First_arg != _Last_arg)
- je SHORT $LN77@erase
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; 2475 : ptrdiff_t _Count = _Last - _First;
- mov ecx, DWORD PTR [ebx+4]
- sub ecx, eax
- push esi
- sar ecx, 3
- ; 2477 : _Count * sizeof (*_First));
- lea esi, DWORD PTR [ecx*8]
- push esi
- push eax
- push edi
- call DWORD PTR __imp__memmove
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; 47 : { // construct with pointer _Parg
- mov ecx, DWORD PTR __First_arg$[ebp]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; 2477 : _Count * sizeof (*_First));
- add esp, 12 ; 0000000cH
- ; 2478 : return (_Dest + _Count);
- lea eax, DWORD PTR [esi+edi]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; 1406 : this->_Mylast = _Ptr;
- mov DWORD PTR [ebx+4], eax
- ; 47 : { // construct with pointer _Parg
- mov eax, DWORD PTR ___$ReturnUdt$[ebp]
- pop esi
- pop edi
- mov DWORD PTR [eax], ecx
- pop ebx
- ; 1407 : }
- ; 1408 : }
- ; 1409 : return (_Make_iter(_First_arg));
- ; 1410 : }
- pop ebp
- ret 12 ; 0000000cH
- ?erase@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@V?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@0@Z ENDP ; std::vector<double,std::allocator<double> >::erase
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Destroy@?$vector@NV?$allocator@N@std@@@std@@IAEXPAN0@Z
- _TEXT SEGMENT
- __First$dead$ = 8 ; size = 4
- __Last$dead$ = 12 ; size = 4
- ?_Destroy@?$vector@NV?$allocator@N@std@@@std@@IAEXPAN0@Z PROC ; std::vector<double,std::allocator<double> >::_Destroy, COMDAT
- ; _this$dead$ = ecx
- ; 1479 : _Alty _Alval(this->_Getal());
- ; 1480 : _Destroy_range(_First, _Last, _Alval);
- ; 1481 : }
- ret 8
- ?_Destroy@?$vector@NV?$allocator@N@std@@@std@@IAEXPAN0@Z ENDP ; std::vector<double,std::allocator<double> >::_Destroy
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Reserve@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z
- _TEXT SEGMENT
- __Count$ = 8 ; size = 4
- ?_Reserve@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z PROC ; std::vector<double,std::allocator<double> >::_Reserve, COMDAT
- ; _this$ = ecx
- ; 1525 : { // ensure room for _Count new elements, grow exponentially
- push ebp
- mov ebp, esp
- ; 968 : }
- ; 969 :
- ; 970 : size_type _Unused_capacity() const _NOEXCEPT
- ; 971 : { // micro-optimization for capacity() - size()
- ; 972 : return (this->_Myend - this->_Mylast);
- mov edx, DWORD PTR [ecx+8]
- push esi
- mov esi, DWORD PTR [ecx+4]
- mov eax, edx
- sub eax, esi
- push edi
- ; 1526 : if (_Unused_capacity() < _Count)
- mov edi, DWORD PTR __Count$[ebp]
- ; 968 : }
- ; 969 :
- ; 970 : size_type _Unused_capacity() const _NOEXCEPT
- ; 971 : { // micro-optimization for capacity() - size()
- ; 972 : return (this->_Myend - this->_Mylast);
- sar eax, 3
- ; 1526 : if (_Unused_capacity() < _Count)
- cmp eax, edi
- jae SHORT $LN2@Reserve
- ; 973 : }
- ; 974 :
- ; 975 : size_type _Has_unused_capacity() const _NOEXCEPT
- ; 976 : { // micro-optimization for capacity() != size()
- ; 977 : return (this->_Myend != this->_Mylast);
- ; 978 : }
- ; 979 :
- ; 980 : iterator begin() _NOEXCEPT
- ; 981 : { // return iterator for beginning of mutable sequence
- ; 982 : return (iterator(this->_Myfirst, this));
- ; 983 : }
- ; 984 :
- ; 985 : const_iterator begin() const _NOEXCEPT
- ; 986 : { // return iterator for beginning of nonmutable sequence
- ; 987 : return (const_iterator(this->_Myfirst, this));
- ; 988 : }
- ; 989 :
- ; 990 : iterator end() _NOEXCEPT
- ; 991 : { // return iterator for end of mutable sequence
- ; 992 : return (iterator(this->_Mylast, this));
- ; 993 : }
- ; 994 :
- ; 995 : const_iterator end() const _NOEXCEPT
- ; 996 : { // return iterator for end of nonmutable sequence
- ; 997 : return (const_iterator(this->_Mylast, this));
- ; 998 : }
- ; 999 :
- ; 1000 : iterator _Make_iter(const_iterator _Where) const
- ; 1001 : { // make iterator from const_iterator
- ; 1002 : return (iterator(_Where._Ptr, this));
- ; 1003 : }
- ; 1004 :
- ; 1005 : reverse_iterator rbegin() _NOEXCEPT
- ; 1006 : { // return iterator for beginning of reversed mutable sequence
- ; 1007 : return (reverse_iterator(end()));
- ; 1008 : }
- ; 1009 :
- ; 1010 : const_reverse_iterator rbegin() const _NOEXCEPT
- ; 1011 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1012 : return (const_reverse_iterator(end()));
- ; 1013 : }
- ; 1014 :
- ; 1015 : reverse_iterator rend() _NOEXCEPT
- ; 1016 : { // return iterator for end of reversed mutable sequence
- ; 1017 : return (reverse_iterator(begin()));
- ; 1018 : }
- ; 1019 :
- ; 1020 : const_reverse_iterator rend() const _NOEXCEPT
- ; 1021 : { // return iterator for end of reversed nonmutable sequence
- ; 1022 : return (const_reverse_iterator(begin()));
- ; 1023 : }
- ; 1024 :
- ; 1025 : #if _HAS_CPP0X
- ; 1026 : const_iterator cbegin() const _NOEXCEPT
- ; 1027 : { // return iterator for beginning of nonmutable sequence
- ; 1028 : return (((const _Myt *)this)->begin());
- ; 1029 : }
- ; 1030 :
- ; 1031 : const_iterator cend() const _NOEXCEPT
- ; 1032 : { // return iterator for end of nonmutable sequence
- ; 1033 : return (((const _Myt *)this)->end());
- ; 1034 : }
- ; 1035 :
- ; 1036 : const_reverse_iterator crbegin() const _NOEXCEPT
- ; 1037 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1038 : return (((const _Myt *)this)->rbegin());
- ; 1039 : }
- ; 1040 :
- ; 1041 : const_reverse_iterator crend() const _NOEXCEPT
- ; 1042 : { // return iterator for end of reversed nonmutable sequence
- ; 1043 : return (((const _Myt *)this)->rend());
- ; 1044 : }
- ; 1045 :
- ; 1046 : void shrink_to_fit()
- ; 1047 : { // reduce capacity
- ; 1048 : if (_Has_unused_capacity())
- ; 1049 : { // worth shrinking, do it
- ; 1050 : if (empty())
- ; 1051 : _Tidy();
- ; 1052 : else
- ; 1053 : _Reallocate(size());
- ; 1054 : }
- ; 1055 : }
- ; 1056 : #endif /* _HAS_CPP0X */
- ; 1057 :
- ; 1058 : void resize(size_type _Newsize)
- ; 1059 : { // determine new length, padding as needed
- ; 1060 : if (_Newsize < size())
- ; 1061 : erase(begin() + _Newsize, end());
- ; 1062 : else if (size() < _Newsize)
- ; 1063 : { // pad as needed
- ; 1064 : _Alty _Alval(this->_Getal());
- ; 1065 : _Reserve(_Newsize - size());
- ; 1066 : _TRY_BEGIN
- ; 1067 : _Uninitialized_default_fill_n(this->_Mylast, _Newsize - size(),
- ; 1068 : _Alval);
- ; 1069 : _CATCH_ALL
- ; 1070 : _Tidy();
- ; 1071 : _RERAISE;
- ; 1072 : _CATCH_END
- ; 1073 : this->_Mylast += _Newsize - size();
- ; 1074 : }
- ; 1075 : }
- ; 1076 :
- ; 1077 : void resize(size_type _Newsize, const value_type& _Val)
- ; 1078 : { // determine new length, padding with _Val elements as needed
- ; 1079 : if (_Newsize < size())
- ; 1080 : erase(begin() + _Newsize, end());
- ; 1081 : else if (size() < _Newsize)
- ; 1082 : _Insert_n(end(), _Newsize - size(), _Val);
- ; 1083 : }
- ; 1084 :
- ; 1085 : size_type size() const _NOEXCEPT
- ; 1086 : { // return length of sequence
- ; 1087 : return (this->_Mylast - this->_Myfirst);
- sub esi, DWORD PTR [ecx]
- push ebx
- ; 1527 : { // need more room, try to get it
- ; 1528 : if (max_size() - size() < _Count)
- mov ebx, 536870911 ; 1fffffffH
- ; 973 : }
- ; 974 :
- ; 975 : size_type _Has_unused_capacity() const _NOEXCEPT
- ; 976 : { // micro-optimization for capacity() != size()
- ; 977 : return (this->_Myend != this->_Mylast);
- ; 978 : }
- ; 979 :
- ; 980 : iterator begin() _NOEXCEPT
- ; 981 : { // return iterator for beginning of mutable sequence
- ; 982 : return (iterator(this->_Myfirst, this));
- ; 983 : }
- ; 984 :
- ; 985 : const_iterator begin() const _NOEXCEPT
- ; 986 : { // return iterator for beginning of nonmutable sequence
- ; 987 : return (const_iterator(this->_Myfirst, this));
- ; 988 : }
- ; 989 :
- ; 990 : iterator end() _NOEXCEPT
- ; 991 : { // return iterator for end of mutable sequence
- ; 992 : return (iterator(this->_Mylast, this));
- ; 993 : }
- ; 994 :
- ; 995 : const_iterator end() const _NOEXCEPT
- ; 996 : { // return iterator for end of nonmutable sequence
- ; 997 : return (const_iterator(this->_Mylast, this));
- ; 998 : }
- ; 999 :
- ; 1000 : iterator _Make_iter(const_iterator _Where) const
- ; 1001 : { // make iterator from const_iterator
- ; 1002 : return (iterator(_Where._Ptr, this));
- ; 1003 : }
- ; 1004 :
- ; 1005 : reverse_iterator rbegin() _NOEXCEPT
- ; 1006 : { // return iterator for beginning of reversed mutable sequence
- ; 1007 : return (reverse_iterator(end()));
- ; 1008 : }
- ; 1009 :
- ; 1010 : const_reverse_iterator rbegin() const _NOEXCEPT
- ; 1011 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1012 : return (const_reverse_iterator(end()));
- ; 1013 : }
- ; 1014 :
- ; 1015 : reverse_iterator rend() _NOEXCEPT
- ; 1016 : { // return iterator for end of reversed mutable sequence
- ; 1017 : return (reverse_iterator(begin()));
- ; 1018 : }
- ; 1019 :
- ; 1020 : const_reverse_iterator rend() const _NOEXCEPT
- ; 1021 : { // return iterator for end of reversed nonmutable sequence
- ; 1022 : return (const_reverse_iterator(begin()));
- ; 1023 : }
- ; 1024 :
- ; 1025 : #if _HAS_CPP0X
- ; 1026 : const_iterator cbegin() const _NOEXCEPT
- ; 1027 : { // return iterator for beginning of nonmutable sequence
- ; 1028 : return (((const _Myt *)this)->begin());
- ; 1029 : }
- ; 1030 :
- ; 1031 : const_iterator cend() const _NOEXCEPT
- ; 1032 : { // return iterator for end of nonmutable sequence
- ; 1033 : return (((const _Myt *)this)->end());
- ; 1034 : }
- ; 1035 :
- ; 1036 : const_reverse_iterator crbegin() const _NOEXCEPT
- ; 1037 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1038 : return (((const _Myt *)this)->rbegin());
- ; 1039 : }
- ; 1040 :
- ; 1041 : const_reverse_iterator crend() const _NOEXCEPT
- ; 1042 : { // return iterator for end of reversed nonmutable sequence
- ; 1043 : return (((const _Myt *)this)->rend());
- ; 1044 : }
- ; 1045 :
- ; 1046 : void shrink_to_fit()
- ; 1047 : { // reduce capacity
- ; 1048 : if (_Has_unused_capacity())
- ; 1049 : { // worth shrinking, do it
- ; 1050 : if (empty())
- ; 1051 : _Tidy();
- ; 1052 : else
- ; 1053 : _Reallocate(size());
- ; 1054 : }
- ; 1055 : }
- ; 1056 : #endif /* _HAS_CPP0X */
- ; 1057 :
- ; 1058 : void resize(size_type _Newsize)
- ; 1059 : { // determine new length, padding as needed
- ; 1060 : if (_Newsize < size())
- ; 1061 : erase(begin() + _Newsize, end());
- ; 1062 : else if (size() < _Newsize)
- ; 1063 : { // pad as needed
- ; 1064 : _Alty _Alval(this->_Getal());
- ; 1065 : _Reserve(_Newsize - size());
- ; 1066 : _TRY_BEGIN
- ; 1067 : _Uninitialized_default_fill_n(this->_Mylast, _Newsize - size(),
- ; 1068 : _Alval);
- ; 1069 : _CATCH_ALL
- ; 1070 : _Tidy();
- ; 1071 : _RERAISE;
- ; 1072 : _CATCH_END
- ; 1073 : this->_Mylast += _Newsize - size();
- ; 1074 : }
- ; 1075 : }
- ; 1076 :
- ; 1077 : void resize(size_type _Newsize, const value_type& _Val)
- ; 1078 : { // determine new length, padding with _Val elements as needed
- ; 1079 : if (_Newsize < size())
- ; 1080 : erase(begin() + _Newsize, end());
- ; 1081 : else if (size() < _Newsize)
- ; 1082 : _Insert_n(end(), _Newsize - size(), _Val);
- ; 1083 : }
- ; 1084 :
- ; 1085 : size_type size() const _NOEXCEPT
- ; 1086 : { // return length of sequence
- ; 1087 : return (this->_Mylast - this->_Myfirst);
- sar esi, 3
- ; 1527 : { // need more room, try to get it
- ; 1528 : if (max_size() - size() < _Count)
- mov eax, ebx
- sub eax, esi
- cmp eax, edi
- jae SHORT $LN1@Reserve
- ; 1533 :
- ; 1534 : void _Tidy()
- ; 1535 : { // free all storage
- ; 1536 : if (this->_Myfirst != pointer())
- ; 1537 : { // something to free, destroy and deallocate it
- ; 1538 : this->_Orphan_all();
- ; 1539 : _Destroy(this->_Myfirst, this->_Mylast);
- ; 1540 : this->_Getal().deallocate(this->_Myfirst,
- ; 1541 : this->_Myend - this->_Myfirst);
- ; 1542 : this->_Myfirst = pointer();
- ; 1543 : this->_Mylast = pointer();
- ; 1544 : this->_Myend = pointer();
- ; 1545 : }
- ; 1546 : }
- ; 1547 :
- ; 1548 : template<class _Iter>
- ; 1549 : pointer _Ucopy(_Iter _First, _Iter _Last, pointer _Ptr)
- ; 1550 : { // copy initializing [_First, _Last), using allocator
- ; 1551 : _Alty _Alval(this->_Getal());
- ; 1552 : return (_Uninitialized_copy(_First, _Last,
- ; 1553 : _Ptr, _Alval));
- ; 1554 : }
- ; 1555 :
- ; 1556 : template<class _Iter>
- ; 1557 : pointer _Umove(_Iter _First, _Iter _Last, pointer _Ptr)
- ; 1558 : { // move initializing [_First, _Last), using allocator
- ; 1559 : _Alty _Alval(this->_Getal());
- ; 1560 : return (_Uninitialized_move(_First, _Last,
- ; 1561 : _Ptr, _Alval));
- ; 1562 : }
- ; 1563 :
- ; 1564 : iterator _Insert_n(const_iterator _Where,
- ; 1565 : size_type _Count, const value_type& _Val)
- ; 1566 : { // insert _Count * _Val at _Where
- ; 1567 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1568 : if (_VICONT(_Where) != this
- ; 1569 : || _VIPTR(_Where) < this->_Myfirst
- ; 1570 : || this->_Mylast < _VIPTR(_Where))
- ; 1571 : _DEBUG_ERROR("vector insert iterator outside range");
- ; 1572 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1573 :
- ; 1574 : size_type _Off = _VIPTR(_Where) - this->_Myfirst;
- ; 1575 : if (_Count == 0)
- ; 1576 : ;
- ; 1577 : else if (_Unused_capacity() < _Count)
- ; 1578 : { // not enough room, reallocate
- ; 1579 : if (max_size() - size() < _Count)
- ; 1580 : _Xlen(); // result too long
- ; 1581 :
- ; 1582 : size_type _Capacity = _Grow_to(size() + _Count);
- ; 1583 : pointer _Newvec = this->_Getal().allocate(_Capacity);
- ; 1584 : size_type _Whereoff = _VIPTR(_Where) - this->_Myfirst;
- ; 1585 : int _Ncopied = 0;
- ; 1586 :
- ; 1587 : _TRY_BEGIN
- ; 1588 : _Ufill(_Newvec + _Whereoff, _Count,
- ; 1589 : _STD addressof(_Val)); // add new stuff
- ; 1590 : ++_Ncopied;
- ; 1591 : _Umove(this->_Myfirst, _VIPTR(_Where),
- ; 1592 : _Newvec); // copy prefix
- ; 1593 : ++_Ncopied;
- ; 1594 : _Umove(_VIPTR(_Where), this->_Mylast,
- ; 1595 : _Newvec + (_Whereoff + _Count)); // copy suffix
- ; 1596 : _CATCH_ALL
- ; 1597 : if (1 < _Ncopied)
- ; 1598 : _Destroy(_Newvec, _Newvec + _Whereoff);
- ; 1599 : if (0 < _Ncopied)
- ; 1600 : _Destroy(_Newvec + _Whereoff, _Newvec + _Whereoff + _Count);
- ; 1601 : this->_Getal().deallocate(_Newvec, _Capacity);
- ; 1602 : _RERAISE;
- ; 1603 : _CATCH_END
- ; 1604 :
- ; 1605 : _Count += size();
- ; 1606 : if (this->_Myfirst != pointer())
- ; 1607 : { // destroy and deallocate old array
- ; 1608 : _Destroy(this->_Myfirst, this->_Mylast);
- ; 1609 : this->_Getal().deallocate(this->_Myfirst,
- ; 1610 : this->_Myend - this->_Myfirst);
- ; 1611 : }
- ; 1612 :
- ; 1613 : this->_Orphan_all();
- ; 1614 : this->_Myend = _Newvec + _Capacity;
- ; 1615 : this->_Mylast = _Newvec + _Count;
- ; 1616 : this->_Myfirst = _Newvec;
- ; 1617 : }
- ; 1618 : else if ((size_type)(this->_Mylast - _VIPTR(_Where))
- ; 1619 : < _Count)
- ; 1620 : { // new stuff spills off end
- ; 1621 : value_type _Tmp = _Val; // in case _Val is in sequence
- ; 1622 :
- ; 1623 : _Umove(_VIPTR(_Where), this->_Mylast,
- ; 1624 : _VIPTR(_Where) + _Count); // copy suffix
- ; 1625 :
- ; 1626 : _TRY_BEGIN
- ; 1627 : _Ufill(this->_Mylast,
- ; 1628 : _Count - (this->_Mylast - _VIPTR(_Where)),
- ; 1629 : _STD addressof(_Tmp)); // insert new stuff off end
- ; 1630 : _CATCH_ALL
- ; 1631 : _Destroy(_VIPTR(_Where) + _Count,
- ; 1632 : this->_Mylast + _Count);
- ; 1633 : _RERAISE;
- ; 1634 : _CATCH_END
- ; 1635 :
- ; 1636 : this->_Mylast += _Count;
- ; 1637 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
- ; 1638 : _STD fill(_VIPTR(_Where), this->_Mylast - _Count,
- ; 1639 : _Tmp); // insert up to old end
- ; 1640 : }
- ; 1641 : else
- ; 1642 : { // new stuff can all be assigned
- ; 1643 : value_type _Tmp = _Val; // in case _Val is in sequence
- ; 1644 :
- ; 1645 : pointer _Oldend = this->_Mylast;
- ; 1646 : this->_Mylast = _Umove(_Oldend - _Count, _Oldend,
- ; 1647 : this->_Mylast); // copy suffix
- ; 1648 :
- ; 1649 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
- ; 1650 : _Copy_backward(_VIPTR(_Where), _Oldend - _Count,
- ; 1651 : _Oldend); // copy hole
- ; 1652 : _STD fill(_VIPTR(_Where),
- ; 1653 : _VIPTR(_Where) + _Count, _Tmp); // insert into hole
- ; 1654 : }
- ; 1655 : return (begin() + _Off);
- ; 1656 : }
- ; 1657 :
- ; 1658 : pointer _Ufill(pointer _Ptr, size_type _Count, const value_type *_Pval)
- ; 1659 : { // copy initializing _Count * _Val, using allocator
- ; 1660 : _Alty _Alval(this->_Getal());
- ; 1661 : _Uninitialized_fill_n(_Ptr, _Count, _Pval, _Alval);
- ; 1662 : return (_Ptr + _Count);
- ; 1663 : }
- ; 1664 :
- ; 1665 : __declspec(noreturn) void _Xlen() const
- ; 1666 : { // report a length_error
- ; 1667 : _Xlength_error("vector<T> too long");
- push OFFSET ??_C@_0BD@OLBABOEK@vector?$DMT?$DO?5too?5long?$AA@
- call DWORD PTR __imp_?_Xlength_error@std@@YAXPBD@Z
- $LN44@Reserve:
- $LN1@Reserve:
- ; 967 : return (this->_Myend - this->_Myfirst);
- sub edx, DWORD PTR [ecx]
- ; 1529 : _Xlen();
- ; 1530 : _Reallocate(_Grow_to(size() + _Count));
- add esi, edi
- ; 967 : return (this->_Myend - this->_Myfirst);
- sar edx, 3
- ; 1088 : }
- ; 1089 :
- ; 1090 : size_type max_size() const _NOEXCEPT
- ; 1091 : { // return maximum possible length of sequence
- ; 1092 : return (this->_Getal().max_size());
- ; 1093 : }
- ; 1094 :
- ; 1095 : bool empty() const _NOEXCEPT
- ; 1096 : { // test if sequence is empty
- ; 1097 : return (this->_Myfirst == this->_Mylast);
- ; 1098 : }
- ; 1099 :
- ; 1100 : _Alloc get_allocator() const _NOEXCEPT
- ; 1101 : { // return allocator object for values
- ; 1102 : return (this->_Getal());
- ; 1103 : }
- ; 1104 :
- ; 1105 : const_reference at(size_type _Pos) const
- ; 1106 : { // subscript nonmutable sequence with checking
- ; 1107 : if (size() <= _Pos)
- ; 1108 : _Xran();
- ; 1109 : return (*(this->_Myfirst + _Pos));
- ; 1110 : }
- ; 1111 :
- ; 1112 : reference at(size_type _Pos)
- ; 1113 : { // subscript mutable sequence with checking
- ; 1114 : if (size() <= _Pos)
- ; 1115 : _Xran();
- ; 1116 : return (*(this->_Myfirst + _Pos));
- ; 1117 : }
- ; 1118 :
- ; 1119 : const_reference operator[](size_type _Pos) const
- ; 1120 : { // subscript nonmutable sequence
- ; 1121 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1122 : if (size() <= _Pos)
- ; 1123 : { // report error
- ; 1124 : _DEBUG_ERROR("vector subscript out of range");
- ; 1125 : _SCL_SECURE_OUT_OF_RANGE;
- ; 1126 : }
- ; 1127 :
- ; 1128 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1129 : _SCL_SECURE_VALIDATE_RANGE(_Pos < size());
- ; 1130 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 1131 :
- ; 1132 : return (*(this->_Myfirst + _Pos));
- ; 1133 : }
- ; 1134 :
- ; 1135 : reference operator[](size_type _Pos)
- ; 1136 : { // subscript mutable sequence
- ; 1137 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1138 : if (size() <= _Pos)
- ; 1139 : { // report error
- ; 1140 : _DEBUG_ERROR("vector subscript out of range");
- ; 1141 : _SCL_SECURE_OUT_OF_RANGE;
- ; 1142 : }
- ; 1143 :
- ; 1144 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1145 : _SCL_SECURE_VALIDATE_RANGE(_Pos < size());
- ; 1146 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 1147 :
- ; 1148 : return (*(this->_Myfirst + _Pos));
- ; 1149 : }
- ; 1150 :
- ; 1151 : #if _HAS_CPP0X
- ; 1152 : pointer data() _NOEXCEPT
- ; 1153 : { // return address of first element
- ; 1154 : return (this->_Myfirst);
- ; 1155 : }
- ; 1156 :
- ; 1157 : const_pointer data() const _NOEXCEPT
- ; 1158 : { // return address of first element
- ; 1159 : return (this->_Myfirst);
- ; 1160 : }
- ; 1161 : #endif /* _HAS_CPP0X */
- ; 1162 :
- ; 1163 : reference front()
- ; 1164 : { // return first element of mutable sequence
- ; 1165 : return (*begin());
- ; 1166 : }
- ; 1167 :
- ; 1168 : const_reference front() const
- ; 1169 : { // return first element of nonmutable sequence
- ; 1170 : return (*begin());
- ; 1171 : }
- ; 1172 :
- ; 1173 : reference back()
- ; 1174 : { // return last element of mutable sequence
- ; 1175 : return (*(end() - 1));
- ; 1176 : }
- ; 1177 :
- ; 1178 : const_reference back() const
- ; 1179 : { // return last element of nonmutable sequence
- ; 1180 : return (*(end() - 1));
- ; 1181 : }
- ; 1182 :
- ; 1183 : void push_back(const value_type& _Val)
- ; 1184 : { // insert element at end
- ; 1185 : if (_Inside(_STD addressof(_Val)))
- ; 1186 : { // push back an element
- ; 1187 : size_type _Idx = _STD addressof(_Val) - this->_Myfirst;
- ; 1188 : if (this->_Mylast == this->_Myend)
- ; 1189 : _Reserve(1);
- ; 1190 : _Orphan_range(this->_Mylast, this->_Mylast);
- ; 1191 : this->_Getal().construct(this->_Mylast,
- ; 1192 : this->_Myfirst[_Idx]);
- ; 1193 : ++this->_Mylast;
- ; 1194 : }
- ; 1195 : else
- ; 1196 : { // push back a non-element
- ; 1197 : if (this->_Mylast == this->_Myend)
- ; 1198 : _Reserve(1);
- ; 1199 : _Orphan_range(this->_Mylast, this->_Mylast);
- ; 1200 : this->_Getal().construct(this->_Mylast,
- ; 1201 : _Val);
- ; 1202 : ++this->_Mylast;
- ; 1203 : }
- ; 1204 : }
- ; 1205 :
- ; 1206 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1207 : void pop_back()
- ; 1208 : { // erase element at end
- ; 1209 : if (empty())
- ; 1210 : _DEBUG_ERROR("vector empty before pop");
- ; 1211 : else
- ; 1212 : { // erase last element
- ; 1213 : _Orphan_range(this->_Mylast - 1, this->_Mylast);
- ; 1214 : this->_Getal().destroy(this->_Mylast - 1);
- ; 1215 : --this->_Mylast;
- ; 1216 : }
- ; 1217 : }
- ; 1218 :
- ; 1219 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1220 : void pop_back()
- ; 1221 : { // erase element at end
- ; 1222 : if (!empty())
- ; 1223 : { // erase last element
- ; 1224 : this->_Getal().destroy(this->_Mylast - 1);
- ; 1225 : --this->_Mylast;
- ; 1226 : }
- ; 1227 : }
- ; 1228 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1229 :
- ; 1230 : template<class _Iter>
- ; 1231 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1232 : void>::type
- ; 1233 : assign(_Iter _First, _Iter _Last)
- ; 1234 : { // assign [_First, _Last), input iterators
- ; 1235 : erase(begin(), end());
- ; 1236 : insert(begin(), _First, _Last);
- ; 1237 : }
- ; 1238 :
- ; 1239 : void assign(size_type _Count, const value_type& _Val)
- ; 1240 : { // assign _Count * _Val
- ; 1241 : _Assign_n(_Count, _Val);
- ; 1242 : }
- ; 1243 :
- ; 1244 : iterator insert(const_iterator _Where, const _Ty& _Val)
- ; 1245 : { // insert _Val at _Where
- ; 1246 : return (_Insert_n(_Where, (size_type)1, _Val));
- ; 1247 : }
- ; 1248 :
- ; 1249 : iterator insert(const_iterator _Where, size_type _Count,
- ; 1250 : const _Ty& _Val)
- ; 1251 : { // insert _Count * _Val at _Where
- ; 1252 : return (_Insert_n(_Where, _Count, _Val));
- ; 1253 : }
- ; 1254 :
- ; 1255 : template<class _Iter>
- ; 1256 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1257 : iterator>::type
- ; 1258 : insert(const_iterator _Where, _Iter _First, _Iter _Last)
- ; 1259 : { // insert [_First, _Last) at _Where
- ; 1260 : size_type _Off = _VIPTR(_Where) - this->_Myfirst;
- ; 1261 : _Insert(_Where, _First, _Last, _Iter_cat(_First));
- ; 1262 : return (begin() + _Off);
- ; 1263 : }
- ; 1264 :
- ; 1265 : template<class _Iter>
- ; 1266 : void _Insert(const_iterator _Where, _Iter _First, _Iter _Last,
- ; 1267 : input_iterator_tag)
- ; 1268 : { // insert [_First, _Last) at _Where, input iterators
- ; 1269 : size_type _Off = _VIPTR(_Where) - this->_Myfirst;
- ; 1270 :
- ; 1271 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1272 : if (size() < _Off)
- ; 1273 : _DEBUG_ERROR("vector insert iterator outside range");
- ; 1274 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1275 :
- ; 1276 : if (_First != _Last)
- ; 1277 : { // worth doing, gather at end and rotate into place
- ; 1278 : size_type _Oldsize = size();
- ; 1279 :
- ; 1280 : _TRY_BEGIN
- ; 1281 : for (; _First != _Last; ++_First)
- ; 1282 : push_back(*_First); // append
- ; 1283 :
- ; 1284 : _CATCH_ALL
- ; 1285 : erase(begin() + _Oldsize, end());
- ; 1286 : _RERAISE;
- ; 1287 : _CATCH_END
- ; 1288 :
- ; 1289 : _STD rotate(begin() + _Off, begin() + _Oldsize, end());
- ; 1290 : }
- ; 1291 : }
- ; 1292 :
- ; 1293 : template<class _Iter>
- ; 1294 : void _Insert(const_iterator _Where, _Iter _First, _Iter _Last,
- ; 1295 : forward_iterator_tag)
- ; 1296 : { // insert [_First, _Last) at _Where, forward iterators
- ; 1297 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1298 : if (_VICONT(_Where) != this
- ; 1299 : || _VIPTR(_Where) < this->_Myfirst
- ; 1300 : || this->_Mylast < _VIPTR(_Where))
- ; 1301 : _DEBUG_ERROR("vector insert iterator outside range");
- ; 1302 : _DEBUG_RANGE(_First, _Last);
- ; 1303 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1304 :
- ; 1305 : size_type _Count = 0;
- ; 1306 : _Distance(_First, _Last, _Count);
- ; 1307 :
- ; 1308 : if (_Count == 0)
- ; 1309 : ;
- ; 1310 : else if (_Unused_capacity() < _Count)
- ; 1311 : { // not enough room, reallocate
- ; 1312 : if (max_size() - size() < _Count)
- ; 1313 : _Xlen(); // result too long
- ; 1314 :
- ; 1315 : size_type _Capacity = _Grow_to(size() + _Count);
- ; 1316 : pointer _Newvec = this->_Getal().allocate(_Capacity);
- ; 1317 : pointer _Ptr = _Newvec;
- ; 1318 :
- ; 1319 : _TRY_BEGIN
- ; 1320 : _Ptr = _Umove(this->_Myfirst, _VIPTR(_Where),
- ; 1321 : _Newvec); // copy prefix
- ; 1322 : _Ptr = _Ucopy(_First, _Last, _Ptr); // add new stuff
- ; 1323 : _Umove(_VIPTR(_Where), this->_Mylast,
- ; 1324 : _Ptr); // copy suffix
- ; 1325 : _CATCH_ALL
- ; 1326 : _Destroy(_Newvec, _Ptr);
- ; 1327 : this->_Getal().deallocate(_Newvec, _Capacity);
- ; 1328 : _RERAISE;
- ; 1329 : _CATCH_END
- ; 1330 :
- ; 1331 : _Count += size();
- ; 1332 : if (this->_Myfirst != pointer())
- ; 1333 : { // destroy and deallocate old array
- ; 1334 : _Destroy(this->_Myfirst, this->_Mylast);
- ; 1335 : this->_Getal().deallocate(this->_Myfirst,
- ; 1336 : this->_Myend - this->_Myfirst);
- ; 1337 : }
- ; 1338 :
- ; 1339 : this->_Orphan_all();
- ; 1340 : this->_Myend = _Newvec + _Capacity;
- ; 1341 : this->_Mylast = _Newvec + _Count;
- ; 1342 : this->_Myfirst = _Newvec;
- ; 1343 : }
- ; 1344 : else
- ; 1345 : { // new stuff fits, append and rotate into place
- ; 1346 : _Ucopy(_First, _Last, this->_Mylast);
- ; 1347 : _STD rotate(_VIPTR(_Where), this->_Mylast,
- ; 1348 : this->_Mylast + _Count);
- ; 1349 : this->_Mylast += _Count;
- ; 1350 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
- ; 1351 : }
- ; 1352 : }
- ; 1353 :
- ; 1354 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1355 : iterator erase(const_iterator _Where)
- ; 1356 : { // erase element at where
- ; 1357 : if (_VICONT(_Where) != this
- ; 1358 : || _VIPTR(_Where) < this->_Myfirst
- ; 1359 : || this->_Mylast <= _VIPTR(_Where))
- ; 1360 : _DEBUG_ERROR("vector erase iterator outside range");
- ; 1361 : _Move(_VIPTR(_Where) + 1, this->_Mylast, _VIPTR(_Where));
- ; 1362 : _Destroy(this->_Mylast - 1, this->_Mylast);
- ; 1363 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
- ; 1364 : --this->_Mylast;
- ; 1365 : return (_Make_iter(_Where));
- ; 1366 : }
- ; 1367 :
- ; 1368 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1369 : iterator erase(const_iterator _Where)
- ; 1370 : { // erase element at where
- ; 1371 : _Move(_VIPTR(_Where) + 1, this->_Mylast,
- ; 1372 : _VIPTR(_Where));
- ; 1373 : _Destroy(this->_Mylast - 1, this->_Mylast);
- ; 1374 : --this->_Mylast;
- ; 1375 : return (_Make_iter(_Where));
- ; 1376 : }
- ; 1377 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1378 :
- ; 1379 : iterator erase(const_iterator _First_arg,
- ; 1380 : const_iterator _Last_arg)
- ; 1381 : { // erase [_First, _Last)
- ; 1382 : if (_First_arg == begin() && _Last_arg == end())
- ; 1383 : clear();
- ; 1384 : else if (_First_arg != _Last_arg)
- ; 1385 : { // clear partial
- ; 1386 : iterator _First = _Make_iter(_First_arg);
- ; 1387 : iterator _Last = _Make_iter(_Last_arg);
- ; 1388 :
- ; 1389 : if (_First != _Last)
- ; 1390 : { // worth doing, copy down over hole
- ; 1391 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1392 : if (_Last < _First || _VICONT(_First) != this
- ; 1393 : || _VIPTR(_First) < this->_Myfirst
- ; 1394 : || this->_Mylast < _VIPTR(_Last))
- ; 1395 : _DEBUG_ERROR("vector erase iterator outside range");
- ; 1396 : pointer _Ptr = _Move(_VIPTR(_Last), this->_Mylast,
- ; 1397 : _VIPTR(_First));
- ; 1398 : _Orphan_range(_VIPTR(_First), this->_Mylast);
- ; 1399 :
- ; 1400 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1401 : pointer _Ptr = _Move(_VIPTR(_Last), this->_Mylast,
- ; 1402 : _VIPTR(_First));
- ; 1403 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1404 :
- ; 1405 : _Destroy(_Ptr, this->_Mylast);
- ; 1406 : this->_Mylast = _Ptr;
- ; 1407 : }
- ; 1408 : }
- ; 1409 : return (_Make_iter(_First_arg));
- ; 1410 : }
- ; 1411 :
- ; 1412 : void clear() _NOEXCEPT
- ; 1413 : { // erase all
- ; 1414 : this->_Orphan_all();
- ; 1415 : _Destroy(this->_Myfirst, this->_Mylast);
- ; 1416 : this->_Mylast = this->_Myfirst;
- ; 1417 : }
- ; 1418 :
- ; 1419 : void swap(_Myt& _Right)
- ; 1420 : { // exchange contents with _Right
- ; 1421 : if (this == &_Right)
- ; 1422 : ; // same object, do nothing
- ; 1423 : else if (this->_Getal() == _Right._Getal())
- ; 1424 : { // same allocator, swap control information
- ; 1425 : this->_Swap_all(_Right);
- ; 1426 : _Swap_adl(this->_Myfirst, _Right._Myfirst);
- ; 1427 : _Swap_adl(this->_Mylast, _Right._Mylast);
- ; 1428 : _Swap_adl(this->_Myend, _Right._Myend);
- ; 1429 : }
- ; 1430 :
- ; 1431 : #if _HAS_CPP0X
- ; 1432 : else if (_Alty::propagate_on_container_swap::value)
- ; 1433 : { // swap allocators and control information
- ; 1434 : this->_Swap_alloc(_Right);
- ; 1435 : _Swap_adl(this->_Myfirst, _Right._Myfirst);
- ; 1436 : _Swap_adl(this->_Mylast, _Right._Mylast);
- ; 1437 : _Swap_adl(this->_Myend, _Right._Myend);
- ; 1438 : }
- ; 1439 : #endif /* _HAS_CPP0X */
- ; 1440 :
- ; 1441 : else
- ; 1442 : { // different allocator, do multiple moves
- ; 1443 : _Myt _Ts = _Move(*this);
- ; 1444 :
- ; 1445 : *this = _Move(_Right);
- ; 1446 : _Right = _Move(_Ts);
- ; 1447 : }
- ; 1448 : }
- ; 1449 :
- ; 1450 : protected:
- ; 1451 : void _Assign_n(size_type _Count, const value_type& _Val)
- ; 1452 : { // assign _Count * _Val
- ; 1453 : value_type _Tmp = _Val; // in case _Val is in sequence
- ; 1454 : erase(begin(), end());
- ; 1455 : insert(begin(), _Count, _Tmp);
- ; 1456 : }
- ; 1457 :
- ; 1458 : bool _Buy(size_type _Capacity)
- ; 1459 : { // allocate array with _Capacity elements
- ; 1460 : this->_Myfirst = pointer();
- ; 1461 : this->_Mylast = pointer();
- ; 1462 : this->_Myend = pointer();
- ; 1463 :
- ; 1464 : if (_Capacity == 0)
- ; 1465 : return (false);
- ; 1466 : else if (max_size() < _Capacity)
- ; 1467 : _Xlen(); // result too long
- ; 1468 : else
- ; 1469 : { // nonempty array, allocate storage
- ; 1470 : this->_Myfirst = this->_Getal().allocate(_Capacity);
- ; 1471 : this->_Mylast = this->_Myfirst;
- ; 1472 : this->_Myend = this->_Myfirst + _Capacity;
- ; 1473 : }
- ; 1474 : return (true);
- ; 1475 : }
- ; 1476 :
- ; 1477 : void _Destroy(pointer _First, pointer _Last)
- ; 1478 : { // destroy [_First, _Last) using allocator
- ; 1479 : _Alty _Alval(this->_Getal());
- ; 1480 : _Destroy_range(_First, _Last, _Alval);
- ; 1481 : }
- ; 1482 :
- ; 1483 : size_type _Grow_to(size_type _Count) const
- ; 1484 : { // grow by 50% or at least to _Count
- ; 1485 : size_type _Capacity = capacity();
- ; 1486 :
- ; 1487 : _Capacity = max_size() - _Capacity / 2 < _Capacity
- ; 1488 : ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
- mov eax, edx
- shr eax, 1
- sub ebx, eax
- cmp ebx, edx
- pop ebx
- jae SHORT $LN27@Reserve
- xor edx, edx
- ; 1489 : if (_Capacity < _Count)
- cmp edx, esi
- pop edi
- cmovb edx, esi
- pop esi
- ; 1529 : _Xlen();
- ; 1530 : _Reallocate(_Grow_to(size() + _Count));
- mov DWORD PTR __Count$[ebp], edx
- ; 1531 : }
- ; 1532 : }
- pop ebp
- ; 1529 : _Xlen();
- ; 1530 : _Reallocate(_Grow_to(size() + _Count));
- jmp ?_Reallocate@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z ; std::vector<double,std::allocator<double> >::_Reallocate
- $LN27@Reserve:
- ; 1088 : }
- ; 1089 :
- ; 1090 : size_type max_size() const _NOEXCEPT
- ; 1091 : { // return maximum possible length of sequence
- ; 1092 : return (this->_Getal().max_size());
- ; 1093 : }
- ; 1094 :
- ; 1095 : bool empty() const _NOEXCEPT
- ; 1096 : { // test if sequence is empty
- ; 1097 : return (this->_Myfirst == this->_Mylast);
- ; 1098 : }
- ; 1099 :
- ; 1100 : _Alloc get_allocator() const _NOEXCEPT
- ; 1101 : { // return allocator object for values
- ; 1102 : return (this->_Getal());
- ; 1103 : }
- ; 1104 :
- ; 1105 : const_reference at(size_type _Pos) const
- ; 1106 : { // subscript nonmutable sequence with checking
- ; 1107 : if (size() <= _Pos)
- ; 1108 : _Xran();
- ; 1109 : return (*(this->_Myfirst + _Pos));
- ; 1110 : }
- ; 1111 :
- ; 1112 : reference at(size_type _Pos)
- ; 1113 : { // subscript mutable sequence with checking
- ; 1114 : if (size() <= _Pos)
- ; 1115 : _Xran();
- ; 1116 : return (*(this->_Myfirst + _Pos));
- ; 1117 : }
- ; 1118 :
- ; 1119 : const_reference operator[](size_type _Pos) const
- ; 1120 : { // subscript nonmutable sequence
- ; 1121 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1122 : if (size() <= _Pos)
- ; 1123 : { // report error
- ; 1124 : _DEBUG_ERROR("vector subscript out of range");
- ; 1125 : _SCL_SECURE_OUT_OF_RANGE;
- ; 1126 : }
- ; 1127 :
- ; 1128 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1129 : _SCL_SECURE_VALIDATE_RANGE(_Pos < size());
- ; 1130 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 1131 :
- ; 1132 : return (*(this->_Myfirst + _Pos));
- ; 1133 : }
- ; 1134 :
- ; 1135 : reference operator[](size_type _Pos)
- ; 1136 : { // subscript mutable sequence
- ; 1137 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1138 : if (size() <= _Pos)
- ; 1139 : { // report error
- ; 1140 : _DEBUG_ERROR("vector subscript out of range");
- ; 1141 : _SCL_SECURE_OUT_OF_RANGE;
- ; 1142 : }
- ; 1143 :
- ; 1144 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1145 : _SCL_SECURE_VALIDATE_RANGE(_Pos < size());
- ; 1146 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 1147 :
- ; 1148 : return (*(this->_Myfirst + _Pos));
- ; 1149 : }
- ; 1150 :
- ; 1151 : #if _HAS_CPP0X
- ; 1152 : pointer data() _NOEXCEPT
- ; 1153 : { // return address of first element
- ; 1154 : return (this->_Myfirst);
- ; 1155 : }
- ; 1156 :
- ; 1157 : const_pointer data() const _NOEXCEPT
- ; 1158 : { // return address of first element
- ; 1159 : return (this->_Myfirst);
- ; 1160 : }
- ; 1161 : #endif /* _HAS_CPP0X */
- ; 1162 :
- ; 1163 : reference front()
- ; 1164 : { // return first element of mutable sequence
- ; 1165 : return (*begin());
- ; 1166 : }
- ; 1167 :
- ; 1168 : const_reference front() const
- ; 1169 : { // return first element of nonmutable sequence
- ; 1170 : return (*begin());
- ; 1171 : }
- ; 1172 :
- ; 1173 : reference back()
- ; 1174 : { // return last element of mutable sequence
- ; 1175 : return (*(end() - 1));
- ; 1176 : }
- ; 1177 :
- ; 1178 : const_reference back() const
- ; 1179 : { // return last element of nonmutable sequence
- ; 1180 : return (*(end() - 1));
- ; 1181 : }
- ; 1182 :
- ; 1183 : void push_back(const value_type& _Val)
- ; 1184 : { // insert element at end
- ; 1185 : if (_Inside(_STD addressof(_Val)))
- ; 1186 : { // push back an element
- ; 1187 : size_type _Idx = _STD addressof(_Val) - this->_Myfirst;
- ; 1188 : if (this->_Mylast == this->_Myend)
- ; 1189 : _Reserve(1);
- ; 1190 : _Orphan_range(this->_Mylast, this->_Mylast);
- ; 1191 : this->_Getal().construct(this->_Mylast,
- ; 1192 : this->_Myfirst[_Idx]);
- ; 1193 : ++this->_Mylast;
- ; 1194 : }
- ; 1195 : else
- ; 1196 : { // push back a non-element
- ; 1197 : if (this->_Mylast == this->_Myend)
- ; 1198 : _Reserve(1);
- ; 1199 : _Orphan_range(this->_Mylast, this->_Mylast);
- ; 1200 : this->_Getal().construct(this->_Mylast,
- ; 1201 : _Val);
- ; 1202 : ++this->_Mylast;
- ; 1203 : }
- ; 1204 : }
- ; 1205 :
- ; 1206 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1207 : void pop_back()
- ; 1208 : { // erase element at end
- ; 1209 : if (empty())
- ; 1210 : _DEBUG_ERROR("vector empty before pop");
- ; 1211 : else
- ; 1212 : { // erase last element
- ; 1213 : _Orphan_range(this->_Mylast - 1, this->_Mylast);
- ; 1214 : this->_Getal().destroy(this->_Mylast - 1);
- ; 1215 : --this->_Mylast;
- ; 1216 : }
- ; 1217 : }
- ; 1218 :
- ; 1219 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1220 : void pop_back()
- ; 1221 : { // erase element at end
- ; 1222 : if (!empty())
- ; 1223 : { // erase last element
- ; 1224 : this->_Getal().destroy(this->_Mylast - 1);
- ; 1225 : --this->_Mylast;
- ; 1226 : }
- ; 1227 : }
- ; 1228 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1229 :
- ; 1230 : template<class _Iter>
- ; 1231 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1232 : void>::type
- ; 1233 : assign(_Iter _First, _Iter _Last)
- ; 1234 : { // assign [_First, _Last), input iterators
- ; 1235 : erase(begin(), end());
- ; 1236 : insert(begin(), _First, _Last);
- ; 1237 : }
- ; 1238 :
- ; 1239 : void assign(size_type _Count, const value_type& _Val)
- ; 1240 : { // assign _Count * _Val
- ; 1241 : _Assign_n(_Count, _Val);
- ; 1242 : }
- ; 1243 :
- ; 1244 : iterator insert(const_iterator _Where, const _Ty& _Val)
- ; 1245 : { // insert _Val at _Where
- ; 1246 : return (_Insert_n(_Where, (size_type)1, _Val));
- ; 1247 : }
- ; 1248 :
- ; 1249 : iterator insert(const_iterator _Where, size_type _Count,
- ; 1250 : const _Ty& _Val)
- ; 1251 : { // insert _Count * _Val at _Where
- ; 1252 : return (_Insert_n(_Where, _Count, _Val));
- ; 1253 : }
- ; 1254 :
- ; 1255 : template<class _Iter>
- ; 1256 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1257 : iterator>::type
- ; 1258 : insert(const_iterator _Where, _Iter _First, _Iter _Last)
- ; 1259 : { // insert [_First, _Last) at _Where
- ; 1260 : size_type _Off = _VIPTR(_Where) - this->_Myfirst;
- ; 1261 : _Insert(_Where, _First, _Last, _Iter_cat(_First));
- ; 1262 : return (begin() + _Off);
- ; 1263 : }
- ; 1264 :
- ; 1265 : template<class _Iter>
- ; 1266 : void _Insert(const_iterator _Where, _Iter _First, _Iter _Last,
- ; 1267 : input_iterator_tag)
- ; 1268 : { // insert [_First, _Last) at _Where, input iterators
- ; 1269 : size_type _Off = _VIPTR(_Where) - this->_Myfirst;
- ; 1270 :
- ; 1271 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1272 : if (size() < _Off)
- ; 1273 : _DEBUG_ERROR("vector insert iterator outside range");
- ; 1274 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1275 :
- ; 1276 : if (_First != _Last)
- ; 1277 : { // worth doing, gather at end and rotate into place
- ; 1278 : size_type _Oldsize = size();
- ; 1279 :
- ; 1280 : _TRY_BEGIN
- ; 1281 : for (; _First != _Last; ++_First)
- ; 1282 : push_back(*_First); // append
- ; 1283 :
- ; 1284 : _CATCH_ALL
- ; 1285 : erase(begin() + _Oldsize, end());
- ; 1286 : _RERAISE;
- ; 1287 : _CATCH_END
- ; 1288 :
- ; 1289 : _STD rotate(begin() + _Off, begin() + _Oldsize, end());
- ; 1290 : }
- ; 1291 : }
- ; 1292 :
- ; 1293 : template<class _Iter>
- ; 1294 : void _Insert(const_iterator _Where, _Iter _First, _Iter _Last,
- ; 1295 : forward_iterator_tag)
- ; 1296 : { // insert [_First, _Last) at _Where, forward iterators
- ; 1297 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1298 : if (_VICONT(_Where) != this
- ; 1299 : || _VIPTR(_Where) < this->_Myfirst
- ; 1300 : || this->_Mylast < _VIPTR(_Where))
- ; 1301 : _DEBUG_ERROR("vector insert iterator outside range");
- ; 1302 : _DEBUG_RANGE(_First, _Last);
- ; 1303 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1304 :
- ; 1305 : size_type _Count = 0;
- ; 1306 : _Distance(_First, _Last, _Count);
- ; 1307 :
- ; 1308 : if (_Count == 0)
- ; 1309 : ;
- ; 1310 : else if (_Unused_capacity() < _Count)
- ; 1311 : { // not enough room, reallocate
- ; 1312 : if (max_size() - size() < _Count)
- ; 1313 : _Xlen(); // result too long
- ; 1314 :
- ; 1315 : size_type _Capacity = _Grow_to(size() + _Count);
- ; 1316 : pointer _Newvec = this->_Getal().allocate(_Capacity);
- ; 1317 : pointer _Ptr = _Newvec;
- ; 1318 :
- ; 1319 : _TRY_BEGIN
- ; 1320 : _Ptr = _Umove(this->_Myfirst, _VIPTR(_Where),
- ; 1321 : _Newvec); // copy prefix
- ; 1322 : _Ptr = _Ucopy(_First, _Last, _Ptr); // add new stuff
- ; 1323 : _Umove(_VIPTR(_Where), this->_Mylast,
- ; 1324 : _Ptr); // copy suffix
- ; 1325 : _CATCH_ALL
- ; 1326 : _Destroy(_Newvec, _Ptr);
- ; 1327 : this->_Getal().deallocate(_Newvec, _Capacity);
- ; 1328 : _RERAISE;
- ; 1329 : _CATCH_END
- ; 1330 :
- ; 1331 : _Count += size();
- ; 1332 : if (this->_Myfirst != pointer())
- ; 1333 : { // destroy and deallocate old array
- ; 1334 : _Destroy(this->_Myfirst, this->_Mylast);
- ; 1335 : this->_Getal().deallocate(this->_Myfirst,
- ; 1336 : this->_Myend - this->_Myfirst);
- ; 1337 : }
- ; 1338 :
- ; 1339 : this->_Orphan_all();
- ; 1340 : this->_Myend = _Newvec + _Capacity;
- ; 1341 : this->_Mylast = _Newvec + _Count;
- ; 1342 : this->_Myfirst = _Newvec;
- ; 1343 : }
- ; 1344 : else
- ; 1345 : { // new stuff fits, append and rotate into place
- ; 1346 : _Ucopy(_First, _Last, this->_Mylast);
- ; 1347 : _STD rotate(_VIPTR(_Where), this->_Mylast,
- ; 1348 : this->_Mylast + _Count);
- ; 1349 : this->_Mylast += _Count;
- ; 1350 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
- ; 1351 : }
- ; 1352 : }
- ; 1353 :
- ; 1354 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1355 : iterator erase(const_iterator _Where)
- ; 1356 : { // erase element at where
- ; 1357 : if (_VICONT(_Where) != this
- ; 1358 : || _VIPTR(_Where) < this->_Myfirst
- ; 1359 : || this->_Mylast <= _VIPTR(_Where))
- ; 1360 : _DEBUG_ERROR("vector erase iterator outside range");
- ; 1361 : _Move(_VIPTR(_Where) + 1, this->_Mylast, _VIPTR(_Where));
- ; 1362 : _Destroy(this->_Mylast - 1, this->_Mylast);
- ; 1363 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
- ; 1364 : --this->_Mylast;
- ; 1365 : return (_Make_iter(_Where));
- ; 1366 : }
- ; 1367 :
- ; 1368 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1369 : iterator erase(const_iterator _Where)
- ; 1370 : { // erase element at where
- ; 1371 : _Move(_VIPTR(_Where) + 1, this->_Mylast,
- ; 1372 : _VIPTR(_Where));
- ; 1373 : _Destroy(this->_Mylast - 1, this->_Mylast);
- ; 1374 : --this->_Mylast;
- ; 1375 : return (_Make_iter(_Where));
- ; 1376 : }
- ; 1377 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1378 :
- ; 1379 : iterator erase(const_iterator _First_arg,
- ; 1380 : const_iterator _Last_arg)
- ; 1381 : { // erase [_First, _Last)
- ; 1382 : if (_First_arg == begin() && _Last_arg == end())
- ; 1383 : clear();
- ; 1384 : else if (_First_arg != _Last_arg)
- ; 1385 : { // clear partial
- ; 1386 : iterator _First = _Make_iter(_First_arg);
- ; 1387 : iterator _Last = _Make_iter(_Last_arg);
- ; 1388 :
- ; 1389 : if (_First != _Last)
- ; 1390 : { // worth doing, copy down over hole
- ; 1391 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1392 : if (_Last < _First || _VICONT(_First) != this
- ; 1393 : || _VIPTR(_First) < this->_Myfirst
- ; 1394 : || this->_Mylast < _VIPTR(_Last))
- ; 1395 : _DEBUG_ERROR("vector erase iterator outside range");
- ; 1396 : pointer _Ptr = _Move(_VIPTR(_Last), this->_Mylast,
- ; 1397 : _VIPTR(_First));
- ; 1398 : _Orphan_range(_VIPTR(_First), this->_Mylast);
- ; 1399 :
- ; 1400 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1401 : pointer _Ptr = _Move(_VIPTR(_Last), this->_Mylast,
- ; 1402 : _VIPTR(_First));
- ; 1403 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1404 :
- ; 1405 : _Destroy(_Ptr, this->_Mylast);
- ; 1406 : this->_Mylast = _Ptr;
- ; 1407 : }
- ; 1408 : }
- ; 1409 : return (_Make_iter(_First_arg));
- ; 1410 : }
- ; 1411 :
- ; 1412 : void clear() _NOEXCEPT
- ; 1413 : { // erase all
- ; 1414 : this->_Orphan_all();
- ; 1415 : _Destroy(this->_Myfirst, this->_Mylast);
- ; 1416 : this->_Mylast = this->_Myfirst;
- ; 1417 : }
- ; 1418 :
- ; 1419 : void swap(_Myt& _Right)
- ; 1420 : { // exchange contents with _Right
- ; 1421 : if (this == &_Right)
- ; 1422 : ; // same object, do nothing
- ; 1423 : else if (this->_Getal() == _Right._Getal())
- ; 1424 : { // same allocator, swap control information
- ; 1425 : this->_Swap_all(_Right);
- ; 1426 : _Swap_adl(this->_Myfirst, _Right._Myfirst);
- ; 1427 : _Swap_adl(this->_Mylast, _Right._Mylast);
- ; 1428 : _Swap_adl(this->_Myend, _Right._Myend);
- ; 1429 : }
- ; 1430 :
- ; 1431 : #if _HAS_CPP0X
- ; 1432 : else if (_Alty::propagate_on_container_swap::value)
- ; 1433 : { // swap allocators and control information
- ; 1434 : this->_Swap_alloc(_Right);
- ; 1435 : _Swap_adl(this->_Myfirst, _Right._Myfirst);
- ; 1436 : _Swap_adl(this->_Mylast, _Right._Mylast);
- ; 1437 : _Swap_adl(this->_Myend, _Right._Myend);
- ; 1438 : }
- ; 1439 : #endif /* _HAS_CPP0X */
- ; 1440 :
- ; 1441 : else
- ; 1442 : { // different allocator, do multiple moves
- ; 1443 : _Myt _Ts = _Move(*this);
- ; 1444 :
- ; 1445 : *this = _Move(_Right);
- ; 1446 : _Right = _Move(_Ts);
- ; 1447 : }
- ; 1448 : }
- ; 1449 :
- ; 1450 : protected:
- ; 1451 : void _Assign_n(size_type _Count, const value_type& _Val)
- ; 1452 : { // assign _Count * _Val
- ; 1453 : value_type _Tmp = _Val; // in case _Val is in sequence
- ; 1454 : erase(begin(), end());
- ; 1455 : insert(begin(), _Count, _Tmp);
- ; 1456 : }
- ; 1457 :
- ; 1458 : bool _Buy(size_type _Capacity)
- ; 1459 : { // allocate array with _Capacity elements
- ; 1460 : this->_Myfirst = pointer();
- ; 1461 : this->_Mylast = pointer();
- ; 1462 : this->_Myend = pointer();
- ; 1463 :
- ; 1464 : if (_Capacity == 0)
- ; 1465 : return (false);
- ; 1466 : else if (max_size() < _Capacity)
- ; 1467 : _Xlen(); // result too long
- ; 1468 : else
- ; 1469 : { // nonempty array, allocate storage
- ; 1470 : this->_Myfirst = this->_Getal().allocate(_Capacity);
- ; 1471 : this->_Mylast = this->_Myfirst;
- ; 1472 : this->_Myend = this->_Myfirst + _Capacity;
- ; 1473 : }
- ; 1474 : return (true);
- ; 1475 : }
- ; 1476 :
- ; 1477 : void _Destroy(pointer _First, pointer _Last)
- ; 1478 : { // destroy [_First, _Last) using allocator
- ; 1479 : _Alty _Alval(this->_Getal());
- ; 1480 : _Destroy_range(_First, _Last, _Alval);
- ; 1481 : }
- ; 1482 :
- ; 1483 : size_type _Grow_to(size_type _Count) const
- ; 1484 : { // grow by 50% or at least to _Count
- ; 1485 : size_type _Capacity = capacity();
- ; 1486 :
- ; 1487 : _Capacity = max_size() - _Capacity / 2 < _Capacity
- ; 1488 : ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
- add edx, eax
- ; 1489 : if (_Capacity < _Count)
- cmp edx, esi
- pop edi
- cmovb edx, esi
- pop esi
- ; 1529 : _Xlen();
- ; 1530 : _Reallocate(_Grow_to(size() + _Count));
- mov DWORD PTR __Count$[ebp], edx
- ; 1531 : }
- ; 1532 : }
- pop ebp
- ; 1529 : _Xlen();
- ; 1530 : _Reallocate(_Grow_to(size() + _Count));
- jmp ?_Reallocate@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z ; std::vector<double,std::allocator<double> >::_Reallocate
- $LN2@Reserve:
- pop edi
- pop esi
- ; 1531 : }
- ; 1532 : }
- pop ebp
- ret 4
- $LN43@Reserve:
- ?_Reserve@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z ENDP ; std::vector<double,std::allocator<double> >::_Reserve
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Getal@?$_Vector_alloc@$0A@U?$_Vec_base_types@NV?$allocator@N@std@@@std@@@std@@QBE?AU?$_Wrap_alloc@V?$allocator@N@std@@@2@XZ
- _TEXT SEGMENT
- ___$ReturnUdt$ = 8 ; size = 4
- ?_Getal@?$_Vector_alloc@$0A@U?$_Vec_base_types@NV?$allocator@N@std@@@std@@@std@@QBE?AU?$_Wrap_alloc@V?$allocator@N@std@@@2@XZ PROC ; std::_Vector_alloc<0,std::_Vec_base_types<double,std::allocator<double> > >::_Getal, COMDAT
- ; _this$dead$ = ecx
- ; 646 : { // get reference to allocator
- push ebp
- mov ebp, esp
- ; 647 : return (_Alty());
- mov eax, DWORD PTR ___$ReturnUdt$[ebp]
- ; 648 : }
- pop ebp
- ret 4
- ?_Getal@?$_Vector_alloc@$0A@U?$_Vec_base_types@NV?$allocator@N@std@@@std@@@std@@QBE?AU?$_Wrap_alloc@V?$allocator@N@std@@@2@XZ ENDP ; std::_Vector_alloc<0,std::_Vec_base_types<double,std::allocator<double> > >::_Getal
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?deallocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEXPANI@Z
- _TEXT SEGMENT
- __Ptr$ = 8 ; size = 4
- __Count$dead$ = 12 ; size = 4
- ?deallocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEXPANI@Z PROC ; std::_Wrap_alloc<std::allocator<double> >::deallocate, COMDAT
- ; _this$dead$ = ecx
- ; 886 : { // deallocate object at _Ptr, ignore size
- push ebp
- mov ebp, esp
- ; 586 : ::operator delete(_Ptr);
- push DWORD PTR __Ptr$[ebp]
- call DWORD PTR __imp_??3@YAXPAX@Z
- add esp, 4
- ; 887 : _Mybase::deallocate(_Ptr, _Count);
- ; 888 : }
- pop ebp
- ret 8
- ?deallocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEXPANI@Z ENDP ; std::_Wrap_alloc<std::allocator<double> >::deallocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ??0?$_Vector_val@U?$_Simple_types@N@std@@@std@@QAE@XZ
- _TEXT SEGMENT
- ??0?$_Vector_val@U?$_Simple_types@N@std@@@std@@QAE@XZ PROC ; std::_Vector_val<std::_Simple_types<double> >::_Vector_val<std::_Simple_types<double> >, COMDAT
- ; _this$ = ecx
- ; 485 : { // initialize values
- ; 486 : _Myfirst = pointer();
- mov DWORD PTR [ecx], 0
- ; 487 : _Mylast = pointer();
- mov DWORD PTR [ecx+4], 0
- ; 488 : _Myend = pointer();
- mov DWORD PTR [ecx+8], 0
- ; 489 : }
- mov eax, ecx
- ret 0
- ??0?$_Vector_val@U?$_Simple_types@N@std@@@std@@QAE@XZ ENDP ; std::_Vector_val<std::_Simple_types<double> >::_Vector_val<std::_Simple_types<double> >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ??H?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE?AV01@H@Z
- _TEXT SEGMENT
- ___$ReturnUdt$ = 8 ; size = 4
- __Off$ = 12 ; size = 4
- ??H?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE?AV01@H@Z PROC ; std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double> > >::operator+, COMDAT
- ; _this$ = ecx
- ; 365 : { // return this + integer
- push ebp
- mov ebp, esp
- ; 170 : _Ptr += _Off;
- mov eax, DWORD PTR __Off$[ebp]
- mov ecx, DWORD PTR [ecx]
- lea ecx, DWORD PTR [ecx+eax*8]
- ; 366 : _Myiter _Tmp = *this;
- ; 367 : return (_Tmp += _Off);
- mov eax, DWORD PTR ___$ReturnUdt$[ebp]
- mov DWORD PTR [eax], ecx
- ; 368 : }
- pop ebp
- ret 8
- ??H?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE?AV01@H@Z ENDP ; std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double> > >::operator+
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z
- _TEXT SEGMENT
- __Right$ = 8 ; size = 4
- __Roff$ = 12 ; size = 4
- __Count$ = 16 ; size = 4
- ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign, COMDAT
- ; _this$ = ecx
- ; 1104 : { // assign _Right [_Roff, _Roff + _Count)
- push ebp
- mov ebp, esp
- push ebx
- ; 1105 : if (_Right.size() < _Roff)
- mov ebx, DWORD PTR __Right$[ebp]
- push esi
- push edi
- mov edi, DWORD PTR [ebx+16]
- mov esi, ecx
- mov ecx, DWORD PTR __Roff$[ebp]
- cmp edi, ecx
- jae SHORT $LN5@assign
- ; 2219 : }
- ; 2220 :
- ; 2221 : bool _Grow(size_type _Newsize,
- ; 2222 : bool _Trim = false)
- ; 2223 : { // ensure buffer is big enough, trim to size if _Trim is true
- ; 2224 : if (max_size() < _Newsize)
- ; 2225 : _Xlen(); // result too long
- ; 2226 : if (this->_Myres < _Newsize)
- ; 2227 : _Copy(_Newsize, this->_Mysize); // reallocate to grow
- ; 2228 : else if (_Trim && _Newsize < this->_BUF_SIZE)
- ; 2229 : _Tidy(true, // copy and deallocate if trimming to small string
- ; 2230 : _Newsize < this->_Mysize ? _Newsize : this->_Mysize);
- ; 2231 : else if (_Newsize == 0)
- ; 2232 : _Eos(0); // new size is zero, just null terminate
- ; 2233 : return (0 < _Newsize); // return true only if more work to do
- ; 2234 : }
- ; 2235 :
- ; 2236 : bool _Inside(const _Elem *_Ptr)
- ; 2237 : { // test if _Ptr points inside string
- ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
- ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
- ; 2240 : return (false); // don't ask
- ; 2241 : else
- ; 2242 : return (true);
- ; 2243 : }
- ; 2244 :
- ; 2245 : static size_type _Pdif(const_iterator _P2,
- ; 2246 : const_iterator _P1)
- ; 2247 : { // compute safe iterator difference
- ; 2248 : return (_STRING_ITER_BASE(_P2) == 0 ? 0 : _P2 - _P1);
- ; 2249 : }
- ; 2250 :
- ; 2251 : void _Tidy(bool _Built = false,
- ; 2252 : size_type _Newsize = 0)
- ; 2253 : { // initialize buffer, deallocating any storage
- ; 2254 : if (!_Built)
- ; 2255 : ;
- ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
- ; 2257 : { // copy any leftovers to small buffer and deallocate
- ; 2258 : pointer _Ptr = this->_Bx._Ptr;
- ; 2259 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 2260 : if (0 < _Newsize)
- ; 2261 : _Traits::copy(this->_Bx._Buf,
- ; 2262 : _STD addressof(*_Ptr), _Newsize);
- ; 2263 : this->_Getal().deallocate(_Ptr, this->_Myres + 1);
- ; 2264 : }
- ; 2265 : this->_Myres = this->_BUF_SIZE - 1;
- ; 2266 : _Eos(_Newsize);
- ; 2267 : }
- ; 2268 :
- ; 2269 : __declspec(noreturn) void _Xlen() const
- ; 2270 : { // report a length_error
- ; 2271 : _Xlength_error("string too long");
- ; 2272 : }
- ; 2273 :
- ; 2274 : __declspec(noreturn) void _Xran() const
- ; 2275 : { // report an out_of_range error
- ; 2276 : _Xout_of_range("invalid string position");
- push OFFSET ??_C@_0BI@CFPLBAOH@invalid?5string?5position?$AA@
- call DWORD PTR __imp_?_Xout_of_range@std@@YAXPBD@Z
- $LN59@assign:
- $LN5@assign:
- ; 1106 : _Xran(); // _Roff off end
- ; 1107 : size_type _Num = _Right.size() - _Roff;
- sub edi, ecx
- ; 1108 : if (_Count < _Num)
- cmp DWORD PTR __Count$[ebp], edi
- cmovb edi, DWORD PTR __Count$[ebp]
- ; 1109 : _Num = _Count; // trim _Num to size
- ; 1110 :
- ; 1111 : if (this == &_Right)
- cmp esi, ebx
- jne SHORT $LN3@assign
- ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
- lea eax, DWORD PTR [edi+ecx]
- ; 1121 :
- ; 1122 : _Myt& assign(const _Elem *_Ptr, size_type _Count)
- ; 1123 : { // assign [_Ptr, _Ptr + _Count)
- ; 1124 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1125 : if (_Count != 0)
- ; 1126 : _DEBUG_POINTER(_Ptr);
- ; 1127 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1128 :
- ; 1129 : if (_Inside(_Ptr))
- ; 1130 : return (assign(*this,
- ; 1131 : _Ptr - this->_Myptr(), _Count)); // substring
- ; 1132 :
- ; 1133 : if (_Grow(_Count))
- ; 1134 : { // make room and assign new stuff
- ; 1135 : _Traits::copy(this->_Myptr(), _Ptr, _Count);
- ; 1136 : _Eos(_Count);
- ; 1137 : }
- ; 1138 : return (*this);
- ; 1139 : }
- ; 1140 :
- ; 1141 : _Myt& assign(const _Elem *_Ptr)
- ; 1142 : { // assign [_Ptr, <null>)
- ; 1143 : _DEBUG_POINTER(_Ptr);
- ; 1144 : return (assign(_Ptr, _Traits::length(_Ptr)));
- ; 1145 : }
- ; 1146 :
- ; 1147 : _Myt& assign(size_type _Count, _Elem _Ch)
- ; 1148 : { // assign _Count * _Ch
- ; 1149 : if (_Count == npos)
- ; 1150 : _Xlen(); // result too long
- ; 1151 :
- ; 1152 : if (_Grow(_Count))
- ; 1153 : { // make room and assign new stuff
- ; 1154 : _Chassign(0, _Count, _Ch);
- ; 1155 : _Eos(_Count);
- ; 1156 : }
- ; 1157 : return (*this);
- ; 1158 : }
- ; 1159 :
- ; 1160 : template<class _Iter>
- ; 1161 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1162 : _Myt&>::type
- ; 1163 : assign(_Iter _First, _Iter _Last)
- ; 1164 : { // assign [First, _Last), input iterators
- ; 1165 : return (replace(begin(), end(), _First, _Last));
- ; 1166 : }
- ; 1167 :
- ; 1168 : _Myt& assign(const_pointer _First, const_pointer _Last)
- ; 1169 : { // assign [First, _Last), const pointers
- ; 1170 : return (replace(begin(), end(), _First, _Last));
- ; 1171 : }
- ; 1172 :
- ; 1173 : _Myt& assign(const_iterator _First, const_iterator _Last)
- ; 1174 : { // assign [First, _Last), const_iterators
- ; 1175 : return (replace(begin(), end(), _First, _Last));
- ; 1176 : }
- ; 1177 :
- ; 1178 : _Myt& insert(size_type _Off, const _Myt& _Right)
- ; 1179 : { // insert _Right at _Off
- ; 1180 : return (insert(_Off, _Right, 0, npos));
- ; 1181 : }
- ; 1182 :
- ; 1183 : _Myt& insert(size_type _Off,
- ; 1184 : const _Myt& _Right, size_type _Roff, size_type _Count)
- ; 1185 : { // insert _Right [_Roff, _Roff + _Count) at _Off
- ; 1186 : if (this->_Mysize < _Off || _Right.size() < _Roff)
- ; 1187 : _Xran(); // _Off or _Roff off end
- ; 1188 : size_type _Num = _Right.size() - _Roff;
- ; 1189 : if (_Num < _Count)
- ; 1190 : _Count = _Num; // trim _Count to size
- ; 1191 : if (npos - this->_Mysize <= _Count)
- ; 1192 : _Xlen(); // result too long
- ; 1193 :
- ; 1194 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1195 : { // make room and insert new stuff
- ; 1196 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1197 : this->_Myptr() + _Off,
- ; 1198 : this->_Mysize - _Off); // empty out hole
- ; 1199 : if (this == &_Right)
- ; 1200 : _Traits::move(this->_Myptr() + _Off,
- ; 1201 : this->_Myptr() + (_Off < _Roff ? _Roff + _Count : _Roff),
- ; 1202 : _Count); // substring
- ; 1203 : else
- ; 1204 : _Traits::copy(this->_Myptr() + _Off,
- ; 1205 : _Right._Myptr() + _Roff, _Count); // fill hole
- ; 1206 : _Eos(_Num);
- ; 1207 : }
- ; 1208 : return (*this);
- ; 1209 : }
- ; 1210 :
- ; 1211 : _Myt& insert(size_type _Off,
- ; 1212 : const _Elem *_Ptr, size_type _Count)
- ; 1213 : { // insert [_Ptr, _Ptr + _Count) at _Off
- ; 1214 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1215 : if (_Count != 0)
- ; 1216 : _DEBUG_POINTER(_Ptr);
- ; 1217 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1218 :
- ; 1219 : if (_Inside(_Ptr))
- ; 1220 : return (insert(_Off, *this,
- ; 1221 : _Ptr - this->_Myptr(), _Count)); // substring
- ; 1222 : if (this->_Mysize < _Off)
- ; 1223 : _Xran(); // _Off off end
- ; 1224 : if (npos - this->_Mysize <= _Count)
- ; 1225 : _Xlen(); // result too long
- ; 1226 : size_type _Num;
- ; 1227 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1228 : { // make room and insert new stuff
- ; 1229 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1230 : this->_Myptr() + _Off,
- ; 1231 : this->_Mysize - _Off); // empty out hole
- ; 1232 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
- ; 1233 : _Eos(_Num);
- ; 1234 : }
- ; 1235 : return (*this);
- ; 1236 : }
- ; 1237 :
- ; 1238 : _Myt& insert(size_type _Off, const _Elem *_Ptr)
- ; 1239 : { // insert [_Ptr, <null>) at _Off
- ; 1240 : _DEBUG_POINTER(_Ptr);
- ; 1241 : return (insert(_Off, _Ptr, _Traits::length(_Ptr)));
- ; 1242 : }
- ; 1243 :
- ; 1244 : _Myt& insert(size_type _Off,
- ; 1245 : size_type _Count, _Elem _Ch)
- ; 1246 : { // insert _Count * _Ch at _Off
- ; 1247 : if (this->_Mysize < _Off)
- ; 1248 : _Xran(); // _Off off end
- ; 1249 : if (npos - this->_Mysize <= _Count)
- ; 1250 : _Xlen(); // result too long
- ; 1251 : size_type _Num;
- ; 1252 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1253 : { // make room and insert new stuff
- ; 1254 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1255 : this->_Myptr() + _Off,
- ; 1256 : this->_Mysize - _Off); // empty out hole
- ; 1257 : _Chassign(_Off, _Count, _Ch); // fill hole
- ; 1258 : _Eos(_Num);
- ; 1259 : }
- ; 1260 : return (*this);
- ; 1261 : }
- ; 1262 :
- ; 1263 : iterator insert(const_iterator _Where)
- ; 1264 : { // insert <null> at _Where
- ; 1265 : return (insert(_Where, _Elem()));
- ; 1266 : }
- ; 1267 :
- ; 1268 : iterator insert(const_iterator _Where, _Elem _Ch)
- ; 1269 : { // insert _Ch at _Where
- ; 1270 : size_type _Off = _Pdif(_Where, begin());
- ; 1271 : insert(_Off, 1, _Ch);
- ; 1272 : return (begin() + _Off);
- ; 1273 : }
- ; 1274 :
- ; 1275 : iterator insert(const_iterator _Where, size_type _Count, _Elem _Ch)
- ; 1276 : { // insert _Count * _Elem at _Where
- ; 1277 : size_type _Off = _Pdif(_Where, begin());
- ; 1278 : insert(_Off, _Count, _Ch);
- ; 1279 : return (begin() + _Off);
- ; 1280 : }
- ; 1281 :
- ; 1282 : template<class _Iter>
- ; 1283 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1284 : iterator>::type
- ; 1285 : insert(const_iterator _Where, _Iter _First, _Iter _Last)
- ; 1286 : { // insert [_First, _Last) at _Where, input iterators
- ; 1287 : size_type _Off = _Pdif(_Where, begin());
- ; 1288 : replace(_Where, _Where, _First, _Last);
- ; 1289 : return (begin() + _Off);
- ; 1290 : }
- ; 1291 :
- ; 1292 : iterator insert(const_iterator _Where,
- ; 1293 : const_pointer _First, const_pointer _Last)
- ; 1294 : { // insert [_First, _Last) at _Where, const pointers
- ; 1295 : size_type _Off = _Pdif(_Where, begin());
- ; 1296 : replace(_Where, _Where, _First, _Last);
- ; 1297 : return (begin() + _Off);
- ; 1298 : }
- ; 1299 :
- ; 1300 : iterator insert(const_iterator _Where,
- ; 1301 : const_iterator _First, const_iterator _Last)
- ; 1302 : { // insert [_First, _Last) at _Where, const_iterators
- ; 1303 : size_type _Off = _Pdif(_Where, begin());
- ; 1304 : replace(_Where, _Where, _First, _Last);
- ; 1305 : return (begin() + _Off);
- ; 1306 : }
- ; 1307 :
- ; 1308 : _Myt& erase(size_type _Off = 0)
- ; 1309 : { // erase elements [_Off, ...)
- ; 1310 : if (this->_Mysize < _Off)
- cmp DWORD PTR [esi+16], eax
- jae SHORT $LN15@assign
- ; 2219 : }
- ; 2220 :
- ; 2221 : bool _Grow(size_type _Newsize,
- ; 2222 : bool _Trim = false)
- ; 2223 : { // ensure buffer is big enough, trim to size if _Trim is true
- ; 2224 : if (max_size() < _Newsize)
- ; 2225 : _Xlen(); // result too long
- ; 2226 : if (this->_Myres < _Newsize)
- ; 2227 : _Copy(_Newsize, this->_Mysize); // reallocate to grow
- ; 2228 : else if (_Trim && _Newsize < this->_BUF_SIZE)
- ; 2229 : _Tidy(true, // copy and deallocate if trimming to small string
- ; 2230 : _Newsize < this->_Mysize ? _Newsize : this->_Mysize);
- ; 2231 : else if (_Newsize == 0)
- ; 2232 : _Eos(0); // new size is zero, just null terminate
- ; 2233 : return (0 < _Newsize); // return true only if more work to do
- ; 2234 : }
- ; 2235 :
- ; 2236 : bool _Inside(const _Elem *_Ptr)
- ; 2237 : { // test if _Ptr points inside string
- ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
- ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
- ; 2240 : return (false); // don't ask
- ; 2241 : else
- ; 2242 : return (true);
- ; 2243 : }
- ; 2244 :
- ; 2245 : static size_type _Pdif(const_iterator _P2,
- ; 2246 : const_iterator _P1)
- ; 2247 : { // compute safe iterator difference
- ; 2248 : return (_STRING_ITER_BASE(_P2) == 0 ? 0 : _P2 - _P1);
- ; 2249 : }
- ; 2250 :
- ; 2251 : void _Tidy(bool _Built = false,
- ; 2252 : size_type _Newsize = 0)
- ; 2253 : { // initialize buffer, deallocating any storage
- ; 2254 : if (!_Built)
- ; 2255 : ;
- ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
- ; 2257 : { // copy any leftovers to small buffer and deallocate
- ; 2258 : pointer _Ptr = this->_Bx._Ptr;
- ; 2259 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 2260 : if (0 < _Newsize)
- ; 2261 : _Traits::copy(this->_Bx._Buf,
- ; 2262 : _STD addressof(*_Ptr), _Newsize);
- ; 2263 : this->_Getal().deallocate(_Ptr, this->_Myres + 1);
- ; 2264 : }
- ; 2265 : this->_Myres = this->_BUF_SIZE - 1;
- ; 2266 : _Eos(_Newsize);
- ; 2267 : }
- ; 2268 :
- ; 2269 : __declspec(noreturn) void _Xlen() const
- ; 2270 : { // report a length_error
- ; 2271 : _Xlength_error("string too long");
- ; 2272 : }
- ; 2273 :
- ; 2274 : __declspec(noreturn) void _Xran() const
- ; 2275 : { // report an out_of_range error
- ; 2276 : _Xout_of_range("invalid string position");
- push OFFSET ??_C@_0BI@CFPLBAOH@invalid?5string?5position?$AA@
- call DWORD PTR __imp_?_Xout_of_range@std@@YAXPBD@Z
- $LN60@assign:
- $LN15@assign:
- ; 517 : : this->_Bx._Buf);
- cmp DWORD PTR [esi+20], 16 ; 00000010H
- ; 1311 : _Xran(); // _Off off end
- ; 1312 : _Eos(_Off);
- ; 1313 : return (*this);
- ; 1314 : }
- ; 1315 :
- ; 1316 : _Myt& erase(size_type _Off, size_type _Count)
- ; 1317 : { // erase elements [_Off, _Off + _Count)
- ; 1318 : if (this->_Mysize < _Off)
- ; 1319 : _Xran(); // _Off off end
- ; 1320 : if (this->_Mysize - _Off <= _Count)
- ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
- ; 1322 : else if (0 < _Count)
- ; 1323 : { // move elements down
- ; 1324 : value_type *_Ptr = this->_Myptr() + _Off;
- ; 1325 : size_type _Newsize = this->_Mysize - _Count;
- ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
- ; 1327 : _Eos(_Newsize);
- ; 1328 : }
- ; 1329 : return (*this);
- ; 1330 : }
- ; 1331 :
- ; 1332 : iterator erase(const_iterator _Where)
- ; 1333 : { // erase element at _Where
- ; 1334 : size_type _Count = _Pdif(_Where, begin());
- ; 1335 : erase(_Count, 1);
- ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1337 : }
- ; 1338 :
- ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
- ; 1340 : { // erase substring [_First, _Last)
- ; 1341 : _DEBUG_RANGE(_First, _Last);
- ; 1342 : size_type _Count = _Pdif(_First, begin());
- ; 1343 : erase(_Count, _Pdif(_Last, _First));
- ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1345 : }
- ; 1346 :
- ; 1347 : void clear() _NOEXCEPT
- ; 1348 : { // erase all
- ; 1349 : _Eos(0);
- ; 1350 : }
- ; 1351 :
- ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
- ; 1353 : { // replace [_Off, _Off + _N0) with _Right
- ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
- ; 1355 : }
- ; 1356 :
- ; 1357 : _Myt& replace(size_type _Off,
- ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
- ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
- ; 1361 : _Xran(); // _Off or _Roff off end
- ; 1362 : if (this->_Mysize - _Off < _N0)
- ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1364 : size_type _Num = _Right.size() - _Roff;
- ; 1365 : if (_Num < _Count)
- ; 1366 : _Count = _Num; // trim _Count to size
- ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1368 : _Xlen(); // result too long
- ; 1369 :
- ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
- ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
- ; 1372 : if (this->_Mysize < _Newsize)
- ; 1373 : _Grow(_Newsize);
- ; 1374 :
- ; 1375 : if (this != &_Right)
- ; 1376 : { // no overlap, just move down and copy in new stuff
- ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
- ; 1379 : _Traits::copy(this->_Myptr() + _Off,
- ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
- ; 1381 : }
- ; 1382 : else if (_Count <= _N0)
- ; 1383 : { // hole doesn't get larger, just copy in substring
- ; 1384 : _Traits::move(this->_Myptr() + _Off,
- ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1388 : }
- ; 1389 : else if (_Roff <= _Off)
- ; 1390 : { // hole gets larger, substring begins before hole
- ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1393 : _Traits::move(this->_Myptr() + _Off,
- ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1395 : }
- ; 1396 : else if (_Off + _N0 <= _Roff)
- ; 1397 : { // hole gets larger, substring begins after hole
- ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1400 : _Traits::move(this->_Myptr() + _Off,
- ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
- ; 1402 : _Count); // fill hole
- ; 1403 : }
- ; 1404 : else
- ; 1405 : { // hole gets larger, substring begins in hole
- ; 1406 : _Traits::move(this->_Myptr() + _Off,
- ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
- ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
- ; 1411 : this->_Myptr() + _Roff + _Count,
- ; 1412 : _Count - _N0); // fill rest of new hole
- ; 1413 : }
- ; 1414 :
- ; 1415 : _Eos(_Newsize);
- ; 1416 : return (*this);
- ; 1417 : }
- ; 1418 :
- ; 1419 : _Myt& replace(size_type _Off,
- ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
- ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1423 : if (_Count != 0)
- ; 1424 : _DEBUG_POINTER(_Ptr);
- ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1426 :
- ; 1427 : if (_Inside(_Ptr))
- ; 1428 : return (replace(_Off, _N0, *this,
- ; 1429 : _Ptr - this->_Myptr(),
- ; 1430 : _Count)); // substring, replace carefully
- ; 1431 : if (this->_Mysize < _Off)
- ; 1432 : _Xran(); // _Off off end
- ; 1433 : if (this->_Mysize - _Off < _N0)
- ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1436 : _Xlen(); // result too long
- ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1438 :
- ; 1439 : if (_Count < _N0)
- ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1441 : this->_Myptr() + _Off + _N0,
- ; 1442 : _Nm); // smaller hole, move tail up
- ; 1443 : size_type _Num;
- ; 1444 : if ((0 < _Count || 0 < _N0)
- ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1446 : { // make room and rearrange
- ; 1447 : if (_N0 < _Count)
- ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
- ; 1451 : _Eos(_Num);
- ; 1452 : }
- ; 1453 : return (*this);
- ; 1454 : }
- ; 1455 :
- ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
- ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 1458 : _DEBUG_POINTER(_Ptr);
- ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 1460 : }
- ; 1461 :
- ; 1462 : _Myt& replace(size_type _Off,
- ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
- ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
- ; 1465 : if (this->_Mysize < _Off)
- ; 1466 : _Xran(); // _Off off end
- ; 1467 : if (this->_Mysize - _Off < _N0)
- ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1470 : _Xlen(); // result too long
- ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1472 :
- ; 1473 : if (_Count < _N0)
- ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1475 : this->_Myptr() + _Off + _N0,
- ; 1476 : _Nm); // smaller hole, move tail up
- ; 1477 : size_type _Num;
- ; 1478 : if ((0 < _Count || 0 < _N0)
- ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1480 : { // make room and rearrange
- ; 1481 : if (_N0 < _Count)
- ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
- ; 1485 : _Eos(_Num);
- ; 1486 : }
- ; 1487 : return (*this);
- ; 1488 : }
- ; 1489 :
- ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1491 : const _Myt& _Right)
- ; 1492 : { // replace [_First, _Last) with _Right
- ; 1493 : return (replace(
- ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
- ; 1495 : }
- ; 1496 :
- ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1498 : const _Elem *_Ptr, size_type _Count)
- ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
- ; 1500 : return (replace(
- ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
- ; 1502 : }
- ; 1503 :
- ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1505 : const _Elem *_Ptr)
- ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
- ; 1507 : return (replace(
- ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
- ; 1509 : }
- ; 1510 :
- ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1512 : size_type _Count, _Elem _Ch)
- ; 1513 : { // replace [_First, _Last) with _Count * _Ch
- ; 1514 : return (replace(
- ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
- ; 1516 : }
- ; 1517 :
- ; 1518 : template<class _Iter>
- ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1520 : _Myt&>::type
- ; 1521 : replace(const_iterator _First, const_iterator _Last,
- ; 1522 : _Iter _First2, _Iter _Last2)
- ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
- ; 1524 : _Myt _Right(_First2, _Last2);
- ; 1525 : replace(_First, _Last, _Right);
- ; 1526 : return (*this);
- ; 1527 : }
- ; 1528 :
- ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1530 : const_pointer _First2, const_pointer _Last2)
- ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1532 : if (_First2 == _Last2)
- ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1534 : else
- ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1536 : &*_First2, _Last2 - _First2);
- ; 1537 : return (*this);
- ; 1538 : }
- ; 1539 :
- ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1541 : pointer _First2, pointer _Last2)
- ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1543 : if (_First2 == _Last2)
- ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1545 : else
- ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1547 : &*_First2, _Last2 - _First2);
- ; 1548 : return (*this);
- ; 1549 : }
- ; 1550 :
- ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1552 : const_iterator _First2, const_iterator _Last2)
- ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1554 : if (_First2 == _Last2)
- ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1556 : else
- ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1558 : &*_First2, _Last2 - _First2);
- ; 1559 : return (*this);
- ; 1560 : }
- ; 1561 :
- ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1563 : iterator _First2, iterator _Last2)
- ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1565 : if (_First2 == _Last2)
- ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1567 : else
- ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1569 : &*_First2, _Last2 - _First2);
- ; 1570 : return (*this);
- ; 1571 : }
- ; 1572 :
- ; 1573 : iterator begin() _NOEXCEPT
- ; 1574 : { // return iterator for beginning of mutable sequence
- ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
- ; 1576 : }
- ; 1577 :
- ; 1578 : const_iterator begin() const _NOEXCEPT
- ; 1579 : { // return iterator for beginning of nonmutable sequence
- ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
- ; 1581 : }
- ; 1582 :
- ; 1583 : iterator end() _NOEXCEPT
- ; 1584 : { // return iterator for end of mutable sequence
- ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1586 : }
- ; 1587 :
- ; 1588 : const_iterator end() const _NOEXCEPT
- ; 1589 : { // return iterator for end of nonmutable sequence
- ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1591 : }
- ; 1592 :
- ; 1593 : reverse_iterator rbegin() _NOEXCEPT
- ; 1594 : { // return iterator for beginning of reversed mutable sequence
- ; 1595 : return (reverse_iterator(end()));
- ; 1596 : }
- ; 1597 :
- ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
- ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1600 : return (const_reverse_iterator(end()));
- ; 1601 : }
- ; 1602 :
- ; 1603 : reverse_iterator rend() _NOEXCEPT
- ; 1604 : { // return iterator for end of reversed mutable sequence
- ; 1605 : return (reverse_iterator(begin()));
- ; 1606 : }
- ; 1607 :
- ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
- ; 1609 : { // return iterator for end of reversed nonmutable sequence
- ; 1610 : return (const_reverse_iterator(begin()));
- ; 1611 : }
- ; 1612 :
- ; 1613 : #if _HAS_CPP0X
- ; 1614 : const_iterator cbegin() const _NOEXCEPT
- ; 1615 : { // return iterator for beginning of nonmutable sequence
- ; 1616 : return (((const _Myt *)this)->begin());
- ; 1617 : }
- ; 1618 :
- ; 1619 : const_iterator cend() const _NOEXCEPT
- ; 1620 : { // return iterator for end of nonmutable sequence
- ; 1621 : return (((const _Myt *)this)->end());
- ; 1622 : }
- ; 1623 :
- ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
- ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1626 : return (((const _Myt *)this)->rbegin());
- ; 1627 : }
- ; 1628 :
- ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
- ; 1630 : { // return iterator for end of reversed nonmutable sequence
- ; 1631 : return (((const _Myt *)this)->rend());
- ; 1632 : }
- ; 1633 :
- ; 1634 : void shrink_to_fit()
- ; 1635 : { // reduce capacity
- ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
- ; 1637 : { // worth shrinking, do it
- ; 1638 : _Myt _Tmp(*this);
- ; 1639 : swap(_Tmp);
- ; 1640 : }
- ; 1641 : }
- ; 1642 : #endif /* _HAS_CPP0X */
- ; 1643 :
- ; 1644 : reference at(size_type _Off)
- ; 1645 : { // subscript mutable sequence with checking
- ; 1646 : if (this->_Mysize <= _Off)
- ; 1647 : _Xran(); // _Off off end
- ; 1648 : return (this->_Myptr()[_Off]);
- ; 1649 : }
- ; 1650 :
- ; 1651 : const_reference at(size_type _Off) const
- ; 1652 : { // subscript nonmutable sequence with checking
- ; 1653 : if (this->_Mysize <= _Off)
- ; 1654 : _Xran(); // _Off off end
- ; 1655 : return (this->_Myptr()[_Off]);
- ; 1656 : }
- ; 1657 :
- ; 1658 : reference operator[](size_type _Off)
- ; 1659 : { // subscript mutable sequence
- ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1661 : if (this->_Mysize < _Off) // sic
- ; 1662 : _DEBUG_ERROR("string subscript out of range");
- ; 1663 :
- ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1667 :
- ; 1668 : return (this->_Myptr()[_Off]);
- ; 1669 : }
- ; 1670 :
- ; 1671 : const_reference operator[](size_type _Off) const
- ; 1672 : { // subscript nonmutable sequence
- ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1674 : if (this->_Mysize < _Off) // sic
- ; 1675 : _DEBUG_ERROR("string subscript out of range");
- ; 1676 :
- ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1680 :
- ; 1681 : return (this->_Myptr()[_Off]);
- ; 1682 : }
- ; 1683 :
- ; 1684 : void push_back(_Elem _Ch)
- ; 1685 : { // insert element at end
- ; 1686 : insert(end(), _Ch);
- ; 1687 : }
- ; 1688 :
- ; 1689 : #if _HAS_CPP0X
- ; 1690 : void pop_back()
- ; 1691 : { // erase element at end
- ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
- ; 1693 : }
- ; 1694 :
- ; 1695 : reference front()
- ; 1696 : { // return first element of mutable sequence
- ; 1697 : return (*begin());
- ; 1698 : }
- ; 1699 :
- ; 1700 : const_reference front() const
- ; 1701 : { // return first element of nonmutable sequence
- ; 1702 : return (*begin());
- ; 1703 : }
- ; 1704 :
- ; 1705 : reference back()
- ; 1706 : { // return last element of mutable sequence
- ; 1707 : return (*(end() - 1));
- ; 1708 : }
- ; 1709 :
- ; 1710 : const_reference back() const
- ; 1711 : { // return last element of nonmutable sequence
- ; 1712 : return (*(end() - 1));
- ; 1713 : }
- ; 1714 : #endif /* _HAS_CPP0X */
- ; 1715 :
- ; 1716 : const _Elem *c_str() const _NOEXCEPT
- ; 1717 : { // return pointer to null-terminated nonmutable array
- ; 1718 : return (this->_Myptr());
- ; 1719 : }
- ; 1720 :
- ; 1721 : const _Elem *data() const _NOEXCEPT
- ; 1722 : { // return pointer to nonmutable array
- ; 1723 : return (c_str());
- ; 1724 : }
- ; 1725 :
- ; 1726 : size_type length() const _NOEXCEPT
- ; 1727 : { // return length of sequence
- ; 1728 : return (this->_Mysize);
- ; 1729 : }
- ; 1730 :
- ; 1731 : size_type size() const _NOEXCEPT
- ; 1732 : { // return length of sequence
- ; 1733 : return (this->_Mysize);
- ; 1734 : }
- ; 1735 :
- ; 1736 : size_type max_size() const _NOEXCEPT
- ; 1737 : { // return maximum possible length of sequence
- ; 1738 : size_type _Num = this->_Getal().max_size();
- ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
- ; 1740 : }
- ; 1741 :
- ; 1742 : void resize(size_type _Newsize)
- ; 1743 : { // determine new length, padding with null elements as needed
- ; 1744 : resize(_Newsize, _Elem());
- ; 1745 : }
- ; 1746 :
- ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
- ; 1748 : { // determine new length, padding with _Ch elements as needed
- ; 1749 : if (_Newsize <= this->_Mysize)
- ; 1750 : _Eos(_Newsize);
- ; 1751 : else
- ; 1752 : append(_Newsize - this->_Mysize, _Ch);
- ; 1753 : }
- ; 1754 :
- ; 1755 : size_type capacity() const _NOEXCEPT
- ; 1756 : { // return current length of allocated storage
- ; 1757 : return (this->_Myres);
- ; 1758 : }
- ; 1759 :
- ; 1760 : void reserve(size_type _Newcap = 0)
- ; 1761 : { // determine new minimum length of allocated storage
- ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
- ; 1763 : { // change reservation
- ; 1764 : size_type _Size = this->_Mysize;
- ; 1765 : if (_Grow(_Newcap, true))
- ; 1766 : _Eos(_Size);
- ; 1767 : }
- ; 1768 : }
- ; 1769 :
- ; 1770 : bool empty() const _NOEXCEPT
- ; 1771 : { // test if sequence is empty
- ; 1772 : return (this->_Mysize == 0);
- ; 1773 : }
- ; 1774 :
- ; 1775 : _SCL_INSECURE_DEPRECATE
- ; 1776 :
- ; 1777 : size_type copy(_Elem *_Ptr,
- ; 1778 : size_type _Count, size_type _Off = 0) const
- ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
- ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1781 : if (_Count != 0)
- ; 1782 : _DEBUG_POINTER(_Ptr);
- ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1784 :
- ; 1785 : if (this->_Mysize < _Off)
- ; 1786 : _Xran(); // _Off off end
- ; 1787 : if (this->_Mysize - _Off < _Count)
- ; 1788 : _Count = this->_Mysize - _Off;
- ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
- ; 1790 : return (_Count);
- ; 1791 : }
- ; 1792 :
- ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
- ; 1794 : size_type _Count, size_type _Off = 0) const
- ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
- ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1797 : if (_Count != 0)
- ; 1798 : _DEBUG_POINTER(_Dest);
- ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1800 :
- ; 1801 : if (this->_Mysize < _Off)
- ; 1802 : _Xran(); // _Off off end
- ; 1803 : if (this->_Mysize - _Off < _Count)
- ; 1804 : _Count = this->_Mysize - _Off;
- ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
- ; 1806 : return (_Count);
- ; 1807 : }
- ; 1808 :
- ; 1809 : void _Swap_bx(_Myt& _Right)
- ; 1810 : { // exchange _Bx with _Right._Bx
- ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
- ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
- ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
- ; 1814 : else
- ; 1815 : { // swap large with small
- ; 1816 : pointer _Ptr = this->_Bx._Ptr;
- ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 1818 : _Traits::copy(this->_Bx._Buf,
- ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
- ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
- ; 1821 : }
- ; 1822 : else
- ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
- ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
- ; 1825 : else
- ; 1826 : { // swap small with large
- ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
- ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
- ; 1829 : _Traits::copy(_Right._Bx._Buf,
- ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
- ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 1832 : }
- ; 1833 : }
- ; 1834 :
- ; 1835 : void swap(_Myt& _Right)
- ; 1836 : { // exchange contents with _Right
- ; 1837 : if (this == &_Right)
- ; 1838 : ; // same object, do nothing
- ; 1839 : else if (this->_Getal() == _Right._Getal())
- ; 1840 : { // same allocator, swap control information
- ; 1841 : this->_Swap_all(_Right);
- ; 1842 : _Swap_bx(_Right);
- ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1844 : _STD swap(this->_Myres, _Right._Myres);
- ; 1845 : }
- ; 1846 :
- ; 1847 : #if _HAS_CPP0X
- ; 1848 : else if (_Alty::propagate_on_container_swap::value)
- ; 1849 : { // swap allocators and control information
- ; 1850 : this->_Swap_alloc(_Right);
- ; 1851 : _Swap_bx(_Right);
- ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
- ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1854 : _STD swap(this->_Myres, _Right._Myres);
- ; 1855 : }
- ; 1856 : #endif /* _HAS_CPP0X */
- ; 1857 :
- ; 1858 : else
- ; 1859 : { // different allocator, do multiple assigns
- ; 1860 : _Myt _Tmp = *this;
- ; 1861 :
- ; 1862 : *this = _Right;
- ; 1863 : _Right = _Tmp;
- ; 1864 : }
- ; 1865 : }
- ; 1866 :
- ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
- ; 1868 : { // look for _Right beginning at or after _Off
- ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
- ; 1870 : }
- ; 1871 :
- ; 1872 : size_type find(const _Elem *_Ptr,
- ; 1873 : size_type _Off, size_type _Count) const
- ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
- ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1876 : if (_Count != 0)
- ; 1877 : _DEBUG_POINTER(_Ptr);
- ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1879 :
- ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
- ; 1881 : return (_Off); // null string always matches (if inside string)
- ; 1882 :
- ; 1883 : size_type _Nm;
- ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
- ; 1885 : { // room for match, look for it
- ; 1886 : const _Elem *_Uptr, *_Vptr;
- ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
- ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
- ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
- ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1891 : return (_Uptr - this->_Myptr()); // found a match
- ; 1892 : }
- ; 1893 :
- ; 1894 : return (npos); // no match
- ; 1895 : }
- ; 1896 :
- ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
- ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
- ; 1899 : _DEBUG_POINTER(_Ptr);
- ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1901 : }
- ; 1902 :
- ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
- ; 1904 : { // look for _Ch at or after _Off
- ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1906 : }
- ; 1907 :
- ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
- ; 1909 : { // look for _Right beginning before _Off
- ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
- ; 1911 : }
- ; 1912 :
- ; 1913 : size_type rfind(const _Elem *_Ptr,
- ; 1914 : size_type _Off, size_type _Count) const
- ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
- ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1917 : if (_Count != 0)
- ; 1918 : _DEBUG_POINTER(_Ptr);
- ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1920 :
- ; 1921 : if (_Count == 0)
- ; 1922 : return (_Off < this->_Mysize ? _Off
- ; 1923 : : this->_Mysize); // null always matches
- ; 1924 : if (_Count <= this->_Mysize)
- ; 1925 : { // room for match, look for it
- ; 1926 : const _Elem *_Uptr = this->_Myptr() +
- ; 1927 : (_Off < this->_Mysize - _Count ? _Off
- ; 1928 : : this->_Mysize - _Count);
- ; 1929 : for (; ; --_Uptr)
- ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
- ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1932 : return (_Uptr - this->_Myptr()); // found a match
- ; 1933 : else if (_Uptr == this->_Myptr())
- ; 1934 : break; // at beginning, no more chance for match
- ; 1935 : }
- ; 1936 :
- ; 1937 : return (npos); // no match
- ; 1938 : }
- ; 1939 :
- ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
- ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
- ; 1942 : _DEBUG_POINTER(_Ptr);
- ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1944 : }
- ; 1945 :
- ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
- ; 1947 : { // look for _Ch before _Off
- ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 1949 : }
- ; 1950 :
- ; 1951 : size_type find_first_of(const _Myt& _Right,
- ; 1952 : size_type _Off = 0) const _NOEXCEPT
- ; 1953 : { // look for one of _Right at or after _Off
- ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1955 : }
- ; 1956 :
- ; 1957 : size_type find_first_of(const _Elem *_Ptr,
- ; 1958 : size_type _Off, size_type _Count) const
- ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
- ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1961 : if (_Count != 0)
- ; 1962 : _DEBUG_POINTER(_Ptr);
- ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1964 :
- ; 1965 : if (0 < _Count && _Off < this->_Mysize)
- ; 1966 : { // room for match, look for it
- ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 1969 : _Uptr < _Vptr; ++_Uptr)
- ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 1971 : return (_Uptr - this->_Myptr()); // found a match
- ; 1972 : }
- ; 1973 :
- ; 1974 : return (npos); // no match
- ; 1975 : }
- ; 1976 :
- ; 1977 : size_type find_first_of(const _Elem *_Ptr,
- ; 1978 : size_type _Off = 0) const
- ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 1980 : _DEBUG_POINTER(_Ptr);
- ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1982 : }
- ; 1983 :
- ; 1984 : size_type find_first_of(_Elem _Ch,
- ; 1985 : size_type _Off = 0) const
- ; 1986 : { // look for _Ch at or after _Off
- ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1988 : }
- ; 1989 :
- ; 1990 : size_type find_last_of(const _Myt& _Right,
- ; 1991 : size_type _Off = npos) const _NOEXCEPT
- ; 1992 : { // look for one of _Right before _Off
- ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1994 : }
- ; 1995 :
- ; 1996 : size_type find_last_of(const _Elem *_Ptr,
- ; 1997 : size_type _Off, size_type _Count) const
- ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
- ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2000 : if (_Count != 0)
- ; 2001 : _DEBUG_POINTER(_Ptr);
- ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2003 :
- ; 2004 : if (0 < _Count && 0 < this->_Mysize)
- ; 2005 : { // worth searching, do it
- ; 2006 : const _Elem *_Uptr = this->_Myptr()
- ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2008 : for (; ; --_Uptr)
- ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 2010 : return (_Uptr - this->_Myptr()); // found a match
- ; 2011 : else if (_Uptr == this->_Myptr())
- ; 2012 : break; // at beginning, no more chance for match
- ; 2013 : }
- ; 2014 :
- ; 2015 : return (npos); // no match
- ; 2016 : }
- ; 2017 :
- ; 2018 : size_type find_last_of(const _Elem *_Ptr,
- ; 2019 : size_type _Off = npos) const
- ; 2020 : { // look for one of [_Ptr, <null>) before _Off
- ; 2021 : _DEBUG_POINTER(_Ptr);
- ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2023 : }
- ; 2024 :
- ; 2025 : size_type find_last_of(_Elem _Ch,
- ; 2026 : size_type _Off = npos) const
- ; 2027 : { // look for _Ch before _Off
- ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 2029 : }
- ; 2030 :
- ; 2031 : size_type find_first_not_of(const _Myt& _Right,
- ; 2032 : size_type _Off = 0) const _NOEXCEPT
- ; 2033 : { // look for none of _Right at or after _Off
- ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
- ; 2035 : _Right.size()));
- ; 2036 : }
- ; 2037 :
- ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2039 : size_type _Off, size_type _Count) const
- ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
- ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2042 : if (_Count != 0)
- ; 2043 : _DEBUG_POINTER(_Ptr);
- ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2045 :
- ; 2046 : if (_Off < this->_Mysize)
- ; 2047 : { // room for match, look for it
- ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 2050 : _Uptr < _Vptr; ++_Uptr)
- ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2052 : return (_Uptr - this->_Myptr());
- ; 2053 : }
- ; 2054 : return (npos);
- ; 2055 : }
- ; 2056 :
- ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2058 : size_type _Off = 0) const
- ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 2060 : _DEBUG_POINTER(_Ptr);
- ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2062 : }
- ; 2063 :
- ; 2064 : size_type find_first_not_of(_Elem _Ch,
- ; 2065 : size_type _Off = 0) const
- ; 2066 : { // look for non _Ch at or after _Off
- ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2068 : }
- ; 2069 :
- ; 2070 : size_type find_last_not_of(const _Myt& _Right,
- ; 2071 : size_type _Off = npos) const _NOEXCEPT
- ; 2072 : { // look for none of _Right before _Off
- ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
- ; 2074 : }
- ; 2075 :
- ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2077 : size_type _Off, size_type _Count) const
- ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
- ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2080 : if (_Count != 0)
- ; 2081 : _DEBUG_POINTER(_Ptr);
- ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2083 :
- ; 2084 : if (0 < this->_Mysize)
- ; 2085 : { // worth searching, do it
- ; 2086 : const _Elem *_Uptr = this->_Myptr()
- ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2088 : for (; ; --_Uptr)
- ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2090 : return (_Uptr - this->_Myptr());
- ; 2091 : else if (_Uptr == this->_Myptr())
- ; 2092 : break;
- ; 2093 : }
- ; 2094 : return (npos);
- ; 2095 : }
- ; 2096 :
- ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2098 : size_type _Off = npos) const
- ; 2099 : { // look for none of [_Ptr, <null>) before _Off
- ; 2100 : _DEBUG_POINTER(_Ptr);
- ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2102 : }
- ; 2103 :
- ; 2104 : size_type find_last_not_of(_Elem _Ch,
- ; 2105 : size_type _Off = npos) const
- ; 2106 : { // look for non _Ch before _Off
- ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2108 : }
- ; 2109 :
- ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
- ; 2111 : { // return [_Off, _Off + _Count) as new string
- ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
- ; 2113 : }
- ; 2114 :
- ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
- ; 2116 : { // compare [0, _Mysize) with _Right
- ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
- ; 2118 : }
- ; 2119 :
- ; 2120 : int compare(size_type _Off, size_type _N0,
- ; 2121 : const _Myt& _Right) const
- ; 2122 : { // compare [_Off, _Off + _N0) with _Right
- ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
- ; 2124 : }
- ; 2125 :
- ; 2126 : int compare(size_type _Off,
- ; 2127 : size_type _N0, const _Myt& _Right,
- ; 2128 : size_type _Roff, size_type _Count) const
- ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 2130 : if (_Right.size() < _Roff)
- ; 2131 : _Xran(); // _Off off end
- ; 2132 : if (_Right._Mysize - _Roff < _Count)
- ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
- ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
- ; 2135 : }
- ; 2136 :
- ; 2137 : int compare(const _Elem *_Ptr) const
- ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
- ; 2139 : _DEBUG_POINTER(_Ptr);
- ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
- ; 2141 : }
- ; 2142 :
- ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
- ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 2145 : _DEBUG_POINTER(_Ptr);
- ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 2147 : }
- ; 2148 :
- ; 2149 : int compare(size_type _Off,
- ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
- ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2153 : if (_Count != 0)
- ; 2154 : _DEBUG_POINTER(_Ptr);
- ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2156 :
- ; 2157 : if (this->_Mysize < _Off)
- ; 2158 : _Xran(); // _Off off end
- ; 2159 : if (this->_Mysize - _Off < _N0)
- ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 2161 :
- ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
- ; 2163 : _N0 < _Count ? _N0 : _Count);
- ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
- ; 2165 : : _N0 == _Count ? 0 : +1);
- ; 2166 : }
- ; 2167 :
- ; 2168 : allocator_type get_allocator() const _NOEXCEPT
- ; 2169 : { // return allocator object for values
- ; 2170 : return (this->_Getal());
- ; 2171 : }
- ; 2172 :
- ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
- ; 2174 : { // assign _Count copies of _Ch beginning at _Off
- ; 2175 : if (_Count == 1)
- ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
- ; 2177 : else
- ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
- ; 2179 : }
- ; 2180 :
- ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
- ; 2182 : { // copy _Oldlen elements to newly allocated buffer
- ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
- ; 2184 : if (max_size() < _Newres)
- ; 2185 : _Newres = _Newsize; // undo roundup if too big
- ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
- ; 2187 : ;
- ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
- ; 2189 : _Newres = this->_Myres
- ; 2190 : + this->_Myres / 2; // grow exponentially if possible
- ; 2191 : else
- ; 2192 : _Newres = max_size(); // settle for max_size()
- ; 2193 :
- ; 2194 : _Elem *_Ptr;
- ; 2195 : _TRY_BEGIN
- ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2197 : _CATCH_ALL
- ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
- ; 2199 : _TRY_BEGIN
- ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2201 : _CATCH_ALL
- ; 2202 : _Tidy(true); // failed again, discard storage and reraise
- ; 2203 : _RERAISE;
- ; 2204 : _CATCH_END
- ; 2205 : _CATCH_END
- ; 2206 :
- ; 2207 : if (0 < _Oldlen)
- ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
- ; 2209 : _Oldlen); // copy existing elements
- ; 2210 : _Tidy(true);
- ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 2212 : this->_Myres = _Newres;
- ; 2213 : _Eos(_Oldlen);
- ; 2214 : }
- ; 2215 :
- ; 2216 : void _Eos(size_type _Newsize)
- ; 2217 : { // set new length and null terminator
- ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
- mov DWORD PTR [esi+16], eax
- ; 517 : : this->_Bx._Buf);
- jb SHORT $LN25@assign
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov edx, DWORD PTR [esi]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
- push ecx
- push ecx
- mov ecx, esi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax+edx], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
- call ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::erase
- pop edi
- ; 1119 : return (*this);
- mov eax, esi
- pop esi
- pop ebx
- ; 1120 : }
- pop ebp
- ret 12 ; 0000000cH
- $LN25@assign:
- ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
- push ecx
- ; 517 : : this->_Bx._Buf);
- mov edx, esi
- ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
- push ecx
- mov ecx, esi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax+edx], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
- call ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::erase
- pop edi
- ; 1119 : return (*this);
- mov eax, esi
- pop esi
- pop ebx
- ; 1120 : }
- pop ebp
- ret 12 ; 0000000cH
- $LN3@assign:
- ; 1113 : else if (_Grow(_Num))
- push ecx
- push edi
- mov ecx, esi
- call ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE_NI_N@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Grow
- test al, al
- je SHORT $LN55@assign
- ; 518 : }
- ; 519 :
- ; 520 : const value_type *_Myptr() const
- ; 521 : { // determine current pointer to buffer for nonmutable string
- ; 522 : return (this->_BUF_SIZE <= this->_Myres
- ; 523 : ? _STD addressof(*this->_Bx._Ptr)
- ; 524 : : this->_Bx._Buf);
- cmp DWORD PTR [ebx+20], 16 ; 00000010H
- jb SHORT $LN33@assign
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov ebx, DWORD PTR [ebx]
- $LN33@assign:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 517 : : this->_Bx._Buf);
- cmp DWORD PTR [esi+20], 16 ; 00000010H
- jb SHORT $LN39@assign
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov ecx, DWORD PTR [esi]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 517 : : this->_Bx._Buf);
- jmp SHORT $LN40@assign
- $LN39@assign:
- mov ecx, esi
- $LN40@assign:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 530 : : (_Elem *)_CSTD memcpy(_First1, _First2, _Count));
- test edi, edi
- je SHORT $LN46@assign
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1116 : _Right._Myptr() + _Roff, _Num);
- mov eax, DWORD PTR __Roff$[ebp]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 530 : : (_Elem *)_CSTD memcpy(_First1, _First2, _Count));
- push edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1116 : _Right._Myptr() + _Roff, _Num);
- add eax, ebx
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 530 : : (_Elem *)_CSTD memcpy(_First1, _First2, _Count));
- push eax
- push ecx
- call _memcpy
- add esp, 12 ; 0000000cH
- $LN46@assign:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 517 : : this->_Bx._Buf);
- cmp DWORD PTR [esi+20], 16 ; 00000010H
- ; 1311 : _Xran(); // _Off off end
- ; 1312 : _Eos(_Off);
- ; 1313 : return (*this);
- ; 1314 : }
- ; 1315 :
- ; 1316 : _Myt& erase(size_type _Off, size_type _Count)
- ; 1317 : { // erase elements [_Off, _Off + _Count)
- ; 1318 : if (this->_Mysize < _Off)
- ; 1319 : _Xran(); // _Off off end
- ; 1320 : if (this->_Mysize - _Off <= _Count)
- ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
- ; 1322 : else if (0 < _Count)
- ; 1323 : { // move elements down
- ; 1324 : value_type *_Ptr = this->_Myptr() + _Off;
- ; 1325 : size_type _Newsize = this->_Mysize - _Count;
- ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
- ; 1327 : _Eos(_Newsize);
- ; 1328 : }
- ; 1329 : return (*this);
- ; 1330 : }
- ; 1331 :
- ; 1332 : iterator erase(const_iterator _Where)
- ; 1333 : { // erase element at _Where
- ; 1334 : size_type _Count = _Pdif(_Where, begin());
- ; 1335 : erase(_Count, 1);
- ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1337 : }
- ; 1338 :
- ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
- ; 1340 : { // erase substring [_First, _Last)
- ; 1341 : _DEBUG_RANGE(_First, _Last);
- ; 1342 : size_type _Count = _Pdif(_First, begin());
- ; 1343 : erase(_Count, _Pdif(_Last, _First));
- ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1345 : }
- ; 1346 :
- ; 1347 : void clear() _NOEXCEPT
- ; 1348 : { // erase all
- ; 1349 : _Eos(0);
- ; 1350 : }
- ; 1351 :
- ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
- ; 1353 : { // replace [_Off, _Off + _N0) with _Right
- ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
- ; 1355 : }
- ; 1356 :
- ; 1357 : _Myt& replace(size_type _Off,
- ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
- ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
- ; 1361 : _Xran(); // _Off or _Roff off end
- ; 1362 : if (this->_Mysize - _Off < _N0)
- ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1364 : size_type _Num = _Right.size() - _Roff;
- ; 1365 : if (_Num < _Count)
- ; 1366 : _Count = _Num; // trim _Count to size
- ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1368 : _Xlen(); // result too long
- ; 1369 :
- ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
- ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
- ; 1372 : if (this->_Mysize < _Newsize)
- ; 1373 : _Grow(_Newsize);
- ; 1374 :
- ; 1375 : if (this != &_Right)
- ; 1376 : { // no overlap, just move down and copy in new stuff
- ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
- ; 1379 : _Traits::copy(this->_Myptr() + _Off,
- ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
- ; 1381 : }
- ; 1382 : else if (_Count <= _N0)
- ; 1383 : { // hole doesn't get larger, just copy in substring
- ; 1384 : _Traits::move(this->_Myptr() + _Off,
- ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1388 : }
- ; 1389 : else if (_Roff <= _Off)
- ; 1390 : { // hole gets larger, substring begins before hole
- ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1393 : _Traits::move(this->_Myptr() + _Off,
- ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1395 : }
- ; 1396 : else if (_Off + _N0 <= _Roff)
- ; 1397 : { // hole gets larger, substring begins after hole
- ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1400 : _Traits::move(this->_Myptr() + _Off,
- ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
- ; 1402 : _Count); // fill hole
- ; 1403 : }
- ; 1404 : else
- ; 1405 : { // hole gets larger, substring begins in hole
- ; 1406 : _Traits::move(this->_Myptr() + _Off,
- ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
- ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
- ; 1411 : this->_Myptr() + _Roff + _Count,
- ; 1412 : _Count - _N0); // fill rest of new hole
- ; 1413 : }
- ; 1414 :
- ; 1415 : _Eos(_Newsize);
- ; 1416 : return (*this);
- ; 1417 : }
- ; 1418 :
- ; 1419 : _Myt& replace(size_type _Off,
- ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
- ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1423 : if (_Count != 0)
- ; 1424 : _DEBUG_POINTER(_Ptr);
- ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1426 :
- ; 1427 : if (_Inside(_Ptr))
- ; 1428 : return (replace(_Off, _N0, *this,
- ; 1429 : _Ptr - this->_Myptr(),
- ; 1430 : _Count)); // substring, replace carefully
- ; 1431 : if (this->_Mysize < _Off)
- ; 1432 : _Xran(); // _Off off end
- ; 1433 : if (this->_Mysize - _Off < _N0)
- ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1436 : _Xlen(); // result too long
- ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1438 :
- ; 1439 : if (_Count < _N0)
- ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1441 : this->_Myptr() + _Off + _N0,
- ; 1442 : _Nm); // smaller hole, move tail up
- ; 1443 : size_type _Num;
- ; 1444 : if ((0 < _Count || 0 < _N0)
- ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1446 : { // make room and rearrange
- ; 1447 : if (_N0 < _Count)
- ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
- ; 1451 : _Eos(_Num);
- ; 1452 : }
- ; 1453 : return (*this);
- ; 1454 : }
- ; 1455 :
- ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
- ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 1458 : _DEBUG_POINTER(_Ptr);
- ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 1460 : }
- ; 1461 :
- ; 1462 : _Myt& replace(size_type _Off,
- ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
- ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
- ; 1465 : if (this->_Mysize < _Off)
- ; 1466 : _Xran(); // _Off off end
- ; 1467 : if (this->_Mysize - _Off < _N0)
- ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1470 : _Xlen(); // result too long
- ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1472 :
- ; 1473 : if (_Count < _N0)
- ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1475 : this->_Myptr() + _Off + _N0,
- ; 1476 : _Nm); // smaller hole, move tail up
- ; 1477 : size_type _Num;
- ; 1478 : if ((0 < _Count || 0 < _N0)
- ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1480 : { // make room and rearrange
- ; 1481 : if (_N0 < _Count)
- ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
- ; 1485 : _Eos(_Num);
- ; 1486 : }
- ; 1487 : return (*this);
- ; 1488 : }
- ; 1489 :
- ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1491 : const _Myt& _Right)
- ; 1492 : { // replace [_First, _Last) with _Right
- ; 1493 : return (replace(
- ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
- ; 1495 : }
- ; 1496 :
- ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1498 : const _Elem *_Ptr, size_type _Count)
- ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
- ; 1500 : return (replace(
- ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
- ; 1502 : }
- ; 1503 :
- ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1505 : const _Elem *_Ptr)
- ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
- ; 1507 : return (replace(
- ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
- ; 1509 : }
- ; 1510 :
- ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1512 : size_type _Count, _Elem _Ch)
- ; 1513 : { // replace [_First, _Last) with _Count * _Ch
- ; 1514 : return (replace(
- ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
- ; 1516 : }
- ; 1517 :
- ; 1518 : template<class _Iter>
- ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1520 : _Myt&>::type
- ; 1521 : replace(const_iterator _First, const_iterator _Last,
- ; 1522 : _Iter _First2, _Iter _Last2)
- ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
- ; 1524 : _Myt _Right(_First2, _Last2);
- ; 1525 : replace(_First, _Last, _Right);
- ; 1526 : return (*this);
- ; 1527 : }
- ; 1528 :
- ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1530 : const_pointer _First2, const_pointer _Last2)
- ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1532 : if (_First2 == _Last2)
- ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1534 : else
- ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1536 : &*_First2, _Last2 - _First2);
- ; 1537 : return (*this);
- ; 1538 : }
- ; 1539 :
- ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1541 : pointer _First2, pointer _Last2)
- ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1543 : if (_First2 == _Last2)
- ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1545 : else
- ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1547 : &*_First2, _Last2 - _First2);
- ; 1548 : return (*this);
- ; 1549 : }
- ; 1550 :
- ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1552 : const_iterator _First2, const_iterator _Last2)
- ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1554 : if (_First2 == _Last2)
- ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1556 : else
- ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1558 : &*_First2, _Last2 - _First2);
- ; 1559 : return (*this);
- ; 1560 : }
- ; 1561 :
- ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1563 : iterator _First2, iterator _Last2)
- ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1565 : if (_First2 == _Last2)
- ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1567 : else
- ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1569 : &*_First2, _Last2 - _First2);
- ; 1570 : return (*this);
- ; 1571 : }
- ; 1572 :
- ; 1573 : iterator begin() _NOEXCEPT
- ; 1574 : { // return iterator for beginning of mutable sequence
- ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
- ; 1576 : }
- ; 1577 :
- ; 1578 : const_iterator begin() const _NOEXCEPT
- ; 1579 : { // return iterator for beginning of nonmutable sequence
- ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
- ; 1581 : }
- ; 1582 :
- ; 1583 : iterator end() _NOEXCEPT
- ; 1584 : { // return iterator for end of mutable sequence
- ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1586 : }
- ; 1587 :
- ; 1588 : const_iterator end() const _NOEXCEPT
- ; 1589 : { // return iterator for end of nonmutable sequence
- ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1591 : }
- ; 1592 :
- ; 1593 : reverse_iterator rbegin() _NOEXCEPT
- ; 1594 : { // return iterator for beginning of reversed mutable sequence
- ; 1595 : return (reverse_iterator(end()));
- ; 1596 : }
- ; 1597 :
- ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
- ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1600 : return (const_reverse_iterator(end()));
- ; 1601 : }
- ; 1602 :
- ; 1603 : reverse_iterator rend() _NOEXCEPT
- ; 1604 : { // return iterator for end of reversed mutable sequence
- ; 1605 : return (reverse_iterator(begin()));
- ; 1606 : }
- ; 1607 :
- ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
- ; 1609 : { // return iterator for end of reversed nonmutable sequence
- ; 1610 : return (const_reverse_iterator(begin()));
- ; 1611 : }
- ; 1612 :
- ; 1613 : #if _HAS_CPP0X
- ; 1614 : const_iterator cbegin() const _NOEXCEPT
- ; 1615 : { // return iterator for beginning of nonmutable sequence
- ; 1616 : return (((const _Myt *)this)->begin());
- ; 1617 : }
- ; 1618 :
- ; 1619 : const_iterator cend() const _NOEXCEPT
- ; 1620 : { // return iterator for end of nonmutable sequence
- ; 1621 : return (((const _Myt *)this)->end());
- ; 1622 : }
- ; 1623 :
- ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
- ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1626 : return (((const _Myt *)this)->rbegin());
- ; 1627 : }
- ; 1628 :
- ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
- ; 1630 : { // return iterator for end of reversed nonmutable sequence
- ; 1631 : return (((const _Myt *)this)->rend());
- ; 1632 : }
- ; 1633 :
- ; 1634 : void shrink_to_fit()
- ; 1635 : { // reduce capacity
- ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
- ; 1637 : { // worth shrinking, do it
- ; 1638 : _Myt _Tmp(*this);
- ; 1639 : swap(_Tmp);
- ; 1640 : }
- ; 1641 : }
- ; 1642 : #endif /* _HAS_CPP0X */
- ; 1643 :
- ; 1644 : reference at(size_type _Off)
- ; 1645 : { // subscript mutable sequence with checking
- ; 1646 : if (this->_Mysize <= _Off)
- ; 1647 : _Xran(); // _Off off end
- ; 1648 : return (this->_Myptr()[_Off]);
- ; 1649 : }
- ; 1650 :
- ; 1651 : const_reference at(size_type _Off) const
- ; 1652 : { // subscript nonmutable sequence with checking
- ; 1653 : if (this->_Mysize <= _Off)
- ; 1654 : _Xran(); // _Off off end
- ; 1655 : return (this->_Myptr()[_Off]);
- ; 1656 : }
- ; 1657 :
- ; 1658 : reference operator[](size_type _Off)
- ; 1659 : { // subscript mutable sequence
- ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1661 : if (this->_Mysize < _Off) // sic
- ; 1662 : _DEBUG_ERROR("string subscript out of range");
- ; 1663 :
- ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1667 :
- ; 1668 : return (this->_Myptr()[_Off]);
- ; 1669 : }
- ; 1670 :
- ; 1671 : const_reference operator[](size_type _Off) const
- ; 1672 : { // subscript nonmutable sequence
- ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1674 : if (this->_Mysize < _Off) // sic
- ; 1675 : _DEBUG_ERROR("string subscript out of range");
- ; 1676 :
- ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1680 :
- ; 1681 : return (this->_Myptr()[_Off]);
- ; 1682 : }
- ; 1683 :
- ; 1684 : void push_back(_Elem _Ch)
- ; 1685 : { // insert element at end
- ; 1686 : insert(end(), _Ch);
- ; 1687 : }
- ; 1688 :
- ; 1689 : #if _HAS_CPP0X
- ; 1690 : void pop_back()
- ; 1691 : { // erase element at end
- ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
- ; 1693 : }
- ; 1694 :
- ; 1695 : reference front()
- ; 1696 : { // return first element of mutable sequence
- ; 1697 : return (*begin());
- ; 1698 : }
- ; 1699 :
- ; 1700 : const_reference front() const
- ; 1701 : { // return first element of nonmutable sequence
- ; 1702 : return (*begin());
- ; 1703 : }
- ; 1704 :
- ; 1705 : reference back()
- ; 1706 : { // return last element of mutable sequence
- ; 1707 : return (*(end() - 1));
- ; 1708 : }
- ; 1709 :
- ; 1710 : const_reference back() const
- ; 1711 : { // return last element of nonmutable sequence
- ; 1712 : return (*(end() - 1));
- ; 1713 : }
- ; 1714 : #endif /* _HAS_CPP0X */
- ; 1715 :
- ; 1716 : const _Elem *c_str() const _NOEXCEPT
- ; 1717 : { // return pointer to null-terminated nonmutable array
- ; 1718 : return (this->_Myptr());
- ; 1719 : }
- ; 1720 :
- ; 1721 : const _Elem *data() const _NOEXCEPT
- ; 1722 : { // return pointer to nonmutable array
- ; 1723 : return (c_str());
- ; 1724 : }
- ; 1725 :
- ; 1726 : size_type length() const _NOEXCEPT
- ; 1727 : { // return length of sequence
- ; 1728 : return (this->_Mysize);
- ; 1729 : }
- ; 1730 :
- ; 1731 : size_type size() const _NOEXCEPT
- ; 1732 : { // return length of sequence
- ; 1733 : return (this->_Mysize);
- ; 1734 : }
- ; 1735 :
- ; 1736 : size_type max_size() const _NOEXCEPT
- ; 1737 : { // return maximum possible length of sequence
- ; 1738 : size_type _Num = this->_Getal().max_size();
- ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
- ; 1740 : }
- ; 1741 :
- ; 1742 : void resize(size_type _Newsize)
- ; 1743 : { // determine new length, padding with null elements as needed
- ; 1744 : resize(_Newsize, _Elem());
- ; 1745 : }
- ; 1746 :
- ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
- ; 1748 : { // determine new length, padding with _Ch elements as needed
- ; 1749 : if (_Newsize <= this->_Mysize)
- ; 1750 : _Eos(_Newsize);
- ; 1751 : else
- ; 1752 : append(_Newsize - this->_Mysize, _Ch);
- ; 1753 : }
- ; 1754 :
- ; 1755 : size_type capacity() const _NOEXCEPT
- ; 1756 : { // return current length of allocated storage
- ; 1757 : return (this->_Myres);
- ; 1758 : }
- ; 1759 :
- ; 1760 : void reserve(size_type _Newcap = 0)
- ; 1761 : { // determine new minimum length of allocated storage
- ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
- ; 1763 : { // change reservation
- ; 1764 : size_type _Size = this->_Mysize;
- ; 1765 : if (_Grow(_Newcap, true))
- ; 1766 : _Eos(_Size);
- ; 1767 : }
- ; 1768 : }
- ; 1769 :
- ; 1770 : bool empty() const _NOEXCEPT
- ; 1771 : { // test if sequence is empty
- ; 1772 : return (this->_Mysize == 0);
- ; 1773 : }
- ; 1774 :
- ; 1775 : _SCL_INSECURE_DEPRECATE
- ; 1776 :
- ; 1777 : size_type copy(_Elem *_Ptr,
- ; 1778 : size_type _Count, size_type _Off = 0) const
- ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
- ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1781 : if (_Count != 0)
- ; 1782 : _DEBUG_POINTER(_Ptr);
- ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1784 :
- ; 1785 : if (this->_Mysize < _Off)
- ; 1786 : _Xran(); // _Off off end
- ; 1787 : if (this->_Mysize - _Off < _Count)
- ; 1788 : _Count = this->_Mysize - _Off;
- ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
- ; 1790 : return (_Count);
- ; 1791 : }
- ; 1792 :
- ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
- ; 1794 : size_type _Count, size_type _Off = 0) const
- ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
- ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1797 : if (_Count != 0)
- ; 1798 : _DEBUG_POINTER(_Dest);
- ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1800 :
- ; 1801 : if (this->_Mysize < _Off)
- ; 1802 : _Xran(); // _Off off end
- ; 1803 : if (this->_Mysize - _Off < _Count)
- ; 1804 : _Count = this->_Mysize - _Off;
- ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
- ; 1806 : return (_Count);
- ; 1807 : }
- ; 1808 :
- ; 1809 : void _Swap_bx(_Myt& _Right)
- ; 1810 : { // exchange _Bx with _Right._Bx
- ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
- ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
- ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
- ; 1814 : else
- ; 1815 : { // swap large with small
- ; 1816 : pointer _Ptr = this->_Bx._Ptr;
- ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 1818 : _Traits::copy(this->_Bx._Buf,
- ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
- ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
- ; 1821 : }
- ; 1822 : else
- ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
- ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
- ; 1825 : else
- ; 1826 : { // swap small with large
- ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
- ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
- ; 1829 : _Traits::copy(_Right._Bx._Buf,
- ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
- ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 1832 : }
- ; 1833 : }
- ; 1834 :
- ; 1835 : void swap(_Myt& _Right)
- ; 1836 : { // exchange contents with _Right
- ; 1837 : if (this == &_Right)
- ; 1838 : ; // same object, do nothing
- ; 1839 : else if (this->_Getal() == _Right._Getal())
- ; 1840 : { // same allocator, swap control information
- ; 1841 : this->_Swap_all(_Right);
- ; 1842 : _Swap_bx(_Right);
- ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1844 : _STD swap(this->_Myres, _Right._Myres);
- ; 1845 : }
- ; 1846 :
- ; 1847 : #if _HAS_CPP0X
- ; 1848 : else if (_Alty::propagate_on_container_swap::value)
- ; 1849 : { // swap allocators and control information
- ; 1850 : this->_Swap_alloc(_Right);
- ; 1851 : _Swap_bx(_Right);
- ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
- ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1854 : _STD swap(this->_Myres, _Right._Myres);
- ; 1855 : }
- ; 1856 : #endif /* _HAS_CPP0X */
- ; 1857 :
- ; 1858 : else
- ; 1859 : { // different allocator, do multiple assigns
- ; 1860 : _Myt _Tmp = *this;
- ; 1861 :
- ; 1862 : *this = _Right;
- ; 1863 : _Right = _Tmp;
- ; 1864 : }
- ; 1865 : }
- ; 1866 :
- ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
- ; 1868 : { // look for _Right beginning at or after _Off
- ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
- ; 1870 : }
- ; 1871 :
- ; 1872 : size_type find(const _Elem *_Ptr,
- ; 1873 : size_type _Off, size_type _Count) const
- ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
- ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1876 : if (_Count != 0)
- ; 1877 : _DEBUG_POINTER(_Ptr);
- ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1879 :
- ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
- ; 1881 : return (_Off); // null string always matches (if inside string)
- ; 1882 :
- ; 1883 : size_type _Nm;
- ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
- ; 1885 : { // room for match, look for it
- ; 1886 : const _Elem *_Uptr, *_Vptr;
- ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
- ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
- ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
- ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1891 : return (_Uptr - this->_Myptr()); // found a match
- ; 1892 : }
- ; 1893 :
- ; 1894 : return (npos); // no match
- ; 1895 : }
- ; 1896 :
- ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
- ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
- ; 1899 : _DEBUG_POINTER(_Ptr);
- ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1901 : }
- ; 1902 :
- ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
- ; 1904 : { // look for _Ch at or after _Off
- ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1906 : }
- ; 1907 :
- ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
- ; 1909 : { // look for _Right beginning before _Off
- ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
- ; 1911 : }
- ; 1912 :
- ; 1913 : size_type rfind(const _Elem *_Ptr,
- ; 1914 : size_type _Off, size_type _Count) const
- ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
- ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1917 : if (_Count != 0)
- ; 1918 : _DEBUG_POINTER(_Ptr);
- ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1920 :
- ; 1921 : if (_Count == 0)
- ; 1922 : return (_Off < this->_Mysize ? _Off
- ; 1923 : : this->_Mysize); // null always matches
- ; 1924 : if (_Count <= this->_Mysize)
- ; 1925 : { // room for match, look for it
- ; 1926 : const _Elem *_Uptr = this->_Myptr() +
- ; 1927 : (_Off < this->_Mysize - _Count ? _Off
- ; 1928 : : this->_Mysize - _Count);
- ; 1929 : for (; ; --_Uptr)
- ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
- ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1932 : return (_Uptr - this->_Myptr()); // found a match
- ; 1933 : else if (_Uptr == this->_Myptr())
- ; 1934 : break; // at beginning, no more chance for match
- ; 1935 : }
- ; 1936 :
- ; 1937 : return (npos); // no match
- ; 1938 : }
- ; 1939 :
- ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
- ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
- ; 1942 : _DEBUG_POINTER(_Ptr);
- ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1944 : }
- ; 1945 :
- ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
- ; 1947 : { // look for _Ch before _Off
- ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 1949 : }
- ; 1950 :
- ; 1951 : size_type find_first_of(const _Myt& _Right,
- ; 1952 : size_type _Off = 0) const _NOEXCEPT
- ; 1953 : { // look for one of _Right at or after _Off
- ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1955 : }
- ; 1956 :
- ; 1957 : size_type find_first_of(const _Elem *_Ptr,
- ; 1958 : size_type _Off, size_type _Count) const
- ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
- ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1961 : if (_Count != 0)
- ; 1962 : _DEBUG_POINTER(_Ptr);
- ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1964 :
- ; 1965 : if (0 < _Count && _Off < this->_Mysize)
- ; 1966 : { // room for match, look for it
- ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 1969 : _Uptr < _Vptr; ++_Uptr)
- ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 1971 : return (_Uptr - this->_Myptr()); // found a match
- ; 1972 : }
- ; 1973 :
- ; 1974 : return (npos); // no match
- ; 1975 : }
- ; 1976 :
- ; 1977 : size_type find_first_of(const _Elem *_Ptr,
- ; 1978 : size_type _Off = 0) const
- ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 1980 : _DEBUG_POINTER(_Ptr);
- ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1982 : }
- ; 1983 :
- ; 1984 : size_type find_first_of(_Elem _Ch,
- ; 1985 : size_type _Off = 0) const
- ; 1986 : { // look for _Ch at or after _Off
- ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1988 : }
- ; 1989 :
- ; 1990 : size_type find_last_of(const _Myt& _Right,
- ; 1991 : size_type _Off = npos) const _NOEXCEPT
- ; 1992 : { // look for one of _Right before _Off
- ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1994 : }
- ; 1995 :
- ; 1996 : size_type find_last_of(const _Elem *_Ptr,
- ; 1997 : size_type _Off, size_type _Count) const
- ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
- ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2000 : if (_Count != 0)
- ; 2001 : _DEBUG_POINTER(_Ptr);
- ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2003 :
- ; 2004 : if (0 < _Count && 0 < this->_Mysize)
- ; 2005 : { // worth searching, do it
- ; 2006 : const _Elem *_Uptr = this->_Myptr()
- ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2008 : for (; ; --_Uptr)
- ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 2010 : return (_Uptr - this->_Myptr()); // found a match
- ; 2011 : else if (_Uptr == this->_Myptr())
- ; 2012 : break; // at beginning, no more chance for match
- ; 2013 : }
- ; 2014 :
- ; 2015 : return (npos); // no match
- ; 2016 : }
- ; 2017 :
- ; 2018 : size_type find_last_of(const _Elem *_Ptr,
- ; 2019 : size_type _Off = npos) const
- ; 2020 : { // look for one of [_Ptr, <null>) before _Off
- ; 2021 : _DEBUG_POINTER(_Ptr);
- ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2023 : }
- ; 2024 :
- ; 2025 : size_type find_last_of(_Elem _Ch,
- ; 2026 : size_type _Off = npos) const
- ; 2027 : { // look for _Ch before _Off
- ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 2029 : }
- ; 2030 :
- ; 2031 : size_type find_first_not_of(const _Myt& _Right,
- ; 2032 : size_type _Off = 0) const _NOEXCEPT
- ; 2033 : { // look for none of _Right at or after _Off
- ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
- ; 2035 : _Right.size()));
- ; 2036 : }
- ; 2037 :
- ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2039 : size_type _Off, size_type _Count) const
- ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
- ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2042 : if (_Count != 0)
- ; 2043 : _DEBUG_POINTER(_Ptr);
- ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2045 :
- ; 2046 : if (_Off < this->_Mysize)
- ; 2047 : { // room for match, look for it
- ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 2050 : _Uptr < _Vptr; ++_Uptr)
- ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2052 : return (_Uptr - this->_Myptr());
- ; 2053 : }
- ; 2054 : return (npos);
- ; 2055 : }
- ; 2056 :
- ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2058 : size_type _Off = 0) const
- ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 2060 : _DEBUG_POINTER(_Ptr);
- ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2062 : }
- ; 2063 :
- ; 2064 : size_type find_first_not_of(_Elem _Ch,
- ; 2065 : size_type _Off = 0) const
- ; 2066 : { // look for non _Ch at or after _Off
- ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2068 : }
- ; 2069 :
- ; 2070 : size_type find_last_not_of(const _Myt& _Right,
- ; 2071 : size_type _Off = npos) const _NOEXCEPT
- ; 2072 : { // look for none of _Right before _Off
- ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
- ; 2074 : }
- ; 2075 :
- ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2077 : size_type _Off, size_type _Count) const
- ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
- ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2080 : if (_Count != 0)
- ; 2081 : _DEBUG_POINTER(_Ptr);
- ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2083 :
- ; 2084 : if (0 < this->_Mysize)
- ; 2085 : { // worth searching, do it
- ; 2086 : const _Elem *_Uptr = this->_Myptr()
- ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2088 : for (; ; --_Uptr)
- ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2090 : return (_Uptr - this->_Myptr());
- ; 2091 : else if (_Uptr == this->_Myptr())
- ; 2092 : break;
- ; 2093 : }
- ; 2094 : return (npos);
- ; 2095 : }
- ; 2096 :
- ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2098 : size_type _Off = npos) const
- ; 2099 : { // look for none of [_Ptr, <null>) before _Off
- ; 2100 : _DEBUG_POINTER(_Ptr);
- ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2102 : }
- ; 2103 :
- ; 2104 : size_type find_last_not_of(_Elem _Ch,
- ; 2105 : size_type _Off = npos) const
- ; 2106 : { // look for non _Ch before _Off
- ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2108 : }
- ; 2109 :
- ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
- ; 2111 : { // return [_Off, _Off + _Count) as new string
- ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
- ; 2113 : }
- ; 2114 :
- ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
- ; 2116 : { // compare [0, _Mysize) with _Right
- ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
- ; 2118 : }
- ; 2119 :
- ; 2120 : int compare(size_type _Off, size_type _N0,
- ; 2121 : const _Myt& _Right) const
- ; 2122 : { // compare [_Off, _Off + _N0) with _Right
- ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
- ; 2124 : }
- ; 2125 :
- ; 2126 : int compare(size_type _Off,
- ; 2127 : size_type _N0, const _Myt& _Right,
- ; 2128 : size_type _Roff, size_type _Count) const
- ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 2130 : if (_Right.size() < _Roff)
- ; 2131 : _Xran(); // _Off off end
- ; 2132 : if (_Right._Mysize - _Roff < _Count)
- ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
- ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
- ; 2135 : }
- ; 2136 :
- ; 2137 : int compare(const _Elem *_Ptr) const
- ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
- ; 2139 : _DEBUG_POINTER(_Ptr);
- ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
- ; 2141 : }
- ; 2142 :
- ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
- ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 2145 : _DEBUG_POINTER(_Ptr);
- ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 2147 : }
- ; 2148 :
- ; 2149 : int compare(size_type _Off,
- ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
- ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2153 : if (_Count != 0)
- ; 2154 : _DEBUG_POINTER(_Ptr);
- ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2156 :
- ; 2157 : if (this->_Mysize < _Off)
- ; 2158 : _Xran(); // _Off off end
- ; 2159 : if (this->_Mysize - _Off < _N0)
- ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 2161 :
- ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
- ; 2163 : _N0 < _Count ? _N0 : _Count);
- ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
- ; 2165 : : _N0 == _Count ? 0 : +1);
- ; 2166 : }
- ; 2167 :
- ; 2168 : allocator_type get_allocator() const _NOEXCEPT
- ; 2169 : { // return allocator object for values
- ; 2170 : return (this->_Getal());
- ; 2171 : }
- ; 2172 :
- ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
- ; 2174 : { // assign _Count copies of _Ch beginning at _Off
- ; 2175 : if (_Count == 1)
- ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
- ; 2177 : else
- ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
- ; 2179 : }
- ; 2180 :
- ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
- ; 2182 : { // copy _Oldlen elements to newly allocated buffer
- ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
- ; 2184 : if (max_size() < _Newres)
- ; 2185 : _Newres = _Newsize; // undo roundup if too big
- ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
- ; 2187 : ;
- ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
- ; 2189 : _Newres = this->_Myres
- ; 2190 : + this->_Myres / 2; // grow exponentially if possible
- ; 2191 : else
- ; 2192 : _Newres = max_size(); // settle for max_size()
- ; 2193 :
- ; 2194 : _Elem *_Ptr;
- ; 2195 : _TRY_BEGIN
- ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2197 : _CATCH_ALL
- ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
- ; 2199 : _TRY_BEGIN
- ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2201 : _CATCH_ALL
- ; 2202 : _Tidy(true); // failed again, discard storage and reraise
- ; 2203 : _RERAISE;
- ; 2204 : _CATCH_END
- ; 2205 : _CATCH_END
- ; 2206 :
- ; 2207 : if (0 < _Oldlen)
- ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
- ; 2209 : _Oldlen); // copy existing elements
- ; 2210 : _Tidy(true);
- ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 2212 : this->_Myres = _Newres;
- ; 2213 : _Eos(_Oldlen);
- ; 2214 : }
- ; 2215 :
- ; 2216 : void _Eos(size_type _Newsize)
- ; 2217 : { // set new length and null terminator
- ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
- mov DWORD PTR [esi+16], edi
- ; 517 : : this->_Bx._Buf);
- jb SHORT $LN51@assign
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov eax, DWORD PTR [esi]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax+edi], 0
- pop edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1119 : return (*this);
- mov eax, esi
- pop esi
- pop ebx
- ; 1120 : }
- pop ebp
- ret 12 ; 0000000cH
- $LN51@assign:
- ; 517 : : this->_Bx._Buf);
- mov eax, esi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax+edi], 0
- $LN55@assign:
- pop edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1119 : return (*this);
- mov eax, esi
- pop esi
- pop ebx
- ; 1120 : }
- pop ebp
- ret 12 ; 0000000cH
- $LN58@assign:
- ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE_NI_N@Z
- _TEXT SEGMENT
- __Newsize$ = 8 ; size = 4
- __Trim$dead$ = 12 ; size = 1
- ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE_NI_N@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Grow, COMDAT
- ; _this$ = ecx
- ; 2223 : { // ensure buffer is big enough, trim to size if _Trim is true
- push ebp
- mov ebp, esp
- push esi
- ; 2224 : if (max_size() < _Newsize)
- mov esi, DWORD PTR __Newsize$[ebp]
- cmp esi, -2 ; fffffffeH
- jbe SHORT $LN6@Grow
- ; 2235 :
- ; 2236 : bool _Inside(const _Elem *_Ptr)
- ; 2237 : { // test if _Ptr points inside string
- ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
- ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
- ; 2240 : return (false); // don't ask
- ; 2241 : else
- ; 2242 : return (true);
- ; 2243 : }
- ; 2244 :
- ; 2245 : static size_type _Pdif(const_iterator _P2,
- ; 2246 : const_iterator _P1)
- ; 2247 : { // compute safe iterator difference
- ; 2248 : return (_STRING_ITER_BASE(_P2) == 0 ? 0 : _P2 - _P1);
- ; 2249 : }
- ; 2250 :
- ; 2251 : void _Tidy(bool _Built = false,
- ; 2252 : size_type _Newsize = 0)
- ; 2253 : { // initialize buffer, deallocating any storage
- ; 2254 : if (!_Built)
- ; 2255 : ;
- ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
- ; 2257 : { // copy any leftovers to small buffer and deallocate
- ; 2258 : pointer _Ptr = this->_Bx._Ptr;
- ; 2259 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 2260 : if (0 < _Newsize)
- ; 2261 : _Traits::copy(this->_Bx._Buf,
- ; 2262 : _STD addressof(*_Ptr), _Newsize);
- ; 2263 : this->_Getal().deallocate(_Ptr, this->_Myres + 1);
- ; 2264 : }
- ; 2265 : this->_Myres = this->_BUF_SIZE - 1;
- ; 2266 : _Eos(_Newsize);
- ; 2267 : }
- ; 2268 :
- ; 2269 : __declspec(noreturn) void _Xlen() const
- ; 2270 : { // report a length_error
- ; 2271 : _Xlength_error("string too long");
- push OFFSET ??_C@_0BA@JFNIOLAK@string?5too?5long?$AA@
- call DWORD PTR __imp_?_Xlength_error@std@@YAXPBD@Z
- $LN68@Grow:
- $LN6@Grow:
- ; 2225 : _Xlen(); // result too long
- ; 2226 : if (this->_Myres < _Newsize)
- mov eax, DWORD PTR [ecx+20]
- cmp eax, esi
- jae SHORT $LN3@Grow
- ; 2227 : _Copy(_Newsize, this->_Mysize); // reallocate to grow
- push DWORD PTR [ecx+16]
- push esi
- call ?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy
- ; 2233 : return (0 < _Newsize); // return true only if more work to do
- xor eax, eax
- cmp eax, esi
- sbb eax, eax
- neg eax
- pop esi
- ; 2234 : }
- pop ebp
- ret 8
- $LN3@Grow:
- ; 2228 : else if (_Trim && _Newsize < this->_BUF_SIZE)
- ; 2229 : _Tidy(true, // copy and deallocate if trimming to small string
- ; 2230 : _Newsize < this->_Mysize ? _Newsize : this->_Mysize);
- ; 2231 : else if (_Newsize == 0)
- test esi, esi
- jne SHORT $LN64@Grow
- ; 518 : }
- ; 519 :
- ; 520 : const value_type *_Myptr() const
- ; 521 : { // determine current pointer to buffer for nonmutable string
- ; 522 : return (this->_BUF_SIZE <= this->_Myres
- ; 523 : ? _STD addressof(*this->_Bx._Ptr)
- ; 524 : : this->_Bx._Buf);
- ; 525 : }
- ; 526 :
- ; 527 : union _Bxty
- ; 528 : { // storage for small buffer or pointer to larger one
- ; 529 : value_type _Buf[_BUF_SIZE];
- ; 530 : pointer _Ptr;
- ; 531 : char _Alias[_BUF_SIZE]; // to permit aliasing
- ; 532 : } _Bx;
- ; 533 :
- ; 534 : size_type _Mysize; // current length of string
- ; 535 : size_type _Myres; // current storage reserved for string
- ; 536 : };
- ; 537 :
- ; 538 : // TEMPLATE CLASS _String_alloc
- ; 539 : template<bool _Al_has_storage,
- ; 540 : class _Alloc_types>
- ; 541 : class _String_alloc
- ; 542 : : public _String_val<typename _Alloc_types::_Val_types>
- ; 543 : { // base class for basic_string to hold allocator with storage
- ; 544 : public:
- ; 545 : typedef _String_alloc<_Al_has_storage, _Alloc_types> _Myt;
- ; 546 : typedef typename _Alloc_types::_Alloc _Alloc;
- ; 547 :
- ; 548 : typedef typename _Alloc_types::_Alty _Alty;
- ; 549 :
- ; 550 : #if _ITERATOR_DEBUG_LEVEL == 0
- ; 551 : _String_alloc(const _Alloc& _Al = _Alloc())
- ; 552 : : _Alval(_Al)
- ; 553 : { // construct allocator from _Al
- ; 554 : }
- ; 555 :
- ; 556 : void _Change_alloc(const _Alty& _Al)
- ; 557 : { // replace old allocator
- ; 558 : _Alval = _Al;
- ; 559 : }
- ; 560 :
- ; 561 : void _Swap_alloc(_Myt& _Right)
- ; 562 : { // swap allocators
- ; 563 : _Swap_adl(this->_Alval, _Right._Alval);
- ; 564 : }
- ; 565 :
- ; 566 : #else /* _ITERATOR_DEBUG_LEVEL == 0 */
- ; 567 : _String_alloc(const _Alloc& _Al = _Alloc())
- ; 568 : : _Alval(_Al)
- ; 569 : { // construct allocator from _Al
- ; 570 : _Alloc_proxy();
- ; 571 : }
- ; 572 :
- ; 573 : ~_String_alloc() _NOEXCEPT
- ; 574 : { // destroy the object
- ; 575 : _Free_proxy();
- ; 576 : }
- ; 577 :
- ; 578 : void _Change_alloc(const _Alty& _Al)
- ; 579 : { // replace old allocator
- ; 580 : _Free_proxy();
- ; 581 : _Alval = _Al;
- ; 582 : _Alloc_proxy();
- ; 583 : }
- ; 584 :
- ; 585 : void _Swap_alloc(_Myt& _Right)
- ; 586 : { // swap allocators
- ; 587 : _Swap_adl(_Alval, _Right._Alval);
- ; 588 : _Swap_adl(this->_Myproxy, _Right._Myproxy);
- ; 589 : }
- ; 590 :
- ; 591 : void _Alloc_proxy()
- ; 592 : { // construct proxy from _Alval
- ; 593 : typename _Alloc::template rebind<_Container_proxy>::other
- ; 594 : _Alproxy(_Alval);
- ; 595 : this->_Myproxy = _Alproxy.allocate(1);
- ; 596 : _Alproxy.construct(this->_Myproxy, _Container_proxy());
- ; 597 : this->_Myproxy->_Mycont = this;
- ; 598 : }
- ; 599 :
- ; 600 : void _Free_proxy()
- ; 601 : { // destroy proxy
- ; 602 : typename _Alloc::template rebind<_Container_proxy>::other
- ; 603 : _Alproxy(_Alval);
- ; 604 : this->_Orphan_all();
- ; 605 : _Alproxy.destroy(this->_Myproxy);
- ; 606 : _Alproxy.deallocate(this->_Myproxy, 1);
- ; 607 : this->_Myproxy = 0;
- ; 608 : }
- ; 609 : #endif /* _ITERATOR_DEBUG_LEVEL == 0 */
- ; 610 :
- ; 611 : _Alty& _Getal()
- ; 612 : { // get reference to allocator
- ; 613 : return (_Alval);
- ; 614 : }
- ; 615 :
- ; 616 : const _Alty& _Getal() const
- ; 617 : { // get reference to allocator
- ; 618 : return (_Alval);
- ; 619 : }
- ; 620 :
- ; 621 : _Alty _Alval; // allocator object for strings
- ; 622 : };
- ; 623 :
- ; 624 : template<class _Alloc_types>
- ; 625 : class _String_alloc<false, _Alloc_types>
- ; 626 : : public _String_val<typename _Alloc_types::_Val_types>
- ; 627 : { // base class for basic_string to hold allocator with no storage
- ; 628 : public:
- ; 629 : typedef _String_alloc<false, _Alloc_types> _Myt;
- ; 630 : typedef typename _Alloc_types::_Alloc _Alloc;
- ; 631 :
- ; 632 : typedef typename _Alloc_types::_Alty _Alty;
- ; 633 :
- ; 634 : #if _ITERATOR_DEBUG_LEVEL == 0
- ; 635 : _String_alloc(const _Alloc& = _Alloc())
- ; 636 : { // construct allocator from _Al
- ; 637 : }
- ; 638 :
- ; 639 : void _Change_alloc(const _Alty&)
- ; 640 : { // replace old allocator
- ; 641 : }
- ; 642 :
- ; 643 : void _Swap_alloc(_Myt&)
- ; 644 : { // swap allocators
- ; 645 : }
- ; 646 :
- ; 647 : #else /* _ITERATOR_DEBUG_LEVEL == 0 */
- ; 648 : _String_alloc(const _Alloc& = _Alloc())
- ; 649 : { // construct allocator from _Al
- ; 650 : _Alloc_proxy();
- ; 651 : }
- ; 652 :
- ; 653 : ~_String_alloc() _NOEXCEPT
- ; 654 : { // destroy the object
- ; 655 : _Free_proxy();
- ; 656 : }
- ; 657 :
- ; 658 : void _Change_alloc(const _Alty&)
- ; 659 : { // replace old allocator
- ; 660 : }
- ; 661 :
- ; 662 : void _Swap_alloc(_Myt& _Right)
- ; 663 : { // swap allocators
- ; 664 : _Swap_adl(this->_Myproxy, _Right._Myproxy);
- ; 665 : }
- ; 666 :
- ; 667 : void _Alloc_proxy()
- ; 668 : { // construct proxy from _Alval
- ; 669 : typename _Alloc::template rebind<_Container_proxy>::other
- ; 670 : _Alproxy;
- ; 671 : this->_Myproxy = _Alproxy.allocate(1);
- ; 672 : _Alproxy.construct(this->_Myproxy, _Container_proxy());
- ; 673 : this->_Myproxy->_Mycont = this;
- ; 674 : }
- ; 675 :
- ; 676 : void _Free_proxy()
- ; 677 : { // destroy proxy
- ; 678 : typename _Alloc::template rebind<_Container_proxy>::other
- ; 679 : _Alproxy;
- ; 680 : this->_Orphan_all();
- ; 681 : _Alproxy.destroy(this->_Myproxy);
- ; 682 : _Alproxy.deallocate(this->_Myproxy, 1);
- ; 683 : this->_Myproxy = 0;
- ; 684 : }
- ; 685 : #endif /* _ITERATOR_DEBUG_LEVEL == 0 */
- ; 686 :
- ; 687 : _Alty _Getal() const
- ; 688 : { // get reference to allocator
- ; 689 : return (_Alty());
- ; 690 : }
- ; 691 : };
- ; 692 :
- ; 693 : // TEMPLATE CLASS basic_string
- ; 694 : template<class _Elem,
- ; 695 : class _Traits,
- ; 696 : class _Alloc>
- ; 697 : class basic_string
- ; 698 : : public _String_alloc<!is_empty<_Alloc>::value,
- ; 699 : _String_base_types<_Elem, _Alloc> >
- ; 700 : { // null-terminated transparent array of elements
- ; 701 : public:
- ; 702 : typedef basic_string<_Elem, _Traits, _Alloc> _Myt;
- ; 703 : typedef _String_alloc<!is_empty<_Alloc>::value,
- ; 704 : _String_base_types<_Elem, _Alloc> > _Mybase;
- ; 705 : typedef _Traits traits_type;
- ; 706 : typedef _Alloc allocator_type;
- ; 707 :
- ; 708 : typedef typename _Mybase::_Alty _Alty;
- ; 709 :
- ; 710 : typedef typename _Mybase::value_type value_type;
- ; 711 : typedef typename _Mybase::size_type size_type;
- ; 712 : typedef typename _Mybase::difference_type difference_type;
- ; 713 : typedef typename _Mybase::pointer pointer;
- ; 714 : typedef typename _Mybase::const_pointer const_pointer;
- ; 715 : typedef typename _Mybase::reference reference;
- ; 716 : typedef typename _Mybase::const_reference const_reference;
- ; 717 :
- ; 718 : typedef typename _Mybase::iterator iterator;
- ; 719 : typedef typename _Mybase::const_iterator const_iterator;
- ; 720 :
- ; 721 : typedef _STD reverse_iterator<iterator> reverse_iterator;
- ; 722 : typedef _STD reverse_iterator<const_iterator> const_reverse_iterator;
- ; 723 :
- ; 724 : basic_string(const _Myt& _Right)
- ; 725 :
- ; 726 : #if _HAS_CPP0X
- ; 727 : : _Mybase(_Right._Getal().select_on_container_copy_construction())
- ; 728 :
- ; 729 : #else /* _HAS_CPP0X */
- ; 730 : : _Mybase(_Right._Getal())
- ; 731 : #endif /* _HAS_CPP0X */
- ; 732 :
- ; 733 : { // construct by copying _Right
- ; 734 : _Tidy();
- ; 735 : assign(_Right, 0, npos);
- ; 736 : }
- ; 737 :
- ; 738 : #if _HAS_CPP0X
- ; 739 : basic_string(const _Myt& _Right, const _Alloc& _Al)
- ; 740 : : _Mybase(_Al)
- ; 741 : { // construct by copying with allocator
- ; 742 : _Tidy();
- ; 743 : assign(_Right, 0, npos);
- ; 744 : }
- ; 745 : #endif /* _HAS_CPP0X */
- ; 746 :
- ; 747 : basic_string()
- ; 748 : : _Mybase()
- ; 749 : { // construct empty string
- ; 750 : _Tidy();
- ; 751 : }
- ; 752 :
- ; 753 : explicit basic_string(const _Alloc& _Al)
- ; 754 : : _Mybase(_Al)
- ; 755 : { // construct empty string with allocator
- ; 756 : _Tidy();
- ; 757 : }
- ; 758 :
- ; 759 : basic_string(const _Myt& _Right, size_type _Roff,
- ; 760 : size_type _Count = npos)
- ; 761 : : _Mybase(_Right._Getal())
- ; 762 : { // construct from _Right [_Roff, _Roff + _Count)
- ; 763 : _Tidy();
- ; 764 : assign(_Right, _Roff, _Count);
- ; 765 : }
- ; 766 :
- ; 767 : basic_string(const _Myt& _Right, size_type _Roff, size_type _Count,
- ; 768 : const _Alloc& _Al)
- ; 769 : : _Mybase(_Al)
- ; 770 : { // construct from _Right [_Roff, _Roff + _Count) with allocator
- ; 771 : _Tidy();
- ; 772 : assign(_Right, _Roff, _Count);
- ; 773 : }
- ; 774 :
- ; 775 : basic_string(const _Elem *_Ptr, size_type _Count)
- ; 776 : : _Mybase()
- ; 777 : { // construct from [_Ptr, _Ptr + _Count)
- ; 778 : _Tidy();
- ; 779 : assign(_Ptr, _Count);
- ; 780 : }
- ; 781 :
- ; 782 : basic_string(const _Elem *_Ptr, size_type _Count, const _Alloc& _Al)
- ; 783 : : _Mybase(_Al)
- ; 784 : { // construct from [_Ptr, _Ptr + _Count) with allocator
- ; 785 : _Tidy();
- ; 786 : assign(_Ptr, _Count);
- ; 787 : }
- ; 788 :
- ; 789 : basic_string(const _Elem *_Ptr)
- ; 790 : : _Mybase()
- ; 791 : { // construct from [_Ptr, <null>)
- ; 792 : _Tidy();
- ; 793 : assign(_Ptr);
- ; 794 : }
- ; 795 :
- ; 796 : basic_string(const _Elem *_Ptr, const _Alloc& _Al)
- ; 797 : : _Mybase(_Al)
- ; 798 : { // construct from [_Ptr, <null>) with allocator
- ; 799 : _Tidy();
- ; 800 : assign(_Ptr);
- ; 801 : }
- ; 802 :
- ; 803 : basic_string(size_type _Count, _Elem _Ch)
- ; 804 : : _Mybase()
- ; 805 : { // construct from _Count * _Ch
- ; 806 : _Tidy();
- ; 807 : assign(_Count, _Ch);
- ; 808 : }
- ; 809 :
- ; 810 : basic_string(size_type _Count, _Elem _Ch, const _Alloc& _Al)
- ; 811 : : _Mybase(_Al)
- ; 812 : { // construct from _Count * _Ch with allocator
- ; 813 : _Tidy();
- ; 814 : assign(_Count, _Ch);
- ; 815 : }
- ; 816 :
- ; 817 : template<class _Iter>
- ; 818 : basic_string(_Iter _First, _Iter _Last,
- ; 819 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 820 : void>::type ** = 0)
- ; 821 : : _Mybase()
- ; 822 : { // construct from [_First, _Last)
- ; 823 : _Tidy();
- ; 824 : _Construct(_First, _Last, _Iter_cat(_First));
- ; 825 : }
- ; 826 :
- ; 827 : template<class _Iter>
- ; 828 : basic_string(_Iter _First, _Iter _Last, const _Alloc& _Al,
- ; 829 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 830 : void>::type ** = 0)
- ; 831 : : _Mybase(_Al)
- ; 832 : { // construct from [_First, _Last) with allocator
- ; 833 : _Tidy();
- ; 834 : _Construct(_First, _Last, _Iter_cat(_First));
- ; 835 : }
- ; 836 :
- ; 837 : template<class _Iter>
- ; 838 : void _Construct(_Iter _First,
- ; 839 : _Iter _Last, input_iterator_tag)
- ; 840 : { // initialize from [_First, _Last), input iterators
- ; 841 : _TRY_BEGIN
- ; 842 : for (; _First != _Last; ++_First)
- ; 843 : append((size_type)1, (_Elem)*_First);
- ; 844 : _CATCH_ALL
- ; 845 : _Tidy(true);
- ; 846 : _RERAISE;
- ; 847 : _CATCH_END
- ; 848 : }
- ; 849 :
- ; 850 : template<class _Iter>
- ; 851 : void _Construct(_Iter _First,
- ; 852 : _Iter _Last, forward_iterator_tag)
- ; 853 : { // initialize from [_First, _Last), forward iterators
- ; 854 : _DEBUG_RANGE(_First, _Last);
- ; 855 : size_type _Count = 0;
- ; 856 : _Distance(_First, _Last, _Count);
- ; 857 : reserve(_Count);
- ; 858 :
- ; 859 : _TRY_BEGIN
- ; 860 : for (; _First != _Last; ++_First)
- ; 861 : append((size_type)1, (_Elem)*_First);
- ; 862 : _CATCH_ALL
- ; 863 : _Tidy(true);
- ; 864 : _RERAISE;
- ; 865 : _CATCH_END
- ; 866 : }
- ; 867 :
- ; 868 : basic_string(const_pointer _First, const_pointer _Last)
- ; 869 : : _Mybase()
- ; 870 : { // construct from [_First, _Last), const pointers
- ; 871 : _DEBUG_RANGE(_First, _Last);
- ; 872 : _Tidy();
- ; 873 : if (_First != _Last)
- ; 874 : assign(&*_First, _Last - _First);
- ; 875 : }
- ; 876 :
- ; 877 : basic_string(const_pointer _First, const_pointer _Last,
- ; 878 : const _Alloc& _Al)
- ; 879 : : _Mybase(_Al)
- ; 880 : { // construct from [_First, _Last), const pointers
- ; 881 : _DEBUG_RANGE(_First, _Last);
- ; 882 : _Tidy();
- ; 883 : if (_First != _Last)
- ; 884 : assign(&*_First, _Last - _First);
- ; 885 : }
- ; 886 :
- ; 887 : basic_string(const_iterator _First, const_iterator _Last)
- ; 888 : : _Mybase()
- ; 889 : { // construct from [_First, _Last), const_iterators
- ; 890 : _DEBUG_RANGE(_First, _Last);
- ; 891 : _Tidy();
- ; 892 : if (_First != _Last)
- ; 893 : assign(&*_First, _Last - _First);
- ; 894 : }
- ; 895 :
- ; 896 : basic_string(_Myt&& _Right) _NOEXCEPT
- ; 897 : : _Mybase(_Right._Getal())
- ; 898 : { // construct by moving _Right
- ; 899 : _Tidy();
- ; 900 : _Assign_rv(_STD forward<_Myt>(_Right));
- ; 901 : }
- ; 902 :
- ; 903 : basic_string(_Myt&& _Right, const _Alloc& _Al)
- ; 904 : : _Mybase(_Al)
- ; 905 : { // construct by moving _Right, allocator
- ; 906 : if (this->_Getal() != _Right._Getal())
- ; 907 : assign(_Right.begin(), _Right.end());
- ; 908 : else
- ; 909 : _Assign_rv(_STD forward<_Myt>(_Right));
- ; 910 : }
- ; 911 :
- ; 912 : _Myt& operator=(_Myt&& _Right) _NOEXCEPT
- ; 913 : { // assign by moving _Right
- ; 914 : if (this != &_Right)
- ; 915 : { // different, assign it
- ; 916 : _Tidy(true);
- ; 917 :
- ; 918 : #if _HAS_CPP0X
- ; 919 : if (this->_Getal() != _Right._Getal()
- ; 920 : && _Alty::propagate_on_container_move_assignment::value)
- ; 921 : this->_Change_alloc(_Right._Getal());
- ; 922 : #endif /* _HAS_CPP0X */
- ; 923 :
- ; 924 : if (this->_Getal() != _Right._Getal())
- ; 925 : assign(_Right.begin(), _Right.end());
- ; 926 : else
- ; 927 : _Assign_rv(_STD forward<_Myt>(_Right));
- ; 928 : }
- ; 929 : return (*this);
- ; 930 : }
- ; 931 :
- ; 932 : _Myt& assign(_Myt&& _Right) _NOEXCEPT
- ; 933 : { // assign by moving _Right
- ; 934 : if (this == &_Right)
- ; 935 : ;
- ; 936 : else if (get_allocator() != _Right.get_allocator()
- ; 937 : && this->_BUF_SIZE <= _Right._Myres)
- ; 938 : *this = _Right;
- ; 939 : else
- ; 940 : { // not same, clear this and steal from _Right
- ; 941 : _Tidy(true);
- ; 942 : _Assign_rv(_STD forward<_Myt>(_Right));
- ; 943 : }
- ; 944 : return (*this);
- ; 945 : }
- ; 946 :
- ; 947 : void _Assign_rv(_Myt&& _Right)
- ; 948 : { // assign by moving _Right
- ; 949 : if (_Right._Myres < this->_BUF_SIZE)
- ; 950 : _Traits::move(this->_Bx._Buf, _Right._Bx._Buf,
- ; 951 : _Right._Mysize + 1);
- ; 952 : else
- ; 953 : { // copy pointer
- ; 954 : this->_Getal().construct(&this->_Bx._Ptr, _Right._Bx._Ptr);
- ; 955 : _Right._Bx._Ptr = pointer();
- ; 956 : }
- ; 957 : this->_Mysize = _Right._Mysize;
- ; 958 : this->_Myres = _Right._Myres;
- ; 959 : _Right._Tidy();
- ; 960 : }
- ; 961 :
- ; 962 : ~basic_string() _NOEXCEPT
- ; 963 : { // destroy the string
- ; 964 : _Tidy(true);
- ; 965 : }
- ; 966 :
- ; 967 : _PGLOBAL static const size_type npos; // bad/missing length/position
- ; 968 :
- ; 969 : _Myt& operator=(const _Myt& _Right)
- ; 970 : { // assign _Right
- ; 971 : if (this != &_Right)
- ; 972 : { // different, assign it
- ; 973 : #if _HAS_CPP0X
- ; 974 : if (this->_Getal() != _Right._Getal()
- ; 975 : && _Alty::propagate_on_container_copy_assignment::value)
- ; 976 : { // change allocator before copying
- ; 977 : _Tidy(true);
- ; 978 : this->_Change_alloc(_Right._Getal());
- ; 979 : }
- ; 980 : #endif /* _HAS_CPP0X */
- ; 981 :
- ; 982 : assign(_Right);
- ; 983 : }
- ; 984 : return (*this);
- ; 985 : }
- ; 986 :
- ; 987 : _Myt& operator=(const _Elem *_Ptr)
- ; 988 : { // assign [_Ptr, <null>)
- ; 989 : return (assign(_Ptr));
- ; 990 : }
- ; 991 :
- ; 992 : _Myt& operator=(_Elem _Ch)
- ; 993 : { // assign 1 * _Ch
- ; 994 : return (assign(1, _Ch));
- ; 995 : }
- ; 996 :
- ; 997 : _Myt& operator+=(const _Myt& _Right)
- ; 998 : { // append _Right
- ; 999 : return (append(_Right));
- ; 1000 : }
- ; 1001 :
- ; 1002 : _Myt& operator+=(const _Elem *_Ptr)
- ; 1003 : { // append [_Ptr, <null>)
- ; 1004 : return (append(_Ptr));
- ; 1005 : }
- ; 1006 :
- ; 1007 : _Myt& operator+=(_Elem _Ch)
- ; 1008 : { // append 1 * _Ch
- ; 1009 : return (append((size_type)1, _Ch));
- ; 1010 : }
- ; 1011 :
- ; 1012 : _Myt& append(const _Myt& _Right)
- ; 1013 : { // append _Right
- ; 1014 : return (append(_Right, 0, npos));
- ; 1015 : }
- ; 1016 :
- ; 1017 : _Myt& append(const _Myt& _Right,
- ; 1018 : size_type _Roff, size_type _Count)
- ; 1019 : { // append _Right [_Roff, _Roff + _Count)
- ; 1020 : if (_Right.size() < _Roff)
- ; 1021 : _Xran(); // _Roff off end
- ; 1022 : size_type _Num = _Right.size() - _Roff;
- ; 1023 : if (_Num < _Count)
- ; 1024 : _Count = _Num; // trim _Count to size
- ; 1025 : if (npos - this->_Mysize <= _Count)
- ; 1026 : _Xlen(); // result too long
- ; 1027 :
- ; 1028 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1029 : { // make room and append new stuff
- ; 1030 : _Traits::copy(this->_Myptr() + this->_Mysize,
- ; 1031 : _Right._Myptr() + _Roff, _Count);
- ; 1032 : _Eos(_Num);
- ; 1033 : }
- ; 1034 : return (*this);
- ; 1035 : }
- ; 1036 :
- ; 1037 : _Myt& append(const _Elem *_Ptr, size_type _Count)
- ; 1038 : { // append [_Ptr, _Ptr + _Count)
- ; 1039 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1040 : if (_Count != 0)
- ; 1041 : _DEBUG_POINTER(_Ptr);
- ; 1042 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1043 :
- ; 1044 : if (_Inside(_Ptr))
- ; 1045 : return (append(*this,
- ; 1046 : _Ptr - this->_Myptr(), _Count)); // substring
- ; 1047 : if (npos - this->_Mysize <= _Count)
- ; 1048 : _Xlen(); // result too long
- ; 1049 :
- ; 1050 : size_type _Num;
- ; 1051 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1052 : { // make room and append new stuff
- ; 1053 : _Traits::copy(this->_Myptr() + this->_Mysize, _Ptr, _Count);
- ; 1054 : _Eos(_Num);
- ; 1055 : }
- ; 1056 : return (*this);
- ; 1057 : }
- ; 1058 :
- ; 1059 : _Myt& append(const _Elem *_Ptr)
- ; 1060 : { // append [_Ptr, <null>)
- ; 1061 : _DEBUG_POINTER(_Ptr);
- ; 1062 : return (append(_Ptr, _Traits::length(_Ptr)));
- ; 1063 : }
- ; 1064 :
- ; 1065 : _Myt& append(size_type _Count, _Elem _Ch)
- ; 1066 : { // append _Count * _Ch
- ; 1067 : if (npos - this->_Mysize <= _Count)
- ; 1068 : _Xlen(); // result too long
- ; 1069 :
- ; 1070 : size_type _Num;
- ; 1071 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1072 : { // make room and append new stuff using assign
- ; 1073 : _Chassign(this->_Mysize, _Count, _Ch);
- ; 1074 : _Eos(_Num);
- ; 1075 : }
- ; 1076 : return (*this);
- ; 1077 : }
- ; 1078 :
- ; 1079 : template<class _Iter>
- ; 1080 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1081 : _Myt&>::type
- ; 1082 : append(_Iter _First, _Iter _Last)
- ; 1083 : { // append [_First, _Last), input iterators
- ; 1084 : return (replace(end(), end(), _First, _Last));
- ; 1085 : }
- ; 1086 :
- ; 1087 : _Myt& append(const_pointer _First, const_pointer _Last)
- ; 1088 : { // append [_First, _Last), const pointers
- ; 1089 : return (replace(end(), end(), _First, _Last));
- ; 1090 : }
- ; 1091 :
- ; 1092 : _Myt& append(const_iterator _First, const_iterator _Last)
- ; 1093 : { // append [_First, _Last), const_iterators
- ; 1094 : return (replace(end(), end(), _First, _Last));
- ; 1095 : }
- ; 1096 :
- ; 1097 : _Myt& assign(const _Myt& _Right)
- ; 1098 : { // assign _Right
- ; 1099 : return (assign(_Right, 0, npos));
- ; 1100 : }
- ; 1101 :
- ; 1102 : _Myt& assign(const _Myt& _Right,
- ; 1103 : size_type _Roff, size_type _Count)
- ; 1104 : { // assign _Right [_Roff, _Roff + _Count)
- ; 1105 : if (_Right.size() < _Roff)
- ; 1106 : _Xran(); // _Roff off end
- ; 1107 : size_type _Num = _Right.size() - _Roff;
- ; 1108 : if (_Count < _Num)
- ; 1109 : _Num = _Count; // trim _Num to size
- ; 1110 :
- ; 1111 : if (this == &_Right)
- ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
- ; 1113 : else if (_Grow(_Num))
- ; 1114 : { // make room and assign new stuff
- ; 1115 : _Traits::copy(this->_Myptr(),
- ; 1116 : _Right._Myptr() + _Roff, _Num);
- ; 1117 : _Eos(_Num);
- ; 1118 : }
- ; 1119 : return (*this);
- ; 1120 : }
- ; 1121 :
- ; 1122 : _Myt& assign(const _Elem *_Ptr, size_type _Count)
- ; 1123 : { // assign [_Ptr, _Ptr + _Count)
- ; 1124 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1125 : if (_Count != 0)
- ; 1126 : _DEBUG_POINTER(_Ptr);
- ; 1127 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1128 :
- ; 1129 : if (_Inside(_Ptr))
- ; 1130 : return (assign(*this,
- ; 1131 : _Ptr - this->_Myptr(), _Count)); // substring
- ; 1132 :
- ; 1133 : if (_Grow(_Count))
- ; 1134 : { // make room and assign new stuff
- ; 1135 : _Traits::copy(this->_Myptr(), _Ptr, _Count);
- ; 1136 : _Eos(_Count);
- ; 1137 : }
- ; 1138 : return (*this);
- ; 1139 : }
- ; 1140 :
- ; 1141 : _Myt& assign(const _Elem *_Ptr)
- ; 1142 : { // assign [_Ptr, <null>)
- ; 1143 : _DEBUG_POINTER(_Ptr);
- ; 1144 : return (assign(_Ptr, _Traits::length(_Ptr)));
- ; 1145 : }
- ; 1146 :
- ; 1147 : _Myt& assign(size_type _Count, _Elem _Ch)
- ; 1148 : { // assign _Count * _Ch
- ; 1149 : if (_Count == npos)
- ; 1150 : _Xlen(); // result too long
- ; 1151 :
- ; 1152 : if (_Grow(_Count))
- ; 1153 : { // make room and assign new stuff
- ; 1154 : _Chassign(0, _Count, _Ch);
- ; 1155 : _Eos(_Count);
- ; 1156 : }
- ; 1157 : return (*this);
- ; 1158 : }
- ; 1159 :
- ; 1160 : template<class _Iter>
- ; 1161 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1162 : _Myt&>::type
- ; 1163 : assign(_Iter _First, _Iter _Last)
- ; 1164 : { // assign [First, _Last), input iterators
- ; 1165 : return (replace(begin(), end(), _First, _Last));
- ; 1166 : }
- ; 1167 :
- ; 1168 : _Myt& assign(const_pointer _First, const_pointer _Last)
- ; 1169 : { // assign [First, _Last), const pointers
- ; 1170 : return (replace(begin(), end(), _First, _Last));
- ; 1171 : }
- ; 1172 :
- ; 1173 : _Myt& assign(const_iterator _First, const_iterator _Last)
- ; 1174 : { // assign [First, _Last), const_iterators
- ; 1175 : return (replace(begin(), end(), _First, _Last));
- ; 1176 : }
- ; 1177 :
- ; 1178 : _Myt& insert(size_type _Off, const _Myt& _Right)
- ; 1179 : { // insert _Right at _Off
- ; 1180 : return (insert(_Off, _Right, 0, npos));
- ; 1181 : }
- ; 1182 :
- ; 1183 : _Myt& insert(size_type _Off,
- ; 1184 : const _Myt& _Right, size_type _Roff, size_type _Count)
- ; 1185 : { // insert _Right [_Roff, _Roff + _Count) at _Off
- ; 1186 : if (this->_Mysize < _Off || _Right.size() < _Roff)
- ; 1187 : _Xran(); // _Off or _Roff off end
- ; 1188 : size_type _Num = _Right.size() - _Roff;
- ; 1189 : if (_Num < _Count)
- ; 1190 : _Count = _Num; // trim _Count to size
- ; 1191 : if (npos - this->_Mysize <= _Count)
- ; 1192 : _Xlen(); // result too long
- ; 1193 :
- ; 1194 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1195 : { // make room and insert new stuff
- ; 1196 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1197 : this->_Myptr() + _Off,
- ; 1198 : this->_Mysize - _Off); // empty out hole
- ; 1199 : if (this == &_Right)
- ; 1200 : _Traits::move(this->_Myptr() + _Off,
- ; 1201 : this->_Myptr() + (_Off < _Roff ? _Roff + _Count : _Roff),
- ; 1202 : _Count); // substring
- ; 1203 : else
- ; 1204 : _Traits::copy(this->_Myptr() + _Off,
- ; 1205 : _Right._Myptr() + _Roff, _Count); // fill hole
- ; 1206 : _Eos(_Num);
- ; 1207 : }
- ; 1208 : return (*this);
- ; 1209 : }
- ; 1210 :
- ; 1211 : _Myt& insert(size_type _Off,
- ; 1212 : const _Elem *_Ptr, size_type _Count)
- ; 1213 : { // insert [_Ptr, _Ptr + _Count) at _Off
- ; 1214 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1215 : if (_Count != 0)
- ; 1216 : _DEBUG_POINTER(_Ptr);
- ; 1217 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1218 :
- ; 1219 : if (_Inside(_Ptr))
- ; 1220 : return (insert(_Off, *this,
- ; 1221 : _Ptr - this->_Myptr(), _Count)); // substring
- ; 1222 : if (this->_Mysize < _Off)
- ; 1223 : _Xran(); // _Off off end
- ; 1224 : if (npos - this->_Mysize <= _Count)
- ; 1225 : _Xlen(); // result too long
- ; 1226 : size_type _Num;
- ; 1227 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1228 : { // make room and insert new stuff
- ; 1229 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1230 : this->_Myptr() + _Off,
- ; 1231 : this->_Mysize - _Off); // empty out hole
- ; 1232 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
- ; 1233 : _Eos(_Num);
- ; 1234 : }
- ; 1235 : return (*this);
- ; 1236 : }
- ; 1237 :
- ; 1238 : _Myt& insert(size_type _Off, const _Elem *_Ptr)
- ; 1239 : { // insert [_Ptr, <null>) at _Off
- ; 1240 : _DEBUG_POINTER(_Ptr);
- ; 1241 : return (insert(_Off, _Ptr, _Traits::length(_Ptr)));
- ; 1242 : }
- ; 1243 :
- ; 1244 : _Myt& insert(size_type _Off,
- ; 1245 : size_type _Count, _Elem _Ch)
- ; 1246 : { // insert _Count * _Ch at _Off
- ; 1247 : if (this->_Mysize < _Off)
- ; 1248 : _Xran(); // _Off off end
- ; 1249 : if (npos - this->_Mysize <= _Count)
- ; 1250 : _Xlen(); // result too long
- ; 1251 : size_type _Num;
- ; 1252 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1253 : { // make room and insert new stuff
- ; 1254 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1255 : this->_Myptr() + _Off,
- ; 1256 : this->_Mysize - _Off); // empty out hole
- ; 1257 : _Chassign(_Off, _Count, _Ch); // fill hole
- ; 1258 : _Eos(_Num);
- ; 1259 : }
- ; 1260 : return (*this);
- ; 1261 : }
- ; 1262 :
- ; 1263 : iterator insert(const_iterator _Where)
- ; 1264 : { // insert <null> at _Where
- ; 1265 : return (insert(_Where, _Elem()));
- ; 1266 : }
- ; 1267 :
- ; 1268 : iterator insert(const_iterator _Where, _Elem _Ch)
- ; 1269 : { // insert _Ch at _Where
- ; 1270 : size_type _Off = _Pdif(_Where, begin());
- ; 1271 : insert(_Off, 1, _Ch);
- ; 1272 : return (begin() + _Off);
- ; 1273 : }
- ; 1274 :
- ; 1275 : iterator insert(const_iterator _Where, size_type _Count, _Elem _Ch)
- ; 1276 : { // insert _Count * _Elem at _Where
- ; 1277 : size_type _Off = _Pdif(_Where, begin());
- ; 1278 : insert(_Off, _Count, _Ch);
- ; 1279 : return (begin() + _Off);
- ; 1280 : }
- ; 1281 :
- ; 1282 : template<class _Iter>
- ; 1283 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1284 : iterator>::type
- ; 1285 : insert(const_iterator _Where, _Iter _First, _Iter _Last)
- ; 1286 : { // insert [_First, _Last) at _Where, input iterators
- ; 1287 : size_type _Off = _Pdif(_Where, begin());
- ; 1288 : replace(_Where, _Where, _First, _Last);
- ; 1289 : return (begin() + _Off);
- ; 1290 : }
- ; 1291 :
- ; 1292 : iterator insert(const_iterator _Where,
- ; 1293 : const_pointer _First, const_pointer _Last)
- ; 1294 : { // insert [_First, _Last) at _Where, const pointers
- ; 1295 : size_type _Off = _Pdif(_Where, begin());
- ; 1296 : replace(_Where, _Where, _First, _Last);
- ; 1297 : return (begin() + _Off);
- ; 1298 : }
- ; 1299 :
- ; 1300 : iterator insert(const_iterator _Where,
- ; 1301 : const_iterator _First, const_iterator _Last)
- ; 1302 : { // insert [_First, _Last) at _Where, const_iterators
- ; 1303 : size_type _Off = _Pdif(_Where, begin());
- ; 1304 : replace(_Where, _Where, _First, _Last);
- ; 1305 : return (begin() + _Off);
- ; 1306 : }
- ; 1307 :
- ; 1308 : _Myt& erase(size_type _Off = 0)
- ; 1309 : { // erase elements [_Off, ...)
- ; 1310 : if (this->_Mysize < _Off)
- ; 1311 : _Xran(); // _Off off end
- ; 1312 : _Eos(_Off);
- ; 1313 : return (*this);
- ; 1314 : }
- ; 1315 :
- ; 1316 : _Myt& erase(size_type _Off, size_type _Count)
- ; 1317 : { // erase elements [_Off, _Off + _Count)
- ; 1318 : if (this->_Mysize < _Off)
- ; 1319 : _Xran(); // _Off off end
- ; 1320 : if (this->_Mysize - _Off <= _Count)
- ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
- ; 1322 : else if (0 < _Count)
- ; 1323 : { // move elements down
- ; 1324 : value_type *_Ptr = this->_Myptr() + _Off;
- ; 1325 : size_type _Newsize = this->_Mysize - _Count;
- ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
- ; 1327 : _Eos(_Newsize);
- ; 1328 : }
- ; 1329 : return (*this);
- ; 1330 : }
- ; 1331 :
- ; 1332 : iterator erase(const_iterator _Where)
- ; 1333 : { // erase element at _Where
- ; 1334 : size_type _Count = _Pdif(_Where, begin());
- ; 1335 : erase(_Count, 1);
- ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1337 : }
- ; 1338 :
- ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
- ; 1340 : { // erase substring [_First, _Last)
- ; 1341 : _DEBUG_RANGE(_First, _Last);
- ; 1342 : size_type _Count = _Pdif(_First, begin());
- ; 1343 : erase(_Count, _Pdif(_Last, _First));
- ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1345 : }
- ; 1346 :
- ; 1347 : void clear() _NOEXCEPT
- ; 1348 : { // erase all
- ; 1349 : _Eos(0);
- ; 1350 : }
- ; 1351 :
- ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
- ; 1353 : { // replace [_Off, _Off + _N0) with _Right
- ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
- ; 1355 : }
- ; 1356 :
- ; 1357 : _Myt& replace(size_type _Off,
- ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
- ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
- ; 1361 : _Xran(); // _Off or _Roff off end
- ; 1362 : if (this->_Mysize - _Off < _N0)
- ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1364 : size_type _Num = _Right.size() - _Roff;
- ; 1365 : if (_Num < _Count)
- ; 1366 : _Count = _Num; // trim _Count to size
- ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1368 : _Xlen(); // result too long
- ; 1369 :
- ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
- ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
- ; 1372 : if (this->_Mysize < _Newsize)
- ; 1373 : _Grow(_Newsize);
- ; 1374 :
- ; 1375 : if (this != &_Right)
- ; 1376 : { // no overlap, just move down and copy in new stuff
- ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
- ; 1379 : _Traits::copy(this->_Myptr() + _Off,
- ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
- ; 1381 : }
- ; 1382 : else if (_Count <= _N0)
- ; 1383 : { // hole doesn't get larger, just copy in substring
- ; 1384 : _Traits::move(this->_Myptr() + _Off,
- ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1388 : }
- ; 1389 : else if (_Roff <= _Off)
- ; 1390 : { // hole gets larger, substring begins before hole
- ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1393 : _Traits::move(this->_Myptr() + _Off,
- ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1395 : }
- ; 1396 : else if (_Off + _N0 <= _Roff)
- ; 1397 : { // hole gets larger, substring begins after hole
- ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1400 : _Traits::move(this->_Myptr() + _Off,
- ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
- ; 1402 : _Count); // fill hole
- ; 1403 : }
- ; 1404 : else
- ; 1405 : { // hole gets larger, substring begins in hole
- ; 1406 : _Traits::move(this->_Myptr() + _Off,
- ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
- ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
- ; 1411 : this->_Myptr() + _Roff + _Count,
- ; 1412 : _Count - _N0); // fill rest of new hole
- ; 1413 : }
- ; 1414 :
- ; 1415 : _Eos(_Newsize);
- ; 1416 : return (*this);
- ; 1417 : }
- ; 1418 :
- ; 1419 : _Myt& replace(size_type _Off,
- ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
- ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1423 : if (_Count != 0)
- ; 1424 : _DEBUG_POINTER(_Ptr);
- ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1426 :
- ; 1427 : if (_Inside(_Ptr))
- ; 1428 : return (replace(_Off, _N0, *this,
- ; 1429 : _Ptr - this->_Myptr(),
- ; 1430 : _Count)); // substring, replace carefully
- ; 1431 : if (this->_Mysize < _Off)
- ; 1432 : _Xran(); // _Off off end
- ; 1433 : if (this->_Mysize - _Off < _N0)
- ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1436 : _Xlen(); // result too long
- ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1438 :
- ; 1439 : if (_Count < _N0)
- ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1441 : this->_Myptr() + _Off + _N0,
- ; 1442 : _Nm); // smaller hole, move tail up
- ; 1443 : size_type _Num;
- ; 1444 : if ((0 < _Count || 0 < _N0)
- ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1446 : { // make room and rearrange
- ; 1447 : if (_N0 < _Count)
- ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
- ; 1451 : _Eos(_Num);
- ; 1452 : }
- ; 1453 : return (*this);
- ; 1454 : }
- ; 1455 :
- ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
- ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 1458 : _DEBUG_POINTER(_Ptr);
- ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 1460 : }
- ; 1461 :
- ; 1462 : _Myt& replace(size_type _Off,
- ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
- ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
- ; 1465 : if (this->_Mysize < _Off)
- ; 1466 : _Xran(); // _Off off end
- ; 1467 : if (this->_Mysize - _Off < _N0)
- ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1470 : _Xlen(); // result too long
- ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1472 :
- ; 1473 : if (_Count < _N0)
- ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1475 : this->_Myptr() + _Off + _N0,
- ; 1476 : _Nm); // smaller hole, move tail up
- ; 1477 : size_type _Num;
- ; 1478 : if ((0 < _Count || 0 < _N0)
- ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1480 : { // make room and rearrange
- ; 1481 : if (_N0 < _Count)
- ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
- ; 1485 : _Eos(_Num);
- ; 1486 : }
- ; 1487 : return (*this);
- ; 1488 : }
- ; 1489 :
- ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1491 : const _Myt& _Right)
- ; 1492 : { // replace [_First, _Last) with _Right
- ; 1493 : return (replace(
- ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
- ; 1495 : }
- ; 1496 :
- ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1498 : const _Elem *_Ptr, size_type _Count)
- ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
- ; 1500 : return (replace(
- ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
- ; 1502 : }
- ; 1503 :
- ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1505 : const _Elem *_Ptr)
- ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
- ; 1507 : return (replace(
- ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
- ; 1509 : }
- ; 1510 :
- ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1512 : size_type _Count, _Elem _Ch)
- ; 1513 : { // replace [_First, _Last) with _Count * _Ch
- ; 1514 : return (replace(
- ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
- ; 1516 : }
- ; 1517 :
- ; 1518 : template<class _Iter>
- ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1520 : _Myt&>::type
- ; 1521 : replace(const_iterator _First, const_iterator _Last,
- ; 1522 : _Iter _First2, _Iter _Last2)
- ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
- ; 1524 : _Myt _Right(_First2, _Last2);
- ; 1525 : replace(_First, _Last, _Right);
- ; 1526 : return (*this);
- ; 1527 : }
- ; 1528 :
- ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1530 : const_pointer _First2, const_pointer _Last2)
- ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1532 : if (_First2 == _Last2)
- ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1534 : else
- ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1536 : &*_First2, _Last2 - _First2);
- ; 1537 : return (*this);
- ; 1538 : }
- ; 1539 :
- ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1541 : pointer _First2, pointer _Last2)
- ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1543 : if (_First2 == _Last2)
- ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1545 : else
- ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1547 : &*_First2, _Last2 - _First2);
- ; 1548 : return (*this);
- ; 1549 : }
- ; 1550 :
- ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1552 : const_iterator _First2, const_iterator _Last2)
- ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1554 : if (_First2 == _Last2)
- ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1556 : else
- ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1558 : &*_First2, _Last2 - _First2);
- ; 1559 : return (*this);
- ; 1560 : }
- ; 1561 :
- ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1563 : iterator _First2, iterator _Last2)
- ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1565 : if (_First2 == _Last2)
- ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1567 : else
- ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1569 : &*_First2, _Last2 - _First2);
- ; 1570 : return (*this);
- ; 1571 : }
- ; 1572 :
- ; 1573 : iterator begin() _NOEXCEPT
- ; 1574 : { // return iterator for beginning of mutable sequence
- ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
- ; 1576 : }
- ; 1577 :
- ; 1578 : const_iterator begin() const _NOEXCEPT
- ; 1579 : { // return iterator for beginning of nonmutable sequence
- ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
- ; 1581 : }
- ; 1582 :
- ; 1583 : iterator end() _NOEXCEPT
- ; 1584 : { // return iterator for end of mutable sequence
- ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1586 : }
- ; 1587 :
- ; 1588 : const_iterator end() const _NOEXCEPT
- ; 1589 : { // return iterator for end of nonmutable sequence
- ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1591 : }
- ; 1592 :
- ; 1593 : reverse_iterator rbegin() _NOEXCEPT
- ; 1594 : { // return iterator for beginning of reversed mutable sequence
- ; 1595 : return (reverse_iterator(end()));
- ; 1596 : }
- ; 1597 :
- ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
- ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1600 : return (const_reverse_iterator(end()));
- ; 1601 : }
- ; 1602 :
- ; 1603 : reverse_iterator rend() _NOEXCEPT
- ; 1604 : { // return iterator for end of reversed mutable sequence
- ; 1605 : return (reverse_iterator(begin()));
- ; 1606 : }
- ; 1607 :
- ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
- ; 1609 : { // return iterator for end of reversed nonmutable sequence
- ; 1610 : return (const_reverse_iterator(begin()));
- ; 1611 : }
- ; 1612 :
- ; 1613 : #if _HAS_CPP0X
- ; 1614 : const_iterator cbegin() const _NOEXCEPT
- ; 1615 : { // return iterator for beginning of nonmutable sequence
- ; 1616 : return (((const _Myt *)this)->begin());
- ; 1617 : }
- ; 1618 :
- ; 1619 : const_iterator cend() const _NOEXCEPT
- ; 1620 : { // return iterator for end of nonmutable sequence
- ; 1621 : return (((const _Myt *)this)->end());
- ; 1622 : }
- ; 1623 :
- ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
- ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1626 : return (((const _Myt *)this)->rbegin());
- ; 1627 : }
- ; 1628 :
- ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
- ; 1630 : { // return iterator for end of reversed nonmutable sequence
- ; 1631 : return (((const _Myt *)this)->rend());
- ; 1632 : }
- ; 1633 :
- ; 1634 : void shrink_to_fit()
- ; 1635 : { // reduce capacity
- ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
- ; 1637 : { // worth shrinking, do it
- ; 1638 : _Myt _Tmp(*this);
- ; 1639 : swap(_Tmp);
- ; 1640 : }
- ; 1641 : }
- ; 1642 : #endif /* _HAS_CPP0X */
- ; 1643 :
- ; 1644 : reference at(size_type _Off)
- ; 1645 : { // subscript mutable sequence with checking
- ; 1646 : if (this->_Mysize <= _Off)
- ; 1647 : _Xran(); // _Off off end
- ; 1648 : return (this->_Myptr()[_Off]);
- ; 1649 : }
- ; 1650 :
- ; 1651 : const_reference at(size_type _Off) const
- ; 1652 : { // subscript nonmutable sequence with checking
- ; 1653 : if (this->_Mysize <= _Off)
- ; 1654 : _Xran(); // _Off off end
- ; 1655 : return (this->_Myptr()[_Off]);
- ; 1656 : }
- ; 1657 :
- ; 1658 : reference operator[](size_type _Off)
- ; 1659 : { // subscript mutable sequence
- ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1661 : if (this->_Mysize < _Off) // sic
- ; 1662 : _DEBUG_ERROR("string subscript out of range");
- ; 1663 :
- ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1667 :
- ; 1668 : return (this->_Myptr()[_Off]);
- ; 1669 : }
- ; 1670 :
- ; 1671 : const_reference operator[](size_type _Off) const
- ; 1672 : { // subscript nonmutable sequence
- ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1674 : if (this->_Mysize < _Off) // sic
- ; 1675 : _DEBUG_ERROR("string subscript out of range");
- ; 1676 :
- ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1680 :
- ; 1681 : return (this->_Myptr()[_Off]);
- ; 1682 : }
- ; 1683 :
- ; 1684 : void push_back(_Elem _Ch)
- ; 1685 : { // insert element at end
- ; 1686 : insert(end(), _Ch);
- ; 1687 : }
- ; 1688 :
- ; 1689 : #if _HAS_CPP0X
- ; 1690 : void pop_back()
- ; 1691 : { // erase element at end
- ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
- ; 1693 : }
- ; 1694 :
- ; 1695 : reference front()
- ; 1696 : { // return first element of mutable sequence
- ; 1697 : return (*begin());
- ; 1698 : }
- ; 1699 :
- ; 1700 : const_reference front() const
- ; 1701 : { // return first element of nonmutable sequence
- ; 1702 : return (*begin());
- ; 1703 : }
- ; 1704 :
- ; 1705 : reference back()
- ; 1706 : { // return last element of mutable sequence
- ; 1707 : return (*(end() - 1));
- ; 1708 : }
- ; 1709 :
- ; 1710 : const_reference back() const
- ; 1711 : { // return last element of nonmutable sequence
- ; 1712 : return (*(end() - 1));
- ; 1713 : }
- ; 1714 : #endif /* _HAS_CPP0X */
- ; 1715 :
- ; 1716 : const _Elem *c_str() const _NOEXCEPT
- ; 1717 : { // return pointer to null-terminated nonmutable array
- ; 1718 : return (this->_Myptr());
- ; 1719 : }
- ; 1720 :
- ; 1721 : const _Elem *data() const _NOEXCEPT
- ; 1722 : { // return pointer to nonmutable array
- ; 1723 : return (c_str());
- ; 1724 : }
- ; 1725 :
- ; 1726 : size_type length() const _NOEXCEPT
- ; 1727 : { // return length of sequence
- ; 1728 : return (this->_Mysize);
- ; 1729 : }
- ; 1730 :
- ; 1731 : size_type size() const _NOEXCEPT
- ; 1732 : { // return length of sequence
- ; 1733 : return (this->_Mysize);
- ; 1734 : }
- ; 1735 :
- ; 1736 : size_type max_size() const _NOEXCEPT
- ; 1737 : { // return maximum possible length of sequence
- ; 1738 : size_type _Num = this->_Getal().max_size();
- ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
- ; 1740 : }
- ; 1741 :
- ; 1742 : void resize(size_type _Newsize)
- ; 1743 : { // determine new length, padding with null elements as needed
- ; 1744 : resize(_Newsize, _Elem());
- ; 1745 : }
- ; 1746 :
- ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
- ; 1748 : { // determine new length, padding with _Ch elements as needed
- ; 1749 : if (_Newsize <= this->_Mysize)
- ; 1750 : _Eos(_Newsize);
- ; 1751 : else
- ; 1752 : append(_Newsize - this->_Mysize, _Ch);
- ; 1753 : }
- ; 1754 :
- ; 1755 : size_type capacity() const _NOEXCEPT
- ; 1756 : { // return current length of allocated storage
- ; 1757 : return (this->_Myres);
- ; 1758 : }
- ; 1759 :
- ; 1760 : void reserve(size_type _Newcap = 0)
- ; 1761 : { // determine new minimum length of allocated storage
- ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
- ; 1763 : { // change reservation
- ; 1764 : size_type _Size = this->_Mysize;
- ; 1765 : if (_Grow(_Newcap, true))
- ; 1766 : _Eos(_Size);
- ; 1767 : }
- ; 1768 : }
- ; 1769 :
- ; 1770 : bool empty() const _NOEXCEPT
- ; 1771 : { // test if sequence is empty
- ; 1772 : return (this->_Mysize == 0);
- ; 1773 : }
- ; 1774 :
- ; 1775 : _SCL_INSECURE_DEPRECATE
- ; 1776 :
- ; 1777 : size_type copy(_Elem *_Ptr,
- ; 1778 : size_type _Count, size_type _Off = 0) const
- ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
- ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1781 : if (_Count != 0)
- ; 1782 : _DEBUG_POINTER(_Ptr);
- ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1784 :
- ; 1785 : if (this->_Mysize < _Off)
- ; 1786 : _Xran(); // _Off off end
- ; 1787 : if (this->_Mysize - _Off < _Count)
- ; 1788 : _Count = this->_Mysize - _Off;
- ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
- ; 1790 : return (_Count);
- ; 1791 : }
- ; 1792 :
- ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
- ; 1794 : size_type _Count, size_type _Off = 0) const
- ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
- ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1797 : if (_Count != 0)
- ; 1798 : _DEBUG_POINTER(_Dest);
- ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1800 :
- ; 1801 : if (this->_Mysize < _Off)
- ; 1802 : _Xran(); // _Off off end
- ; 1803 : if (this->_Mysize - _Off < _Count)
- ; 1804 : _Count = this->_Mysize - _Off;
- ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
- ; 1806 : return (_Count);
- ; 1807 : }
- ; 1808 :
- ; 1809 : void _Swap_bx(_Myt& _Right)
- ; 1810 : { // exchange _Bx with _Right._Bx
- ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
- ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
- ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
- ; 1814 : else
- ; 1815 : { // swap large with small
- ; 1816 : pointer _Ptr = this->_Bx._Ptr;
- ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 1818 : _Traits::copy(this->_Bx._Buf,
- ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
- ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
- ; 1821 : }
- ; 1822 : else
- ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
- ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
- ; 1825 : else
- ; 1826 : { // swap small with large
- ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
- ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
- ; 1829 : _Traits::copy(_Right._Bx._Buf,
- ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
- ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 1832 : }
- ; 1833 : }
- ; 1834 :
- ; 1835 : void swap(_Myt& _Right)
- ; 1836 : { // exchange contents with _Right
- ; 1837 : if (this == &_Right)
- ; 1838 : ; // same object, do nothing
- ; 1839 : else if (this->_Getal() == _Right._Getal())
- ; 1840 : { // same allocator, swap control information
- ; 1841 : this->_Swap_all(_Right);
- ; 1842 : _Swap_bx(_Right);
- ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1844 : _STD swap(this->_Myres, _Right._Myres);
- ; 1845 : }
- ; 1846 :
- ; 1847 : #if _HAS_CPP0X
- ; 1848 : else if (_Alty::propagate_on_container_swap::value)
- ; 1849 : { // swap allocators and control information
- ; 1850 : this->_Swap_alloc(_Right);
- ; 1851 : _Swap_bx(_Right);
- ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
- ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1854 : _STD swap(this->_Myres, _Right._Myres);
- ; 1855 : }
- ; 1856 : #endif /* _HAS_CPP0X */
- ; 1857 :
- ; 1858 : else
- ; 1859 : { // different allocator, do multiple assigns
- ; 1860 : _Myt _Tmp = *this;
- ; 1861 :
- ; 1862 : *this = _Right;
- ; 1863 : _Right = _Tmp;
- ; 1864 : }
- ; 1865 : }
- ; 1866 :
- ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
- ; 1868 : { // look for _Right beginning at or after _Off
- ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
- ; 1870 : }
- ; 1871 :
- ; 1872 : size_type find(const _Elem *_Ptr,
- ; 1873 : size_type _Off, size_type _Count) const
- ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
- ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1876 : if (_Count != 0)
- ; 1877 : _DEBUG_POINTER(_Ptr);
- ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1879 :
- ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
- ; 1881 : return (_Off); // null string always matches (if inside string)
- ; 1882 :
- ; 1883 : size_type _Nm;
- ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
- ; 1885 : { // room for match, look for it
- ; 1886 : const _Elem *_Uptr, *_Vptr;
- ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
- ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
- ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
- ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1891 : return (_Uptr - this->_Myptr()); // found a match
- ; 1892 : }
- ; 1893 :
- ; 1894 : return (npos); // no match
- ; 1895 : }
- ; 1896 :
- ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
- ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
- ; 1899 : _DEBUG_POINTER(_Ptr);
- ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1901 : }
- ; 1902 :
- ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
- ; 1904 : { // look for _Ch at or after _Off
- ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1906 : }
- ; 1907 :
- ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
- ; 1909 : { // look for _Right beginning before _Off
- ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
- ; 1911 : }
- ; 1912 :
- ; 1913 : size_type rfind(const _Elem *_Ptr,
- ; 1914 : size_type _Off, size_type _Count) const
- ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
- ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1917 : if (_Count != 0)
- ; 1918 : _DEBUG_POINTER(_Ptr);
- ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1920 :
- ; 1921 : if (_Count == 0)
- ; 1922 : return (_Off < this->_Mysize ? _Off
- ; 1923 : : this->_Mysize); // null always matches
- ; 1924 : if (_Count <= this->_Mysize)
- ; 1925 : { // room for match, look for it
- ; 1926 : const _Elem *_Uptr = this->_Myptr() +
- ; 1927 : (_Off < this->_Mysize - _Count ? _Off
- ; 1928 : : this->_Mysize - _Count);
- ; 1929 : for (; ; --_Uptr)
- ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
- ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1932 : return (_Uptr - this->_Myptr()); // found a match
- ; 1933 : else if (_Uptr == this->_Myptr())
- ; 1934 : break; // at beginning, no more chance for match
- ; 1935 : }
- ; 1936 :
- ; 1937 : return (npos); // no match
- ; 1938 : }
- ; 1939 :
- ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
- ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
- ; 1942 : _DEBUG_POINTER(_Ptr);
- ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1944 : }
- ; 1945 :
- ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
- ; 1947 : { // look for _Ch before _Off
- ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 1949 : }
- ; 1950 :
- ; 1951 : size_type find_first_of(const _Myt& _Right,
- ; 1952 : size_type _Off = 0) const _NOEXCEPT
- ; 1953 : { // look for one of _Right at or after _Off
- ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1955 : }
- ; 1956 :
- ; 1957 : size_type find_first_of(const _Elem *_Ptr,
- ; 1958 : size_type _Off, size_type _Count) const
- ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
- ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1961 : if (_Count != 0)
- ; 1962 : _DEBUG_POINTER(_Ptr);
- ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1964 :
- ; 1965 : if (0 < _Count && _Off < this->_Mysize)
- ; 1966 : { // room for match, look for it
- ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 1969 : _Uptr < _Vptr; ++_Uptr)
- ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 1971 : return (_Uptr - this->_Myptr()); // found a match
- ; 1972 : }
- ; 1973 :
- ; 1974 : return (npos); // no match
- ; 1975 : }
- ; 1976 :
- ; 1977 : size_type find_first_of(const _Elem *_Ptr,
- ; 1978 : size_type _Off = 0) const
- ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 1980 : _DEBUG_POINTER(_Ptr);
- ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1982 : }
- ; 1983 :
- ; 1984 : size_type find_first_of(_Elem _Ch,
- ; 1985 : size_type _Off = 0) const
- ; 1986 : { // look for _Ch at or after _Off
- ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1988 : }
- ; 1989 :
- ; 1990 : size_type find_last_of(const _Myt& _Right,
- ; 1991 : size_type _Off = npos) const _NOEXCEPT
- ; 1992 : { // look for one of _Right before _Off
- ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1994 : }
- ; 1995 :
- ; 1996 : size_type find_last_of(const _Elem *_Ptr,
- ; 1997 : size_type _Off, size_type _Count) const
- ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
- ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2000 : if (_Count != 0)
- ; 2001 : _DEBUG_POINTER(_Ptr);
- ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2003 :
- ; 2004 : if (0 < _Count && 0 < this->_Mysize)
- ; 2005 : { // worth searching, do it
- ; 2006 : const _Elem *_Uptr = this->_Myptr()
- ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2008 : for (; ; --_Uptr)
- ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 2010 : return (_Uptr - this->_Myptr()); // found a match
- ; 2011 : else if (_Uptr == this->_Myptr())
- ; 2012 : break; // at beginning, no more chance for match
- ; 2013 : }
- ; 2014 :
- ; 2015 : return (npos); // no match
- ; 2016 : }
- ; 2017 :
- ; 2018 : size_type find_last_of(const _Elem *_Ptr,
- ; 2019 : size_type _Off = npos) const
- ; 2020 : { // look for one of [_Ptr, <null>) before _Off
- ; 2021 : _DEBUG_POINTER(_Ptr);
- ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2023 : }
- ; 2024 :
- ; 2025 : size_type find_last_of(_Elem _Ch,
- ; 2026 : size_type _Off = npos) const
- ; 2027 : { // look for _Ch before _Off
- ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 2029 : }
- ; 2030 :
- ; 2031 : size_type find_first_not_of(const _Myt& _Right,
- ; 2032 : size_type _Off = 0) const _NOEXCEPT
- ; 2033 : { // look for none of _Right at or after _Off
- ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
- ; 2035 : _Right.size()));
- ; 2036 : }
- ; 2037 :
- ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2039 : size_type _Off, size_type _Count) const
- ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
- ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2042 : if (_Count != 0)
- ; 2043 : _DEBUG_POINTER(_Ptr);
- ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2045 :
- ; 2046 : if (_Off < this->_Mysize)
- ; 2047 : { // room for match, look for it
- ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 2050 : _Uptr < _Vptr; ++_Uptr)
- ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2052 : return (_Uptr - this->_Myptr());
- ; 2053 : }
- ; 2054 : return (npos);
- ; 2055 : }
- ; 2056 :
- ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2058 : size_type _Off = 0) const
- ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 2060 : _DEBUG_POINTER(_Ptr);
- ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2062 : }
- ; 2063 :
- ; 2064 : size_type find_first_not_of(_Elem _Ch,
- ; 2065 : size_type _Off = 0) const
- ; 2066 : { // look for non _Ch at or after _Off
- ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2068 : }
- ; 2069 :
- ; 2070 : size_type find_last_not_of(const _Myt& _Right,
- ; 2071 : size_type _Off = npos) const _NOEXCEPT
- ; 2072 : { // look for none of _Right before _Off
- ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
- ; 2074 : }
- ; 2075 :
- ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2077 : size_type _Off, size_type _Count) const
- ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
- ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2080 : if (_Count != 0)
- ; 2081 : _DEBUG_POINTER(_Ptr);
- ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2083 :
- ; 2084 : if (0 < this->_Mysize)
- ; 2085 : { // worth searching, do it
- ; 2086 : const _Elem *_Uptr = this->_Myptr()
- ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2088 : for (; ; --_Uptr)
- ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2090 : return (_Uptr - this->_Myptr());
- ; 2091 : else if (_Uptr == this->_Myptr())
- ; 2092 : break;
- ; 2093 : }
- ; 2094 : return (npos);
- ; 2095 : }
- ; 2096 :
- ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2098 : size_type _Off = npos) const
- ; 2099 : { // look for none of [_Ptr, <null>) before _Off
- ; 2100 : _DEBUG_POINTER(_Ptr);
- ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2102 : }
- ; 2103 :
- ; 2104 : size_type find_last_not_of(_Elem _Ch,
- ; 2105 : size_type _Off = npos) const
- ; 2106 : { // look for non _Ch before _Off
- ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2108 : }
- ; 2109 :
- ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
- ; 2111 : { // return [_Off, _Off + _Count) as new string
- ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
- ; 2113 : }
- ; 2114 :
- ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
- ; 2116 : { // compare [0, _Mysize) with _Right
- ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
- ; 2118 : }
- ; 2119 :
- ; 2120 : int compare(size_type _Off, size_type _N0,
- ; 2121 : const _Myt& _Right) const
- ; 2122 : { // compare [_Off, _Off + _N0) with _Right
- ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
- ; 2124 : }
- ; 2125 :
- ; 2126 : int compare(size_type _Off,
- ; 2127 : size_type _N0, const _Myt& _Right,
- ; 2128 : size_type _Roff, size_type _Count) const
- ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 2130 : if (_Right.size() < _Roff)
- ; 2131 : _Xran(); // _Off off end
- ; 2132 : if (_Right._Mysize - _Roff < _Count)
- ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
- ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
- ; 2135 : }
- ; 2136 :
- ; 2137 : int compare(const _Elem *_Ptr) const
- ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
- ; 2139 : _DEBUG_POINTER(_Ptr);
- ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
- ; 2141 : }
- ; 2142 :
- ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
- ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 2145 : _DEBUG_POINTER(_Ptr);
- ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 2147 : }
- ; 2148 :
- ; 2149 : int compare(size_type _Off,
- ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
- ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2153 : if (_Count != 0)
- ; 2154 : _DEBUG_POINTER(_Ptr);
- ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2156 :
- ; 2157 : if (this->_Mysize < _Off)
- ; 2158 : _Xran(); // _Off off end
- ; 2159 : if (this->_Mysize - _Off < _N0)
- ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 2161 :
- ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
- ; 2163 : _N0 < _Count ? _N0 : _Count);
- ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
- ; 2165 : : _N0 == _Count ? 0 : +1);
- ; 2166 : }
- ; 2167 :
- ; 2168 : allocator_type get_allocator() const _NOEXCEPT
- ; 2169 : { // return allocator object for values
- ; 2170 : return (this->_Getal());
- ; 2171 : }
- ; 2172 :
- ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
- ; 2174 : { // assign _Count copies of _Ch beginning at _Off
- ; 2175 : if (_Count == 1)
- ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
- ; 2177 : else
- ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
- ; 2179 : }
- ; 2180 :
- ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
- ; 2182 : { // copy _Oldlen elements to newly allocated buffer
- ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
- ; 2184 : if (max_size() < _Newres)
- ; 2185 : _Newres = _Newsize; // undo roundup if too big
- ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
- ; 2187 : ;
- ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
- ; 2189 : _Newres = this->_Myres
- ; 2190 : + this->_Myres / 2; // grow exponentially if possible
- ; 2191 : else
- ; 2192 : _Newres = max_size(); // settle for max_size()
- ; 2193 :
- ; 2194 : _Elem *_Ptr;
- ; 2195 : _TRY_BEGIN
- ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2197 : _CATCH_ALL
- ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
- ; 2199 : _TRY_BEGIN
- ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2201 : _CATCH_ALL
- ; 2202 : _Tidy(true); // failed again, discard storage and reraise
- ; 2203 : _RERAISE;
- ; 2204 : _CATCH_END
- ; 2205 : _CATCH_END
- ; 2206 :
- ; 2207 : if (0 < _Oldlen)
- ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
- ; 2209 : _Oldlen); // copy existing elements
- ; 2210 : _Tidy(true);
- ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 2212 : this->_Myres = _Newres;
- ; 2213 : _Eos(_Oldlen);
- ; 2214 : }
- ; 2215 :
- ; 2216 : void _Eos(size_type _Newsize)
- ; 2217 : { // set new length and null terminator
- ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
- mov DWORD PTR [ecx+16], esi
- ; 517 : : this->_Bx._Buf);
- cmp eax, 16 ; 00000010H
- jb SHORT $LN60@Grow
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov ecx, DWORD PTR [ecx]
- $LN60@Grow:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [ecx], 0
- $LN64@Grow:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 2233 : return (0 < _Newsize); // return true only if more work to do
- xor eax, eax
- cmp eax, esi
- sbb eax, eax
- neg eax
- pop esi
- ; 2234 : }
- pop ebp
- ret 8
- $LN67@Grow:
- ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE_NI_N@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Grow
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?_Inside@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE_NPBD@Z
- _TEXT SEGMENT
- __Ptr$ = 8 ; size = 4
- ?_Inside@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE_NPBD@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Inside, COMDAT
- ; _this$ = ecx
- ; 2237 : { // test if _Ptr points inside string
- push ebp
- mov ebp, esp
- ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
- ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
- mov edx, DWORD PTR __Ptr$[ebp]
- push esi
- test edx, edx
- je SHORT $LN2@Inside
- ; 517 : : this->_Bx._Buf);
- mov eax, DWORD PTR [ecx+20]
- cmp eax, 16 ; 00000010H
- jb SHORT $LN8@Inside
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov esi, DWORD PTR [ecx]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 517 : : this->_Bx._Buf);
- jmp SHORT $LN9@Inside
- $LN8@Inside:
- mov esi, ecx
- $LN9@Inside:
- ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
- ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
- cmp edx, esi
- jb SHORT $LN2@Inside
- ; 517 : : this->_Bx._Buf);
- cmp eax, 16 ; 00000010H
- jb SHORT $LN14@Inside
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov esi, DWORD PTR [ecx]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 517 : : this->_Bx._Buf);
- jmp SHORT $LN15@Inside
- $LN14@Inside:
- mov esi, ecx
- $LN15@Inside:
- ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
- ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
- mov eax, DWORD PTR [ecx+16]
- add eax, esi
- cmp eax, edx
- jbe SHORT $LN2@Inside
- ; 2241 : else
- ; 2242 : return (true);
- mov al, 1
- pop esi
- ; 2243 : }
- pop ebp
- ret 4
- $LN2@Inside:
- ; 2240 : return (false); // don't ask
- xor al, al
- pop esi
- ; 2243 : }
- pop ebp
- ret 4
- ?_Inside@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE_NPBD@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Inside
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ
- _TEXT SEGMENT
- ?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Xlen, COMDAT
- ; _this$dead$ = ecx
- ; 2271 : _Xlength_error("string too long");
- push OFFSET ??_C@_0BA@JFNIOLAK@string?5too?5long?$AA@
- call DWORD PTR __imp_?_Xlength_error@std@@YAXPBD@Z
- $LN4@Xlen:
- $LN3@Xlen:
- int 3
- ?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Xlen
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?deallocate@?$allocator@D@std@@QAEXPADI@Z
- _TEXT SEGMENT
- __Ptr$ = 8 ; size = 4
- ___formal$dead$ = 12 ; size = 4
- ?deallocate@?$allocator@D@std@@QAEXPADI@Z PROC ; std::allocator<char>::deallocate, COMDAT
- ; _this$dead$ = ecx
- ; 585 : { // deallocate object at _Ptr, ignore size
- push ebp
- mov ebp, esp
- ; 586 : ::operator delete(_Ptr);
- push DWORD PTR __Ptr$[ebp]
- call DWORD PTR __imp_??3@YAXPAX@Z
- add esp, 4
- ; 587 : }
- pop ebp
- ret 8
- ?deallocate@?$allocator@D@std@@QAEXPADI@Z ENDP ; std::allocator<char>::deallocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ
- _TEXT SEGMENT
- ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ PROC ; std::_String_val<std::_Simple_types<char> >::_Myptr, COMDAT
- ; _this$ = ecx
- ; 515 : return (this->_BUF_SIZE <= this->_Myres
- ; 516 : ? _STD addressof(*this->_Bx._Ptr)
- ; 517 : : this->_Bx._Buf);
- cmp DWORD PTR [ecx+20], 16 ; 00000010H
- jb SHORT $LN3@Myptr
- mov eax, DWORD PTR [ecx]
- ; 518 : }
- ret 0
- $LN3@Myptr:
- ; 515 : return (this->_BUF_SIZE <= this->_Myres
- ; 516 : ? _STD addressof(*this->_Bx._Ptr)
- ; 517 : : this->_Bx._Buf);
- mov eax, ecx
- ; 518 : }
- ret 0
- ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ ENDP ; std::_String_val<std::_Simple_types<char> >::_Myptr
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?deallocate@?$allocator@H@std@@QAEXPAHI@Z
- _TEXT SEGMENT
- __Ptr$ = 8 ; size = 4
- ___formal$dead$ = 12 ; size = 4
- ?deallocate@?$allocator@H@std@@QAEXPAHI@Z PROC ; std::allocator<int>::deallocate, COMDAT
- ; _this$dead$ = ecx
- ; 585 : { // deallocate object at _Ptr, ignore size
- push ebp
- mov ebp, esp
- ; 586 : ::operator delete(_Ptr);
- push DWORD PTR __Ptr$[ebp]
- call DWORD PTR __imp_??3@YAXPAX@Z
- add esp, 4
- ; 587 : }
- pop ebp
- ret 8
- ?deallocate@?$allocator@H@std@@QAEXPAHI@Z ENDP ; std::allocator<int>::deallocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??0?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAE@XZ
- _TEXT SEGMENT
- ??0?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAE@XZ PROC ; std::_Wrap_alloc<std::allocator<int> >::_Wrap_alloc<std::allocator<int> >, COMDAT
- ; _this$ = ecx
- ; 831 : }
- mov eax, ecx
- ret 0
- ??0?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAE@XZ ENDP ; std::_Wrap_alloc<std::allocator<int> >::_Wrap_alloc<std::allocator<int> >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Unused_capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ
- _TEXT SEGMENT
- ?_Unused_capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ PROC ; std::vector<double,std::allocator<double> >::_Unused_capacity, COMDAT
- ; _this$ = ecx
- ; 972 : return (this->_Myend - this->_Mylast);
- mov eax, DWORD PTR [ecx+8]
- sub eax, DWORD PTR [ecx+4]
- sar eax, 3
- ; 973 : }
- ret 0
- ?_Unused_capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ ENDP ; std::vector<double,std::allocator<double> >::_Unused_capacity
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Make_iter@?$vector@NV?$allocator@N@std@@@std@@QBE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@V?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@@Z
- _TEXT SEGMENT
- ___$ReturnUdt$ = 8 ; size = 4
- __Where$ = 12 ; size = 4
- ?_Make_iter@?$vector@NV?$allocator@N@std@@@std@@QBE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@V?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@@Z PROC ; std::vector<double,std::allocator<double> >::_Make_iter, COMDAT
- ; _this$dead$ = ecx
- ; 1001 : { // make iterator from const_iterator
- push ebp
- mov ebp, esp
- ; 47 : { // construct with pointer _Parg
- mov eax, DWORD PTR ___$ReturnUdt$[ebp]
- mov ecx, DWORD PTR __Where$[ebp]
- mov DWORD PTR [eax], ecx
- ; 1002 : return (iterator(_Where._Ptr, this));
- ; 1003 : }
- pop ebp
- ret 8
- ?_Make_iter@?$vector@NV?$allocator@N@std@@@std@@QBE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@V?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@@Z ENDP ; std::vector<double,std::allocator<double> >::_Make_iter
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?max_size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ
- _TEXT SEGMENT
- ?max_size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ PROC ; std::vector<double,std::allocator<double> >::max_size, COMDAT
- ; _this$dead$ = ecx
- ; 1092 : return (this->_Getal().max_size());
- mov eax, 536870911 ; 1fffffffH
- ; 1093 : }
- ret 0
- ?max_size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ ENDP ; std::vector<double,std::allocator<double> >::max_size
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?clear@?$vector@NV?$allocator@N@std@@@std@@QAEXXZ
- _TEXT SEGMENT
- ?clear@?$vector@NV?$allocator@N@std@@@std@@QAEXXZ PROC ; std::vector<double,std::allocator<double> >::clear, COMDAT
- ; _this$ = ecx
- ; 1414 : this->_Orphan_all();
- ; 1415 : _Destroy(this->_Myfirst, this->_Mylast);
- ; 1416 : this->_Mylast = this->_Myfirst;
- mov eax, DWORD PTR [ecx]
- mov DWORD PTR [ecx+4], eax
- ; 1417 : }
- ret 0
- ?clear@?$vector@NV?$allocator@N@std@@@std@@QAEXXZ ENDP ; std::vector<double,std::allocator<double> >::clear
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Grow_to@?$vector@NV?$allocator@N@std@@@std@@IBEII@Z
- _TEXT SEGMENT
- __Count$ = 8 ; size = 4
- ?_Grow_to@?$vector@NV?$allocator@N@std@@@std@@IBEII@Z PROC ; std::vector<double,std::allocator<double> >::_Grow_to, COMDAT
- ; _this$ = ecx
- ; 1484 : { // grow by 50% or at least to _Count
- push ebp
- mov ebp, esp
- ; 967 : return (this->_Myend - this->_Myfirst);
- mov edx, DWORD PTR [ecx+8]
- sub edx, DWORD PTR [ecx]
- ; 1485 : size_type _Capacity = capacity();
- ; 1486 :
- ; 1487 : _Capacity = max_size() - _Capacity / 2 < _Capacity
- ; 1488 : ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
- mov eax, 536870911 ; 1fffffffH
- ; 967 : return (this->_Myend - this->_Myfirst);
- sar edx, 3
- ; 1485 : size_type _Capacity = capacity();
- ; 1486 :
- ; 1487 : _Capacity = max_size() - _Capacity / 2 < _Capacity
- ; 1488 : ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
- mov ecx, edx
- shr ecx, 1
- sub eax, ecx
- cmp eax, edx
- jae SHORT $LN4@Grow_to
- xor edx, edx
- ; 1489 : if (_Capacity < _Count)
- cmp edx, DWORD PTR __Count$[ebp]
- cmovb edx, DWORD PTR __Count$[ebp]
- ; 1490 : _Capacity = _Count;
- ; 1491 : return (_Capacity);
- mov eax, edx
- ; 1492 : }
- pop ebp
- ret 4
- $LN4@Grow_to:
- ; 1485 : size_type _Capacity = capacity();
- ; 1486 :
- ; 1487 : _Capacity = max_size() - _Capacity / 2 < _Capacity
- ; 1488 : ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
- add edx, ecx
- ; 1489 : if (_Capacity < _Count)
- cmp edx, DWORD PTR __Count$[ebp]
- cmovb edx, DWORD PTR __Count$[ebp]
- ; 1490 : _Capacity = _Count;
- ; 1491 : return (_Capacity);
- mov eax, edx
- ; 1492 : }
- pop ebp
- ret 4
- ?_Grow_to@?$vector@NV?$allocator@N@std@@@std@@IBEII@Z ENDP ; std::vector<double,std::allocator<double> >::_Grow_to
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Reallocate@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z
- _TEXT SEGMENT
- __Size$1$ = 8 ; size = 4
- __Count$ = 8 ; size = 4
- ?_Reallocate@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z PROC ; std::vector<double,std::allocator<double> >::_Reallocate, COMDAT
- ; _this$ = ecx
- ; 1500 : { // move to array of exactly _Count elements
- push ebp
- mov ebp, esp
- push ebx
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; 25 : if (_Count == 0)
- mov ebx, DWORD PTR __Count$[ebp]
- push esi
- ; 23 : void *_Ptr = 0;
- xor esi, esi
- push edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; 1500 : { // move to array of exactly _Count elements
- mov edi, ecx
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; 25 : if (_Count == 0)
- test ebx, ebx
- je SHORT $LN16@Reallocate
- ; 26 : ;
- ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
- ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
- cmp ebx, 536870911 ; 1fffffffH
- ja SHORT $LN15@Reallocate
- lea eax, DWORD PTR [ebx*8]
- push eax
- call DWORD PTR __imp_??2@YAPAXI@Z
- mov esi, eax
- add esp, 4
- test esi, esi
- jne SHORT $LN16@Reallocate
- $LN15@Reallocate:
- ; 29 : _Xbad_alloc(); // report no memory
- call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
- $LN52@Reallocate:
- $LN16@Reallocate:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; 1504 : _Umove(this->_Myfirst, this->_Mylast, _Ptr);
- mov ecx, DWORD PTR [edi]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; 461 : size_t _Count = (size_t)(_Last - _First);
- mov eax, DWORD PTR [edi+4]
- sub eax, ecx
- ; 463 : _Count * sizeof (*_First)) + _Count); // NB: non-overlapping move
- and eax, -8 ; fffffff8H
- push eax
- push ecx
- push esi
- call DWORD PTR __imp__memmove
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; 1087 : return (this->_Mylast - this->_Myfirst);
- mov ecx, DWORD PTR [edi]
- mov eax, DWORD PTR [edi+4]
- sub eax, ecx
- sar eax, 3
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; 463 : _Count * sizeof (*_First)) + _Count); // NB: non-overlapping move
- add esp, 12 ; 0000000cH
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; 1087 : return (this->_Mylast - this->_Myfirst);
- mov DWORD PTR __Size$1$[ebp], eax
- ; 1505 : _CATCH_ALL
- ; 1506 : this->_Getal().deallocate(_Ptr, _Count);
- ; 1507 : _RERAISE;
- ; 1508 : _CATCH_END
- ; 1509 :
- ; 1510 : size_type _Size = size();
- ; 1511 : if (this->_Myfirst != pointer())
- test ecx, ecx
- je SHORT $LN46@Reallocate
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; 586 : ::operator delete(_Ptr);
- push ecx
- call DWORD PTR __imp_??3@YAXPAX@Z
- add esp, 4
- $LN46@Reallocate:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; 1519 : this->_Myend = _Ptr + _Count;
- lea eax, DWORD PTR [esi+ebx*8]
- mov DWORD PTR [edi+8], eax
- ; 1520 : this->_Mylast = _Ptr + _Size;
- mov eax, DWORD PTR __Size$1$[ebp]
- ; 1521 : this->_Myfirst = _Ptr;
- mov DWORD PTR [edi], esi
- lea eax, DWORD PTR [esi+eax*8]
- mov DWORD PTR [edi+4], eax
- pop edi
- pop esi
- pop ebx
- ; 1522 : }
- pop ebp
- ret 4
- $LN51@Reallocate:
- ?_Reallocate@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z ENDP ; std::vector<double,std::allocator<double> >::_Reallocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Xlen@?$vector@NV?$allocator@N@std@@@std@@IBEXXZ
- _TEXT SEGMENT
- ?_Xlen@?$vector@NV?$allocator@N@std@@@std@@IBEXXZ PROC ; std::vector<double,std::allocator<double> >::_Xlen, COMDAT
- ; _this$dead$ = ecx
- ; 1667 : _Xlength_error("vector<T> too long");
- push OFFSET ??_C@_0BD@OLBABOEK@vector?$DMT?$DO?5too?5long?$AA@
- call DWORD PTR __imp_?_Xlength_error@std@@YAXPBD@Z
- $LN4@Xlen:
- $LN3@Xlen:
- int 3
- ?_Xlen@?$vector@NV?$allocator@N@std@@@std@@IBEXXZ ENDP ; std::vector<double,std::allocator<double> >::_Xlen
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?deallocate@?$allocator@N@std@@QAEXPANI@Z
- _TEXT SEGMENT
- __Ptr$ = 8 ; size = 4
- ___formal$dead$ = 12 ; size = 4
- ?deallocate@?$allocator@N@std@@QAEXPANI@Z PROC ; std::allocator<double>::deallocate, COMDAT
- ; _this$dead$ = ecx
- ; 585 : { // deallocate object at _Ptr, ignore size
- push ebp
- mov ebp, esp
- ; 586 : ::operator delete(_Ptr);
- push DWORD PTR __Ptr$[ebp]
- call DWORD PTR __imp_??3@YAXPAX@Z
- add esp, 4
- ; 587 : }
- pop ebp
- ret 8
- ?deallocate@?$allocator@N@std@@QAEXPANI@Z ENDP ; std::allocator<double>::deallocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??0?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAE@XZ
- _TEXT SEGMENT
- ??0?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAE@XZ PROC ; std::_Wrap_alloc<std::allocator<double> >::_Wrap_alloc<std::allocator<double> >, COMDAT
- ; _this$ = ecx
- ; 831 : }
- mov eax, ecx
- ret 0
- ??0?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAE@XZ ENDP ; std::_Wrap_alloc<std::allocator<double> >::_Wrap_alloc<std::allocator<double> >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ??0?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAE@PANPBU_Container_base0@1@@Z
- _TEXT SEGMENT
- __Parg$ = 8 ; size = 4
- __Pvector$dead$ = 12 ; size = 4
- ??0?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAE@PANPBU_Container_base0@1@@Z PROC ; std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double> > >::_Vector_iterator<std::_Vector_val<std::_Simple_types<double> > >, COMDAT
- ; _this$ = ecx
- ; 306 : { // construct with pointer _Parg
- push ebp
- mov ebp, esp
- ; 47 : { // construct with pointer _Parg
- mov eax, DWORD PTR __Parg$[ebp]
- mov DWORD PTR [ecx], eax
- ; 307 : }
- mov eax, ecx
- pop ebp
- ret 8
- ??0?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAE@PANPBU_Container_base0@1@@Z ENDP ; std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double> > >::_Vector_iterator<std::_Vector_val<std::_Simple_types<double> > >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ??Y?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAEAAV01@H@Z
- _TEXT SEGMENT
- __Off$ = 8 ; size = 4
- ??Y?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAEAAV01@H@Z PROC ; std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double> > >::operator+=, COMDAT
- ; _this$ = ecx
- ; 359 : { // increment by integer
- push ebp
- mov ebp, esp
- ; 170 : _Ptr += _Off;
- mov eax, DWORD PTR __Off$[ebp]
- shl eax, 3
- add DWORD PTR [ecx], eax
- ; 360 : *(_Mybase *)this += _Off;
- ; 361 : return (*this);
- mov eax, ecx
- ; 362 : }
- pop ebp
- ret 4
- ??Y?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAEAAV01@H@Z ENDP ; std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double> > >::operator+=
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ??8?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE_NABV01@@Z
- _TEXT SEGMENT
- __Right$ = 8 ; size = 4
- ??8?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE_NABV01@@Z PROC ; std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >::operator==, COMDAT
- ; _this$ = ecx
- ; 203 : { // test for iterator equality
- push ebp
- mov ebp, esp
- ; 204 : _Compat(_Right);
- ; 205 : return (this->_Ptr == _Right._Ptr);
- mov edx, DWORD PTR [ecx]
- mov ecx, DWORD PTR __Right$[ebp]
- xor eax, eax
- cmp edx, DWORD PTR [ecx]
- sete al
- ; 206 : }
- pop ebp
- ret 4
- ??8?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE_NABV01@@Z ENDP ; std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >::operator==
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ??9?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE_NABV01@@Z
- _TEXT SEGMENT
- __Right$ = 8 ; size = 4
- ??9?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE_NABV01@@Z PROC ; std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >::operator!=, COMDAT
- ; _this$ = ecx
- ; 209 : { // test for iterator inequality
- push ebp
- mov ebp, esp
- ; 205 : return (this->_Ptr == _Right._Ptr);
- mov edx, DWORD PTR [ecx]
- mov ecx, DWORD PTR __Right$[ebp]
- ; 210 : return (!(*this == _Right));
- xor eax, eax
- ; 205 : return (this->_Ptr == _Right._Ptr);
- cmp edx, DWORD PTR [ecx]
- ; 210 : return (!(*this == _Right));
- setne al
- ; 211 : }
- pop ebp
- ret 4
- ??9?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE_NABV01@@Z ENDP ; std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >::operator!=
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@I@Z
- _TEXT SEGMENT
- __Off$ = 8 ; size = 4
- ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@I@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::erase, COMDAT
- ; _this$ = ecx
- ; 1309 : { // erase elements [_Off, ...)
- push ebp
- mov ebp, esp
- ; 1310 : if (this->_Mysize < _Off)
- mov eax, DWORD PTR __Off$[ebp]
- cmp DWORD PTR [ecx+16], eax
- jae SHORT $LN1@erase
- ; 2219 : }
- ; 2220 :
- ; 2221 : bool _Grow(size_type _Newsize,
- ; 2222 : bool _Trim = false)
- ; 2223 : { // ensure buffer is big enough, trim to size if _Trim is true
- ; 2224 : if (max_size() < _Newsize)
- ; 2225 : _Xlen(); // result too long
- ; 2226 : if (this->_Myres < _Newsize)
- ; 2227 : _Copy(_Newsize, this->_Mysize); // reallocate to grow
- ; 2228 : else if (_Trim && _Newsize < this->_BUF_SIZE)
- ; 2229 : _Tidy(true, // copy and deallocate if trimming to small string
- ; 2230 : _Newsize < this->_Mysize ? _Newsize : this->_Mysize);
- ; 2231 : else if (_Newsize == 0)
- ; 2232 : _Eos(0); // new size is zero, just null terminate
- ; 2233 : return (0 < _Newsize); // return true only if more work to do
- ; 2234 : }
- ; 2235 :
- ; 2236 : bool _Inside(const _Elem *_Ptr)
- ; 2237 : { // test if _Ptr points inside string
- ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
- ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
- ; 2240 : return (false); // don't ask
- ; 2241 : else
- ; 2242 : return (true);
- ; 2243 : }
- ; 2244 :
- ; 2245 : static size_type _Pdif(const_iterator _P2,
- ; 2246 : const_iterator _P1)
- ; 2247 : { // compute safe iterator difference
- ; 2248 : return (_STRING_ITER_BASE(_P2) == 0 ? 0 : _P2 - _P1);
- ; 2249 : }
- ; 2250 :
- ; 2251 : void _Tidy(bool _Built = false,
- ; 2252 : size_type _Newsize = 0)
- ; 2253 : { // initialize buffer, deallocating any storage
- ; 2254 : if (!_Built)
- ; 2255 : ;
- ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
- ; 2257 : { // copy any leftovers to small buffer and deallocate
- ; 2258 : pointer _Ptr = this->_Bx._Ptr;
- ; 2259 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 2260 : if (0 < _Newsize)
- ; 2261 : _Traits::copy(this->_Bx._Buf,
- ; 2262 : _STD addressof(*_Ptr), _Newsize);
- ; 2263 : this->_Getal().deallocate(_Ptr, this->_Myres + 1);
- ; 2264 : }
- ; 2265 : this->_Myres = this->_BUF_SIZE - 1;
- ; 2266 : _Eos(_Newsize);
- ; 2267 : }
- ; 2268 :
- ; 2269 : __declspec(noreturn) void _Xlen() const
- ; 2270 : { // report a length_error
- ; 2271 : _Xlength_error("string too long");
- ; 2272 : }
- ; 2273 :
- ; 2274 : __declspec(noreturn) void _Xran() const
- ; 2275 : { // report an out_of_range error
- ; 2276 : _Xout_of_range("invalid string position");
- push OFFSET ??_C@_0BI@CFPLBAOH@invalid?5string?5position?$AA@
- call DWORD PTR __imp_?_Xout_of_range@std@@YAXPBD@Z
- $LN19@erase:
- $LN1@erase:
- ; 517 : : this->_Bx._Buf);
- cmp DWORD PTR [ecx+20], 16 ; 00000010H
- ; 1315 :
- ; 1316 : _Myt& erase(size_type _Off, size_type _Count)
- ; 1317 : { // erase elements [_Off, _Off + _Count)
- ; 1318 : if (this->_Mysize < _Off)
- ; 1319 : _Xran(); // _Off off end
- ; 1320 : if (this->_Mysize - _Off <= _Count)
- ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
- ; 1322 : else if (0 < _Count)
- ; 1323 : { // move elements down
- ; 1324 : value_type *_Ptr = this->_Myptr() + _Off;
- ; 1325 : size_type _Newsize = this->_Mysize - _Count;
- ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
- ; 1327 : _Eos(_Newsize);
- ; 1328 : }
- ; 1329 : return (*this);
- ; 1330 : }
- ; 1331 :
- ; 1332 : iterator erase(const_iterator _Where)
- ; 1333 : { // erase element at _Where
- ; 1334 : size_type _Count = _Pdif(_Where, begin());
- ; 1335 : erase(_Count, 1);
- ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1337 : }
- ; 1338 :
- ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
- ; 1340 : { // erase substring [_First, _Last)
- ; 1341 : _DEBUG_RANGE(_First, _Last);
- ; 1342 : size_type _Count = _Pdif(_First, begin());
- ; 1343 : erase(_Count, _Pdif(_Last, _First));
- ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1345 : }
- ; 1346 :
- ; 1347 : void clear() _NOEXCEPT
- ; 1348 : { // erase all
- ; 1349 : _Eos(0);
- ; 1350 : }
- ; 1351 :
- ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
- ; 1353 : { // replace [_Off, _Off + _N0) with _Right
- ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
- ; 1355 : }
- ; 1356 :
- ; 1357 : _Myt& replace(size_type _Off,
- ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
- ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
- ; 1361 : _Xran(); // _Off or _Roff off end
- ; 1362 : if (this->_Mysize - _Off < _N0)
- ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1364 : size_type _Num = _Right.size() - _Roff;
- ; 1365 : if (_Num < _Count)
- ; 1366 : _Count = _Num; // trim _Count to size
- ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1368 : _Xlen(); // result too long
- ; 1369 :
- ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
- ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
- ; 1372 : if (this->_Mysize < _Newsize)
- ; 1373 : _Grow(_Newsize);
- ; 1374 :
- ; 1375 : if (this != &_Right)
- ; 1376 : { // no overlap, just move down and copy in new stuff
- ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
- ; 1379 : _Traits::copy(this->_Myptr() + _Off,
- ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
- ; 1381 : }
- ; 1382 : else if (_Count <= _N0)
- ; 1383 : { // hole doesn't get larger, just copy in substring
- ; 1384 : _Traits::move(this->_Myptr() + _Off,
- ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1388 : }
- ; 1389 : else if (_Roff <= _Off)
- ; 1390 : { // hole gets larger, substring begins before hole
- ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1393 : _Traits::move(this->_Myptr() + _Off,
- ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1395 : }
- ; 1396 : else if (_Off + _N0 <= _Roff)
- ; 1397 : { // hole gets larger, substring begins after hole
- ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1400 : _Traits::move(this->_Myptr() + _Off,
- ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
- ; 1402 : _Count); // fill hole
- ; 1403 : }
- ; 1404 : else
- ; 1405 : { // hole gets larger, substring begins in hole
- ; 1406 : _Traits::move(this->_Myptr() + _Off,
- ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
- ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
- ; 1411 : this->_Myptr() + _Roff + _Count,
- ; 1412 : _Count - _N0); // fill rest of new hole
- ; 1413 : }
- ; 1414 :
- ; 1415 : _Eos(_Newsize);
- ; 1416 : return (*this);
- ; 1417 : }
- ; 1418 :
- ; 1419 : _Myt& replace(size_type _Off,
- ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
- ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1423 : if (_Count != 0)
- ; 1424 : _DEBUG_POINTER(_Ptr);
- ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1426 :
- ; 1427 : if (_Inside(_Ptr))
- ; 1428 : return (replace(_Off, _N0, *this,
- ; 1429 : _Ptr - this->_Myptr(),
- ; 1430 : _Count)); // substring, replace carefully
- ; 1431 : if (this->_Mysize < _Off)
- ; 1432 : _Xran(); // _Off off end
- ; 1433 : if (this->_Mysize - _Off < _N0)
- ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1436 : _Xlen(); // result too long
- ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1438 :
- ; 1439 : if (_Count < _N0)
- ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1441 : this->_Myptr() + _Off + _N0,
- ; 1442 : _Nm); // smaller hole, move tail up
- ; 1443 : size_type _Num;
- ; 1444 : if ((0 < _Count || 0 < _N0)
- ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1446 : { // make room and rearrange
- ; 1447 : if (_N0 < _Count)
- ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
- ; 1451 : _Eos(_Num);
- ; 1452 : }
- ; 1453 : return (*this);
- ; 1454 : }
- ; 1455 :
- ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
- ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 1458 : _DEBUG_POINTER(_Ptr);
- ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 1460 : }
- ; 1461 :
- ; 1462 : _Myt& replace(size_type _Off,
- ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
- ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
- ; 1465 : if (this->_Mysize < _Off)
- ; 1466 : _Xran(); // _Off off end
- ; 1467 : if (this->_Mysize - _Off < _N0)
- ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1470 : _Xlen(); // result too long
- ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1472 :
- ; 1473 : if (_Count < _N0)
- ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1475 : this->_Myptr() + _Off + _N0,
- ; 1476 : _Nm); // smaller hole, move tail up
- ; 1477 : size_type _Num;
- ; 1478 : if ((0 < _Count || 0 < _N0)
- ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1480 : { // make room and rearrange
- ; 1481 : if (_N0 < _Count)
- ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
- ; 1485 : _Eos(_Num);
- ; 1486 : }
- ; 1487 : return (*this);
- ; 1488 : }
- ; 1489 :
- ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1491 : const _Myt& _Right)
- ; 1492 : { // replace [_First, _Last) with _Right
- ; 1493 : return (replace(
- ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
- ; 1495 : }
- ; 1496 :
- ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1498 : const _Elem *_Ptr, size_type _Count)
- ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
- ; 1500 : return (replace(
- ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
- ; 1502 : }
- ; 1503 :
- ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1505 : const _Elem *_Ptr)
- ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
- ; 1507 : return (replace(
- ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
- ; 1509 : }
- ; 1510 :
- ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1512 : size_type _Count, _Elem _Ch)
- ; 1513 : { // replace [_First, _Last) with _Count * _Ch
- ; 1514 : return (replace(
- ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
- ; 1516 : }
- ; 1517 :
- ; 1518 : template<class _Iter>
- ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1520 : _Myt&>::type
- ; 1521 : replace(const_iterator _First, const_iterator _Last,
- ; 1522 : _Iter _First2, _Iter _Last2)
- ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
- ; 1524 : _Myt _Right(_First2, _Last2);
- ; 1525 : replace(_First, _Last, _Right);
- ; 1526 : return (*this);
- ; 1527 : }
- ; 1528 :
- ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1530 : const_pointer _First2, const_pointer _Last2)
- ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1532 : if (_First2 == _Last2)
- ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1534 : else
- ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1536 : &*_First2, _Last2 - _First2);
- ; 1537 : return (*this);
- ; 1538 : }
- ; 1539 :
- ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1541 : pointer _First2, pointer _Last2)
- ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1543 : if (_First2 == _Last2)
- ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1545 : else
- ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1547 : &*_First2, _Last2 - _First2);
- ; 1548 : return (*this);
- ; 1549 : }
- ; 1550 :
- ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1552 : const_iterator _First2, const_iterator _Last2)
- ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1554 : if (_First2 == _Last2)
- ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1556 : else
- ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1558 : &*_First2, _Last2 - _First2);
- ; 1559 : return (*this);
- ; 1560 : }
- ; 1561 :
- ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1563 : iterator _First2, iterator _Last2)
- ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1565 : if (_First2 == _Last2)
- ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1567 : else
- ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1569 : &*_First2, _Last2 - _First2);
- ; 1570 : return (*this);
- ; 1571 : }
- ; 1572 :
- ; 1573 : iterator begin() _NOEXCEPT
- ; 1574 : { // return iterator for beginning of mutable sequence
- ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
- ; 1576 : }
- ; 1577 :
- ; 1578 : const_iterator begin() const _NOEXCEPT
- ; 1579 : { // return iterator for beginning of nonmutable sequence
- ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
- ; 1581 : }
- ; 1582 :
- ; 1583 : iterator end() _NOEXCEPT
- ; 1584 : { // return iterator for end of mutable sequence
- ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1586 : }
- ; 1587 :
- ; 1588 : const_iterator end() const _NOEXCEPT
- ; 1589 : { // return iterator for end of nonmutable sequence
- ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1591 : }
- ; 1592 :
- ; 1593 : reverse_iterator rbegin() _NOEXCEPT
- ; 1594 : { // return iterator for beginning of reversed mutable sequence
- ; 1595 : return (reverse_iterator(end()));
- ; 1596 : }
- ; 1597 :
- ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
- ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1600 : return (const_reverse_iterator(end()));
- ; 1601 : }
- ; 1602 :
- ; 1603 : reverse_iterator rend() _NOEXCEPT
- ; 1604 : { // return iterator for end of reversed mutable sequence
- ; 1605 : return (reverse_iterator(begin()));
- ; 1606 : }
- ; 1607 :
- ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
- ; 1609 : { // return iterator for end of reversed nonmutable sequence
- ; 1610 : return (const_reverse_iterator(begin()));
- ; 1611 : }
- ; 1612 :
- ; 1613 : #if _HAS_CPP0X
- ; 1614 : const_iterator cbegin() const _NOEXCEPT
- ; 1615 : { // return iterator for beginning of nonmutable sequence
- ; 1616 : return (((const _Myt *)this)->begin());
- ; 1617 : }
- ; 1618 :
- ; 1619 : const_iterator cend() const _NOEXCEPT
- ; 1620 : { // return iterator for end of nonmutable sequence
- ; 1621 : return (((const _Myt *)this)->end());
- ; 1622 : }
- ; 1623 :
- ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
- ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1626 : return (((const _Myt *)this)->rbegin());
- ; 1627 : }
- ; 1628 :
- ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
- ; 1630 : { // return iterator for end of reversed nonmutable sequence
- ; 1631 : return (((const _Myt *)this)->rend());
- ; 1632 : }
- ; 1633 :
- ; 1634 : void shrink_to_fit()
- ; 1635 : { // reduce capacity
- ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
- ; 1637 : { // worth shrinking, do it
- ; 1638 : _Myt _Tmp(*this);
- ; 1639 : swap(_Tmp);
- ; 1640 : }
- ; 1641 : }
- ; 1642 : #endif /* _HAS_CPP0X */
- ; 1643 :
- ; 1644 : reference at(size_type _Off)
- ; 1645 : { // subscript mutable sequence with checking
- ; 1646 : if (this->_Mysize <= _Off)
- ; 1647 : _Xran(); // _Off off end
- ; 1648 : return (this->_Myptr()[_Off]);
- ; 1649 : }
- ; 1650 :
- ; 1651 : const_reference at(size_type _Off) const
- ; 1652 : { // subscript nonmutable sequence with checking
- ; 1653 : if (this->_Mysize <= _Off)
- ; 1654 : _Xran(); // _Off off end
- ; 1655 : return (this->_Myptr()[_Off]);
- ; 1656 : }
- ; 1657 :
- ; 1658 : reference operator[](size_type _Off)
- ; 1659 : { // subscript mutable sequence
- ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1661 : if (this->_Mysize < _Off) // sic
- ; 1662 : _DEBUG_ERROR("string subscript out of range");
- ; 1663 :
- ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1667 :
- ; 1668 : return (this->_Myptr()[_Off]);
- ; 1669 : }
- ; 1670 :
- ; 1671 : const_reference operator[](size_type _Off) const
- ; 1672 : { // subscript nonmutable sequence
- ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1674 : if (this->_Mysize < _Off) // sic
- ; 1675 : _DEBUG_ERROR("string subscript out of range");
- ; 1676 :
- ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1680 :
- ; 1681 : return (this->_Myptr()[_Off]);
- ; 1682 : }
- ; 1683 :
- ; 1684 : void push_back(_Elem _Ch)
- ; 1685 : { // insert element at end
- ; 1686 : insert(end(), _Ch);
- ; 1687 : }
- ; 1688 :
- ; 1689 : #if _HAS_CPP0X
- ; 1690 : void pop_back()
- ; 1691 : { // erase element at end
- ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
- ; 1693 : }
- ; 1694 :
- ; 1695 : reference front()
- ; 1696 : { // return first element of mutable sequence
- ; 1697 : return (*begin());
- ; 1698 : }
- ; 1699 :
- ; 1700 : const_reference front() const
- ; 1701 : { // return first element of nonmutable sequence
- ; 1702 : return (*begin());
- ; 1703 : }
- ; 1704 :
- ; 1705 : reference back()
- ; 1706 : { // return last element of mutable sequence
- ; 1707 : return (*(end() - 1));
- ; 1708 : }
- ; 1709 :
- ; 1710 : const_reference back() const
- ; 1711 : { // return last element of nonmutable sequence
- ; 1712 : return (*(end() - 1));
- ; 1713 : }
- ; 1714 : #endif /* _HAS_CPP0X */
- ; 1715 :
- ; 1716 : const _Elem *c_str() const _NOEXCEPT
- ; 1717 : { // return pointer to null-terminated nonmutable array
- ; 1718 : return (this->_Myptr());
- ; 1719 : }
- ; 1720 :
- ; 1721 : const _Elem *data() const _NOEXCEPT
- ; 1722 : { // return pointer to nonmutable array
- ; 1723 : return (c_str());
- ; 1724 : }
- ; 1725 :
- ; 1726 : size_type length() const _NOEXCEPT
- ; 1727 : { // return length of sequence
- ; 1728 : return (this->_Mysize);
- ; 1729 : }
- ; 1730 :
- ; 1731 : size_type size() const _NOEXCEPT
- ; 1732 : { // return length of sequence
- ; 1733 : return (this->_Mysize);
- ; 1734 : }
- ; 1735 :
- ; 1736 : size_type max_size() const _NOEXCEPT
- ; 1737 : { // return maximum possible length of sequence
- ; 1738 : size_type _Num = this->_Getal().max_size();
- ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
- ; 1740 : }
- ; 1741 :
- ; 1742 : void resize(size_type _Newsize)
- ; 1743 : { // determine new length, padding with null elements as needed
- ; 1744 : resize(_Newsize, _Elem());
- ; 1745 : }
- ; 1746 :
- ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
- ; 1748 : { // determine new length, padding with _Ch elements as needed
- ; 1749 : if (_Newsize <= this->_Mysize)
- ; 1750 : _Eos(_Newsize);
- ; 1751 : else
- ; 1752 : append(_Newsize - this->_Mysize, _Ch);
- ; 1753 : }
- ; 1754 :
- ; 1755 : size_type capacity() const _NOEXCEPT
- ; 1756 : { // return current length of allocated storage
- ; 1757 : return (this->_Myres);
- ; 1758 : }
- ; 1759 :
- ; 1760 : void reserve(size_type _Newcap = 0)
- ; 1761 : { // determine new minimum length of allocated storage
- ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
- ; 1763 : { // change reservation
- ; 1764 : size_type _Size = this->_Mysize;
- ; 1765 : if (_Grow(_Newcap, true))
- ; 1766 : _Eos(_Size);
- ; 1767 : }
- ; 1768 : }
- ; 1769 :
- ; 1770 : bool empty() const _NOEXCEPT
- ; 1771 : { // test if sequence is empty
- ; 1772 : return (this->_Mysize == 0);
- ; 1773 : }
- ; 1774 :
- ; 1775 : _SCL_INSECURE_DEPRECATE
- ; 1776 :
- ; 1777 : size_type copy(_Elem *_Ptr,
- ; 1778 : size_type _Count, size_type _Off = 0) const
- ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
- ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1781 : if (_Count != 0)
- ; 1782 : _DEBUG_POINTER(_Ptr);
- ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1784 :
- ; 1785 : if (this->_Mysize < _Off)
- ; 1786 : _Xran(); // _Off off end
- ; 1787 : if (this->_Mysize - _Off < _Count)
- ; 1788 : _Count = this->_Mysize - _Off;
- ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
- ; 1790 : return (_Count);
- ; 1791 : }
- ; 1792 :
- ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
- ; 1794 : size_type _Count, size_type _Off = 0) const
- ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
- ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1797 : if (_Count != 0)
- ; 1798 : _DEBUG_POINTER(_Dest);
- ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1800 :
- ; 1801 : if (this->_Mysize < _Off)
- ; 1802 : _Xran(); // _Off off end
- ; 1803 : if (this->_Mysize - _Off < _Count)
- ; 1804 : _Count = this->_Mysize - _Off;
- ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
- ; 1806 : return (_Count);
- ; 1807 : }
- ; 1808 :
- ; 1809 : void _Swap_bx(_Myt& _Right)
- ; 1810 : { // exchange _Bx with _Right._Bx
- ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
- ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
- ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
- ; 1814 : else
- ; 1815 : { // swap large with small
- ; 1816 : pointer _Ptr = this->_Bx._Ptr;
- ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 1818 : _Traits::copy(this->_Bx._Buf,
- ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
- ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
- ; 1821 : }
- ; 1822 : else
- ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
- ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
- ; 1825 : else
- ; 1826 : { // swap small with large
- ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
- ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
- ; 1829 : _Traits::copy(_Right._Bx._Buf,
- ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
- ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 1832 : }
- ; 1833 : }
- ; 1834 :
- ; 1835 : void swap(_Myt& _Right)
- ; 1836 : { // exchange contents with _Right
- ; 1837 : if (this == &_Right)
- ; 1838 : ; // same object, do nothing
- ; 1839 : else if (this->_Getal() == _Right._Getal())
- ; 1840 : { // same allocator, swap control information
- ; 1841 : this->_Swap_all(_Right);
- ; 1842 : _Swap_bx(_Right);
- ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1844 : _STD swap(this->_Myres, _Right._Myres);
- ; 1845 : }
- ; 1846 :
- ; 1847 : #if _HAS_CPP0X
- ; 1848 : else if (_Alty::propagate_on_container_swap::value)
- ; 1849 : { // swap allocators and control information
- ; 1850 : this->_Swap_alloc(_Right);
- ; 1851 : _Swap_bx(_Right);
- ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
- ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1854 : _STD swap(this->_Myres, _Right._Myres);
- ; 1855 : }
- ; 1856 : #endif /* _HAS_CPP0X */
- ; 1857 :
- ; 1858 : else
- ; 1859 : { // different allocator, do multiple assigns
- ; 1860 : _Myt _Tmp = *this;
- ; 1861 :
- ; 1862 : *this = _Right;
- ; 1863 : _Right = _Tmp;
- ; 1864 : }
- ; 1865 : }
- ; 1866 :
- ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
- ; 1868 : { // look for _Right beginning at or after _Off
- ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
- ; 1870 : }
- ; 1871 :
- ; 1872 : size_type find(const _Elem *_Ptr,
- ; 1873 : size_type _Off, size_type _Count) const
- ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
- ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1876 : if (_Count != 0)
- ; 1877 : _DEBUG_POINTER(_Ptr);
- ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1879 :
- ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
- ; 1881 : return (_Off); // null string always matches (if inside string)
- ; 1882 :
- ; 1883 : size_type _Nm;
- ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
- ; 1885 : { // room for match, look for it
- ; 1886 : const _Elem *_Uptr, *_Vptr;
- ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
- ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
- ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
- ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1891 : return (_Uptr - this->_Myptr()); // found a match
- ; 1892 : }
- ; 1893 :
- ; 1894 : return (npos); // no match
- ; 1895 : }
- ; 1896 :
- ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
- ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
- ; 1899 : _DEBUG_POINTER(_Ptr);
- ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1901 : }
- ; 1902 :
- ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
- ; 1904 : { // look for _Ch at or after _Off
- ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1906 : }
- ; 1907 :
- ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
- ; 1909 : { // look for _Right beginning before _Off
- ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
- ; 1911 : }
- ; 1912 :
- ; 1913 : size_type rfind(const _Elem *_Ptr,
- ; 1914 : size_type _Off, size_type _Count) const
- ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
- ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1917 : if (_Count != 0)
- ; 1918 : _DEBUG_POINTER(_Ptr);
- ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1920 :
- ; 1921 : if (_Count == 0)
- ; 1922 : return (_Off < this->_Mysize ? _Off
- ; 1923 : : this->_Mysize); // null always matches
- ; 1924 : if (_Count <= this->_Mysize)
- ; 1925 : { // room for match, look for it
- ; 1926 : const _Elem *_Uptr = this->_Myptr() +
- ; 1927 : (_Off < this->_Mysize - _Count ? _Off
- ; 1928 : : this->_Mysize - _Count);
- ; 1929 : for (; ; --_Uptr)
- ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
- ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1932 : return (_Uptr - this->_Myptr()); // found a match
- ; 1933 : else if (_Uptr == this->_Myptr())
- ; 1934 : break; // at beginning, no more chance for match
- ; 1935 : }
- ; 1936 :
- ; 1937 : return (npos); // no match
- ; 1938 : }
- ; 1939 :
- ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
- ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
- ; 1942 : _DEBUG_POINTER(_Ptr);
- ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1944 : }
- ; 1945 :
- ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
- ; 1947 : { // look for _Ch before _Off
- ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 1949 : }
- ; 1950 :
- ; 1951 : size_type find_first_of(const _Myt& _Right,
- ; 1952 : size_type _Off = 0) const _NOEXCEPT
- ; 1953 : { // look for one of _Right at or after _Off
- ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1955 : }
- ; 1956 :
- ; 1957 : size_type find_first_of(const _Elem *_Ptr,
- ; 1958 : size_type _Off, size_type _Count) const
- ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
- ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1961 : if (_Count != 0)
- ; 1962 : _DEBUG_POINTER(_Ptr);
- ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1964 :
- ; 1965 : if (0 < _Count && _Off < this->_Mysize)
- ; 1966 : { // room for match, look for it
- ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 1969 : _Uptr < _Vptr; ++_Uptr)
- ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 1971 : return (_Uptr - this->_Myptr()); // found a match
- ; 1972 : }
- ; 1973 :
- ; 1974 : return (npos); // no match
- ; 1975 : }
- ; 1976 :
- ; 1977 : size_type find_first_of(const _Elem *_Ptr,
- ; 1978 : size_type _Off = 0) const
- ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 1980 : _DEBUG_POINTER(_Ptr);
- ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1982 : }
- ; 1983 :
- ; 1984 : size_type find_first_of(_Elem _Ch,
- ; 1985 : size_type _Off = 0) const
- ; 1986 : { // look for _Ch at or after _Off
- ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1988 : }
- ; 1989 :
- ; 1990 : size_type find_last_of(const _Myt& _Right,
- ; 1991 : size_type _Off = npos) const _NOEXCEPT
- ; 1992 : { // look for one of _Right before _Off
- ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1994 : }
- ; 1995 :
- ; 1996 : size_type find_last_of(const _Elem *_Ptr,
- ; 1997 : size_type _Off, size_type _Count) const
- ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
- ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2000 : if (_Count != 0)
- ; 2001 : _DEBUG_POINTER(_Ptr);
- ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2003 :
- ; 2004 : if (0 < _Count && 0 < this->_Mysize)
- ; 2005 : { // worth searching, do it
- ; 2006 : const _Elem *_Uptr = this->_Myptr()
- ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2008 : for (; ; --_Uptr)
- ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 2010 : return (_Uptr - this->_Myptr()); // found a match
- ; 2011 : else if (_Uptr == this->_Myptr())
- ; 2012 : break; // at beginning, no more chance for match
- ; 2013 : }
- ; 2014 :
- ; 2015 : return (npos); // no match
- ; 2016 : }
- ; 2017 :
- ; 2018 : size_type find_last_of(const _Elem *_Ptr,
- ; 2019 : size_type _Off = npos) const
- ; 2020 : { // look for one of [_Ptr, <null>) before _Off
- ; 2021 : _DEBUG_POINTER(_Ptr);
- ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2023 : }
- ; 2024 :
- ; 2025 : size_type find_last_of(_Elem _Ch,
- ; 2026 : size_type _Off = npos) const
- ; 2027 : { // look for _Ch before _Off
- ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 2029 : }
- ; 2030 :
- ; 2031 : size_type find_first_not_of(const _Myt& _Right,
- ; 2032 : size_type _Off = 0) const _NOEXCEPT
- ; 2033 : { // look for none of _Right at or after _Off
- ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
- ; 2035 : _Right.size()));
- ; 2036 : }
- ; 2037 :
- ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2039 : size_type _Off, size_type _Count) const
- ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
- ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2042 : if (_Count != 0)
- ; 2043 : _DEBUG_POINTER(_Ptr);
- ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2045 :
- ; 2046 : if (_Off < this->_Mysize)
- ; 2047 : { // room for match, look for it
- ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 2050 : _Uptr < _Vptr; ++_Uptr)
- ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2052 : return (_Uptr - this->_Myptr());
- ; 2053 : }
- ; 2054 : return (npos);
- ; 2055 : }
- ; 2056 :
- ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2058 : size_type _Off = 0) const
- ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 2060 : _DEBUG_POINTER(_Ptr);
- ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2062 : }
- ; 2063 :
- ; 2064 : size_type find_first_not_of(_Elem _Ch,
- ; 2065 : size_type _Off = 0) const
- ; 2066 : { // look for non _Ch at or after _Off
- ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2068 : }
- ; 2069 :
- ; 2070 : size_type find_last_not_of(const _Myt& _Right,
- ; 2071 : size_type _Off = npos) const _NOEXCEPT
- ; 2072 : { // look for none of _Right before _Off
- ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
- ; 2074 : }
- ; 2075 :
- ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2077 : size_type _Off, size_type _Count) const
- ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
- ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2080 : if (_Count != 0)
- ; 2081 : _DEBUG_POINTER(_Ptr);
- ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2083 :
- ; 2084 : if (0 < this->_Mysize)
- ; 2085 : { // worth searching, do it
- ; 2086 : const _Elem *_Uptr = this->_Myptr()
- ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2088 : for (; ; --_Uptr)
- ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2090 : return (_Uptr - this->_Myptr());
- ; 2091 : else if (_Uptr == this->_Myptr())
- ; 2092 : break;
- ; 2093 : }
- ; 2094 : return (npos);
- ; 2095 : }
- ; 2096 :
- ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2098 : size_type _Off = npos) const
- ; 2099 : { // look for none of [_Ptr, <null>) before _Off
- ; 2100 : _DEBUG_POINTER(_Ptr);
- ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2102 : }
- ; 2103 :
- ; 2104 : size_type find_last_not_of(_Elem _Ch,
- ; 2105 : size_type _Off = npos) const
- ; 2106 : { // look for non _Ch before _Off
- ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2108 : }
- ; 2109 :
- ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
- ; 2111 : { // return [_Off, _Off + _Count) as new string
- ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
- ; 2113 : }
- ; 2114 :
- ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
- ; 2116 : { // compare [0, _Mysize) with _Right
- ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
- ; 2118 : }
- ; 2119 :
- ; 2120 : int compare(size_type _Off, size_type _N0,
- ; 2121 : const _Myt& _Right) const
- ; 2122 : { // compare [_Off, _Off + _N0) with _Right
- ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
- ; 2124 : }
- ; 2125 :
- ; 2126 : int compare(size_type _Off,
- ; 2127 : size_type _N0, const _Myt& _Right,
- ; 2128 : size_type _Roff, size_type _Count) const
- ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 2130 : if (_Right.size() < _Roff)
- ; 2131 : _Xran(); // _Off off end
- ; 2132 : if (_Right._Mysize - _Roff < _Count)
- ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
- ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
- ; 2135 : }
- ; 2136 :
- ; 2137 : int compare(const _Elem *_Ptr) const
- ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
- ; 2139 : _DEBUG_POINTER(_Ptr);
- ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
- ; 2141 : }
- ; 2142 :
- ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
- ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 2145 : _DEBUG_POINTER(_Ptr);
- ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 2147 : }
- ; 2148 :
- ; 2149 : int compare(size_type _Off,
- ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
- ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2153 : if (_Count != 0)
- ; 2154 : _DEBUG_POINTER(_Ptr);
- ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2156 :
- ; 2157 : if (this->_Mysize < _Off)
- ; 2158 : _Xran(); // _Off off end
- ; 2159 : if (this->_Mysize - _Off < _N0)
- ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 2161 :
- ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
- ; 2163 : _N0 < _Count ? _N0 : _Count);
- ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
- ; 2165 : : _N0 == _Count ? 0 : +1);
- ; 2166 : }
- ; 2167 :
- ; 2168 : allocator_type get_allocator() const _NOEXCEPT
- ; 2169 : { // return allocator object for values
- ; 2170 : return (this->_Getal());
- ; 2171 : }
- ; 2172 :
- ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
- ; 2174 : { // assign _Count copies of _Ch beginning at _Off
- ; 2175 : if (_Count == 1)
- ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
- ; 2177 : else
- ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
- ; 2179 : }
- ; 2180 :
- ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
- ; 2182 : { // copy _Oldlen elements to newly allocated buffer
- ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
- ; 2184 : if (max_size() < _Newres)
- ; 2185 : _Newres = _Newsize; // undo roundup if too big
- ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
- ; 2187 : ;
- ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
- ; 2189 : _Newres = this->_Myres
- ; 2190 : + this->_Myres / 2; // grow exponentially if possible
- ; 2191 : else
- ; 2192 : _Newres = max_size(); // settle for max_size()
- ; 2193 :
- ; 2194 : _Elem *_Ptr;
- ; 2195 : _TRY_BEGIN
- ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2197 : _CATCH_ALL
- ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
- ; 2199 : _TRY_BEGIN
- ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2201 : _CATCH_ALL
- ; 2202 : _Tidy(true); // failed again, discard storage and reraise
- ; 2203 : _RERAISE;
- ; 2204 : _CATCH_END
- ; 2205 : _CATCH_END
- ; 2206 :
- ; 2207 : if (0 < _Oldlen)
- ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
- ; 2209 : _Oldlen); // copy existing elements
- ; 2210 : _Tidy(true);
- ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 2212 : this->_Myres = _Newres;
- ; 2213 : _Eos(_Oldlen);
- ; 2214 : }
- ; 2215 :
- ; 2216 : void _Eos(size_type _Newsize)
- ; 2217 : { // set new length and null terminator
- ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
- mov DWORD PTR [ecx+16], eax
- ; 517 : : this->_Bx._Buf);
- jb SHORT $LN11@erase
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov edx, DWORD PTR [ecx]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [edx+eax], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1313 : return (*this);
- mov eax, ecx
- ; 1314 : }
- pop ebp
- ret 4
- $LN11@erase:
- ; 517 : : this->_Bx._Buf);
- mov edx, ecx
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [edx+eax], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1313 : return (*this);
- mov eax, ecx
- ; 1314 : }
- pop ebp
- ret 4
- $LN18@erase:
- ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@I@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::erase
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z
- _TEXT SEGMENT
- __Off$dead$ = 8 ; size = 4
- __Count$ = 12 ; size = 4
- ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::erase, COMDAT
- ; _this$ = ecx
- ; 1317 : { // erase elements [_Off, _Off + _Count)
- push ebp
- mov ebp, esp
- ; 1318 : if (this->_Mysize < _Off)
- ; 1319 : _Xran(); // _Off off end
- ; 1320 : if (this->_Mysize - _Off <= _Count)
- mov eax, DWORD PTR __Count$[ebp]
- push esi
- mov esi, ecx
- push edi
- mov edi, DWORD PTR [esi+16]
- cmp edi, eax
- ja SHORT $LN3@erase
- ; 517 : : this->_Bx._Buf);
- cmp DWORD PTR [esi+20], 16 ; 00000010H
- ; 1331 :
- ; 1332 : iterator erase(const_iterator _Where)
- ; 1333 : { // erase element at _Where
- ; 1334 : size_type _Count = _Pdif(_Where, begin());
- ; 1335 : erase(_Count, 1);
- ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1337 : }
- ; 1338 :
- ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
- ; 1340 : { // erase substring [_First, _Last)
- ; 1341 : _DEBUG_RANGE(_First, _Last);
- ; 1342 : size_type _Count = _Pdif(_First, begin());
- ; 1343 : erase(_Count, _Pdif(_Last, _First));
- ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1345 : }
- ; 1346 :
- ; 1347 : void clear() _NOEXCEPT
- ; 1348 : { // erase all
- ; 1349 : _Eos(0);
- ; 1350 : }
- ; 1351 :
- ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
- ; 1353 : { // replace [_Off, _Off + _N0) with _Right
- ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
- ; 1355 : }
- ; 1356 :
- ; 1357 : _Myt& replace(size_type _Off,
- ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
- ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
- ; 1361 : _Xran(); // _Off or _Roff off end
- ; 1362 : if (this->_Mysize - _Off < _N0)
- ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1364 : size_type _Num = _Right.size() - _Roff;
- ; 1365 : if (_Num < _Count)
- ; 1366 : _Count = _Num; // trim _Count to size
- ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1368 : _Xlen(); // result too long
- ; 1369 :
- ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
- ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
- ; 1372 : if (this->_Mysize < _Newsize)
- ; 1373 : _Grow(_Newsize);
- ; 1374 :
- ; 1375 : if (this != &_Right)
- ; 1376 : { // no overlap, just move down and copy in new stuff
- ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
- ; 1379 : _Traits::copy(this->_Myptr() + _Off,
- ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
- ; 1381 : }
- ; 1382 : else if (_Count <= _N0)
- ; 1383 : { // hole doesn't get larger, just copy in substring
- ; 1384 : _Traits::move(this->_Myptr() + _Off,
- ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1388 : }
- ; 1389 : else if (_Roff <= _Off)
- ; 1390 : { // hole gets larger, substring begins before hole
- ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1393 : _Traits::move(this->_Myptr() + _Off,
- ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1395 : }
- ; 1396 : else if (_Off + _N0 <= _Roff)
- ; 1397 : { // hole gets larger, substring begins after hole
- ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1400 : _Traits::move(this->_Myptr() + _Off,
- ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
- ; 1402 : _Count); // fill hole
- ; 1403 : }
- ; 1404 : else
- ; 1405 : { // hole gets larger, substring begins in hole
- ; 1406 : _Traits::move(this->_Myptr() + _Off,
- ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
- ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
- ; 1411 : this->_Myptr() + _Roff + _Count,
- ; 1412 : _Count - _N0); // fill rest of new hole
- ; 1413 : }
- ; 1414 :
- ; 1415 : _Eos(_Newsize);
- ; 1416 : return (*this);
- ; 1417 : }
- ; 1418 :
- ; 1419 : _Myt& replace(size_type _Off,
- ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
- ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1423 : if (_Count != 0)
- ; 1424 : _DEBUG_POINTER(_Ptr);
- ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1426 :
- ; 1427 : if (_Inside(_Ptr))
- ; 1428 : return (replace(_Off, _N0, *this,
- ; 1429 : _Ptr - this->_Myptr(),
- ; 1430 : _Count)); // substring, replace carefully
- ; 1431 : if (this->_Mysize < _Off)
- ; 1432 : _Xran(); // _Off off end
- ; 1433 : if (this->_Mysize - _Off < _N0)
- ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1436 : _Xlen(); // result too long
- ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1438 :
- ; 1439 : if (_Count < _N0)
- ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1441 : this->_Myptr() + _Off + _N0,
- ; 1442 : _Nm); // smaller hole, move tail up
- ; 1443 : size_type _Num;
- ; 1444 : if ((0 < _Count || 0 < _N0)
- ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1446 : { // make room and rearrange
- ; 1447 : if (_N0 < _Count)
- ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
- ; 1451 : _Eos(_Num);
- ; 1452 : }
- ; 1453 : return (*this);
- ; 1454 : }
- ; 1455 :
- ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
- ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 1458 : _DEBUG_POINTER(_Ptr);
- ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 1460 : }
- ; 1461 :
- ; 1462 : _Myt& replace(size_type _Off,
- ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
- ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
- ; 1465 : if (this->_Mysize < _Off)
- ; 1466 : _Xran(); // _Off off end
- ; 1467 : if (this->_Mysize - _Off < _N0)
- ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1470 : _Xlen(); // result too long
- ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1472 :
- ; 1473 : if (_Count < _N0)
- ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1475 : this->_Myptr() + _Off + _N0,
- ; 1476 : _Nm); // smaller hole, move tail up
- ; 1477 : size_type _Num;
- ; 1478 : if ((0 < _Count || 0 < _N0)
- ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1480 : { // make room and rearrange
- ; 1481 : if (_N0 < _Count)
- ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
- ; 1485 : _Eos(_Num);
- ; 1486 : }
- ; 1487 : return (*this);
- ; 1488 : }
- ; 1489 :
- ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1491 : const _Myt& _Right)
- ; 1492 : { // replace [_First, _Last) with _Right
- ; 1493 : return (replace(
- ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
- ; 1495 : }
- ; 1496 :
- ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1498 : const _Elem *_Ptr, size_type _Count)
- ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
- ; 1500 : return (replace(
- ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
- ; 1502 : }
- ; 1503 :
- ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1505 : const _Elem *_Ptr)
- ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
- ; 1507 : return (replace(
- ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
- ; 1509 : }
- ; 1510 :
- ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1512 : size_type _Count, _Elem _Ch)
- ; 1513 : { // replace [_First, _Last) with _Count * _Ch
- ; 1514 : return (replace(
- ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
- ; 1516 : }
- ; 1517 :
- ; 1518 : template<class _Iter>
- ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1520 : _Myt&>::type
- ; 1521 : replace(const_iterator _First, const_iterator _Last,
- ; 1522 : _Iter _First2, _Iter _Last2)
- ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
- ; 1524 : _Myt _Right(_First2, _Last2);
- ; 1525 : replace(_First, _Last, _Right);
- ; 1526 : return (*this);
- ; 1527 : }
- ; 1528 :
- ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1530 : const_pointer _First2, const_pointer _Last2)
- ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1532 : if (_First2 == _Last2)
- ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1534 : else
- ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1536 : &*_First2, _Last2 - _First2);
- ; 1537 : return (*this);
- ; 1538 : }
- ; 1539 :
- ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1541 : pointer _First2, pointer _Last2)
- ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1543 : if (_First2 == _Last2)
- ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1545 : else
- ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1547 : &*_First2, _Last2 - _First2);
- ; 1548 : return (*this);
- ; 1549 : }
- ; 1550 :
- ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1552 : const_iterator _First2, const_iterator _Last2)
- ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1554 : if (_First2 == _Last2)
- ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1556 : else
- ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1558 : &*_First2, _Last2 - _First2);
- ; 1559 : return (*this);
- ; 1560 : }
- ; 1561 :
- ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1563 : iterator _First2, iterator _Last2)
- ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1565 : if (_First2 == _Last2)
- ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1567 : else
- ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1569 : &*_First2, _Last2 - _First2);
- ; 1570 : return (*this);
- ; 1571 : }
- ; 1572 :
- ; 1573 : iterator begin() _NOEXCEPT
- ; 1574 : { // return iterator for beginning of mutable sequence
- ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
- ; 1576 : }
- ; 1577 :
- ; 1578 : const_iterator begin() const _NOEXCEPT
- ; 1579 : { // return iterator for beginning of nonmutable sequence
- ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
- ; 1581 : }
- ; 1582 :
- ; 1583 : iterator end() _NOEXCEPT
- ; 1584 : { // return iterator for end of mutable sequence
- ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1586 : }
- ; 1587 :
- ; 1588 : const_iterator end() const _NOEXCEPT
- ; 1589 : { // return iterator for end of nonmutable sequence
- ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1591 : }
- ; 1592 :
- ; 1593 : reverse_iterator rbegin() _NOEXCEPT
- ; 1594 : { // return iterator for beginning of reversed mutable sequence
- ; 1595 : return (reverse_iterator(end()));
- ; 1596 : }
- ; 1597 :
- ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
- ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1600 : return (const_reverse_iterator(end()));
- ; 1601 : }
- ; 1602 :
- ; 1603 : reverse_iterator rend() _NOEXCEPT
- ; 1604 : { // return iterator for end of reversed mutable sequence
- ; 1605 : return (reverse_iterator(begin()));
- ; 1606 : }
- ; 1607 :
- ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
- ; 1609 : { // return iterator for end of reversed nonmutable sequence
- ; 1610 : return (const_reverse_iterator(begin()));
- ; 1611 : }
- ; 1612 :
- ; 1613 : #if _HAS_CPP0X
- ; 1614 : const_iterator cbegin() const _NOEXCEPT
- ; 1615 : { // return iterator for beginning of nonmutable sequence
- ; 1616 : return (((const _Myt *)this)->begin());
- ; 1617 : }
- ; 1618 :
- ; 1619 : const_iterator cend() const _NOEXCEPT
- ; 1620 : { // return iterator for end of nonmutable sequence
- ; 1621 : return (((const _Myt *)this)->end());
- ; 1622 : }
- ; 1623 :
- ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
- ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1626 : return (((const _Myt *)this)->rbegin());
- ; 1627 : }
- ; 1628 :
- ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
- ; 1630 : { // return iterator for end of reversed nonmutable sequence
- ; 1631 : return (((const _Myt *)this)->rend());
- ; 1632 : }
- ; 1633 :
- ; 1634 : void shrink_to_fit()
- ; 1635 : { // reduce capacity
- ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
- ; 1637 : { // worth shrinking, do it
- ; 1638 : _Myt _Tmp(*this);
- ; 1639 : swap(_Tmp);
- ; 1640 : }
- ; 1641 : }
- ; 1642 : #endif /* _HAS_CPP0X */
- ; 1643 :
- ; 1644 : reference at(size_type _Off)
- ; 1645 : { // subscript mutable sequence with checking
- ; 1646 : if (this->_Mysize <= _Off)
- ; 1647 : _Xran(); // _Off off end
- ; 1648 : return (this->_Myptr()[_Off]);
- ; 1649 : }
- ; 1650 :
- ; 1651 : const_reference at(size_type _Off) const
- ; 1652 : { // subscript nonmutable sequence with checking
- ; 1653 : if (this->_Mysize <= _Off)
- ; 1654 : _Xran(); // _Off off end
- ; 1655 : return (this->_Myptr()[_Off]);
- ; 1656 : }
- ; 1657 :
- ; 1658 : reference operator[](size_type _Off)
- ; 1659 : { // subscript mutable sequence
- ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1661 : if (this->_Mysize < _Off) // sic
- ; 1662 : _DEBUG_ERROR("string subscript out of range");
- ; 1663 :
- ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1667 :
- ; 1668 : return (this->_Myptr()[_Off]);
- ; 1669 : }
- ; 1670 :
- ; 1671 : const_reference operator[](size_type _Off) const
- ; 1672 : { // subscript nonmutable sequence
- ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1674 : if (this->_Mysize < _Off) // sic
- ; 1675 : _DEBUG_ERROR("string subscript out of range");
- ; 1676 :
- ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1680 :
- ; 1681 : return (this->_Myptr()[_Off]);
- ; 1682 : }
- ; 1683 :
- ; 1684 : void push_back(_Elem _Ch)
- ; 1685 : { // insert element at end
- ; 1686 : insert(end(), _Ch);
- ; 1687 : }
- ; 1688 :
- ; 1689 : #if _HAS_CPP0X
- ; 1690 : void pop_back()
- ; 1691 : { // erase element at end
- ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
- ; 1693 : }
- ; 1694 :
- ; 1695 : reference front()
- ; 1696 : { // return first element of mutable sequence
- ; 1697 : return (*begin());
- ; 1698 : }
- ; 1699 :
- ; 1700 : const_reference front() const
- ; 1701 : { // return first element of nonmutable sequence
- ; 1702 : return (*begin());
- ; 1703 : }
- ; 1704 :
- ; 1705 : reference back()
- ; 1706 : { // return last element of mutable sequence
- ; 1707 : return (*(end() - 1));
- ; 1708 : }
- ; 1709 :
- ; 1710 : const_reference back() const
- ; 1711 : { // return last element of nonmutable sequence
- ; 1712 : return (*(end() - 1));
- ; 1713 : }
- ; 1714 : #endif /* _HAS_CPP0X */
- ; 1715 :
- ; 1716 : const _Elem *c_str() const _NOEXCEPT
- ; 1717 : { // return pointer to null-terminated nonmutable array
- ; 1718 : return (this->_Myptr());
- ; 1719 : }
- ; 1720 :
- ; 1721 : const _Elem *data() const _NOEXCEPT
- ; 1722 : { // return pointer to nonmutable array
- ; 1723 : return (c_str());
- ; 1724 : }
- ; 1725 :
- ; 1726 : size_type length() const _NOEXCEPT
- ; 1727 : { // return length of sequence
- ; 1728 : return (this->_Mysize);
- ; 1729 : }
- ; 1730 :
- ; 1731 : size_type size() const _NOEXCEPT
- ; 1732 : { // return length of sequence
- ; 1733 : return (this->_Mysize);
- ; 1734 : }
- ; 1735 :
- ; 1736 : size_type max_size() const _NOEXCEPT
- ; 1737 : { // return maximum possible length of sequence
- ; 1738 : size_type _Num = this->_Getal().max_size();
- ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
- ; 1740 : }
- ; 1741 :
- ; 1742 : void resize(size_type _Newsize)
- ; 1743 : { // determine new length, padding with null elements as needed
- ; 1744 : resize(_Newsize, _Elem());
- ; 1745 : }
- ; 1746 :
- ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
- ; 1748 : { // determine new length, padding with _Ch elements as needed
- ; 1749 : if (_Newsize <= this->_Mysize)
- ; 1750 : _Eos(_Newsize);
- ; 1751 : else
- ; 1752 : append(_Newsize - this->_Mysize, _Ch);
- ; 1753 : }
- ; 1754 :
- ; 1755 : size_type capacity() const _NOEXCEPT
- ; 1756 : { // return current length of allocated storage
- ; 1757 : return (this->_Myres);
- ; 1758 : }
- ; 1759 :
- ; 1760 : void reserve(size_type _Newcap = 0)
- ; 1761 : { // determine new minimum length of allocated storage
- ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
- ; 1763 : { // change reservation
- ; 1764 : size_type _Size = this->_Mysize;
- ; 1765 : if (_Grow(_Newcap, true))
- ; 1766 : _Eos(_Size);
- ; 1767 : }
- ; 1768 : }
- ; 1769 :
- ; 1770 : bool empty() const _NOEXCEPT
- ; 1771 : { // test if sequence is empty
- ; 1772 : return (this->_Mysize == 0);
- ; 1773 : }
- ; 1774 :
- ; 1775 : _SCL_INSECURE_DEPRECATE
- ; 1776 :
- ; 1777 : size_type copy(_Elem *_Ptr,
- ; 1778 : size_type _Count, size_type _Off = 0) const
- ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
- ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1781 : if (_Count != 0)
- ; 1782 : _DEBUG_POINTER(_Ptr);
- ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1784 :
- ; 1785 : if (this->_Mysize < _Off)
- ; 1786 : _Xran(); // _Off off end
- ; 1787 : if (this->_Mysize - _Off < _Count)
- ; 1788 : _Count = this->_Mysize - _Off;
- ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
- ; 1790 : return (_Count);
- ; 1791 : }
- ; 1792 :
- ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
- ; 1794 : size_type _Count, size_type _Off = 0) const
- ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
- ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1797 : if (_Count != 0)
- ; 1798 : _DEBUG_POINTER(_Dest);
- ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1800 :
- ; 1801 : if (this->_Mysize < _Off)
- ; 1802 : _Xran(); // _Off off end
- ; 1803 : if (this->_Mysize - _Off < _Count)
- ; 1804 : _Count = this->_Mysize - _Off;
- ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
- ; 1806 : return (_Count);
- ; 1807 : }
- ; 1808 :
- ; 1809 : void _Swap_bx(_Myt& _Right)
- ; 1810 : { // exchange _Bx with _Right._Bx
- ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
- ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
- ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
- ; 1814 : else
- ; 1815 : { // swap large with small
- ; 1816 : pointer _Ptr = this->_Bx._Ptr;
- ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 1818 : _Traits::copy(this->_Bx._Buf,
- ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
- ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
- ; 1821 : }
- ; 1822 : else
- ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
- ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
- ; 1825 : else
- ; 1826 : { // swap small with large
- ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
- ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
- ; 1829 : _Traits::copy(_Right._Bx._Buf,
- ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
- ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 1832 : }
- ; 1833 : }
- ; 1834 :
- ; 1835 : void swap(_Myt& _Right)
- ; 1836 : { // exchange contents with _Right
- ; 1837 : if (this == &_Right)
- ; 1838 : ; // same object, do nothing
- ; 1839 : else if (this->_Getal() == _Right._Getal())
- ; 1840 : { // same allocator, swap control information
- ; 1841 : this->_Swap_all(_Right);
- ; 1842 : _Swap_bx(_Right);
- ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1844 : _STD swap(this->_Myres, _Right._Myres);
- ; 1845 : }
- ; 1846 :
- ; 1847 : #if _HAS_CPP0X
- ; 1848 : else if (_Alty::propagate_on_container_swap::value)
- ; 1849 : { // swap allocators and control information
- ; 1850 : this->_Swap_alloc(_Right);
- ; 1851 : _Swap_bx(_Right);
- ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
- ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1854 : _STD swap(this->_Myres, _Right._Myres);
- ; 1855 : }
- ; 1856 : #endif /* _HAS_CPP0X */
- ; 1857 :
- ; 1858 : else
- ; 1859 : { // different allocator, do multiple assigns
- ; 1860 : _Myt _Tmp = *this;
- ; 1861 :
- ; 1862 : *this = _Right;
- ; 1863 : _Right = _Tmp;
- ; 1864 : }
- ; 1865 : }
- ; 1866 :
- ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
- ; 1868 : { // look for _Right beginning at or after _Off
- ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
- ; 1870 : }
- ; 1871 :
- ; 1872 : size_type find(const _Elem *_Ptr,
- ; 1873 : size_type _Off, size_type _Count) const
- ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
- ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1876 : if (_Count != 0)
- ; 1877 : _DEBUG_POINTER(_Ptr);
- ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1879 :
- ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
- ; 1881 : return (_Off); // null string always matches (if inside string)
- ; 1882 :
- ; 1883 : size_type _Nm;
- ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
- ; 1885 : { // room for match, look for it
- ; 1886 : const _Elem *_Uptr, *_Vptr;
- ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
- ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
- ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
- ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1891 : return (_Uptr - this->_Myptr()); // found a match
- ; 1892 : }
- ; 1893 :
- ; 1894 : return (npos); // no match
- ; 1895 : }
- ; 1896 :
- ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
- ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
- ; 1899 : _DEBUG_POINTER(_Ptr);
- ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1901 : }
- ; 1902 :
- ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
- ; 1904 : { // look for _Ch at or after _Off
- ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1906 : }
- ; 1907 :
- ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
- ; 1909 : { // look for _Right beginning before _Off
- ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
- ; 1911 : }
- ; 1912 :
- ; 1913 : size_type rfind(const _Elem *_Ptr,
- ; 1914 : size_type _Off, size_type _Count) const
- ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
- ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1917 : if (_Count != 0)
- ; 1918 : _DEBUG_POINTER(_Ptr);
- ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1920 :
- ; 1921 : if (_Count == 0)
- ; 1922 : return (_Off < this->_Mysize ? _Off
- ; 1923 : : this->_Mysize); // null always matches
- ; 1924 : if (_Count <= this->_Mysize)
- ; 1925 : { // room for match, look for it
- ; 1926 : const _Elem *_Uptr = this->_Myptr() +
- ; 1927 : (_Off < this->_Mysize - _Count ? _Off
- ; 1928 : : this->_Mysize - _Count);
- ; 1929 : for (; ; --_Uptr)
- ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
- ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1932 : return (_Uptr - this->_Myptr()); // found a match
- ; 1933 : else if (_Uptr == this->_Myptr())
- ; 1934 : break; // at beginning, no more chance for match
- ; 1935 : }
- ; 1936 :
- ; 1937 : return (npos); // no match
- ; 1938 : }
- ; 1939 :
- ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
- ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
- ; 1942 : _DEBUG_POINTER(_Ptr);
- ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1944 : }
- ; 1945 :
- ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
- ; 1947 : { // look for _Ch before _Off
- ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 1949 : }
- ; 1950 :
- ; 1951 : size_type find_first_of(const _Myt& _Right,
- ; 1952 : size_type _Off = 0) const _NOEXCEPT
- ; 1953 : { // look for one of _Right at or after _Off
- ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1955 : }
- ; 1956 :
- ; 1957 : size_type find_first_of(const _Elem *_Ptr,
- ; 1958 : size_type _Off, size_type _Count) const
- ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
- ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1961 : if (_Count != 0)
- ; 1962 : _DEBUG_POINTER(_Ptr);
- ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1964 :
- ; 1965 : if (0 < _Count && _Off < this->_Mysize)
- ; 1966 : { // room for match, look for it
- ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 1969 : _Uptr < _Vptr; ++_Uptr)
- ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 1971 : return (_Uptr - this->_Myptr()); // found a match
- ; 1972 : }
- ; 1973 :
- ; 1974 : return (npos); // no match
- ; 1975 : }
- ; 1976 :
- ; 1977 : size_type find_first_of(const _Elem *_Ptr,
- ; 1978 : size_type _Off = 0) const
- ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 1980 : _DEBUG_POINTER(_Ptr);
- ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1982 : }
- ; 1983 :
- ; 1984 : size_type find_first_of(_Elem _Ch,
- ; 1985 : size_type _Off = 0) const
- ; 1986 : { // look for _Ch at or after _Off
- ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1988 : }
- ; 1989 :
- ; 1990 : size_type find_last_of(const _Myt& _Right,
- ; 1991 : size_type _Off = npos) const _NOEXCEPT
- ; 1992 : { // look for one of _Right before _Off
- ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1994 : }
- ; 1995 :
- ; 1996 : size_type find_last_of(const _Elem *_Ptr,
- ; 1997 : size_type _Off, size_type _Count) const
- ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
- ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2000 : if (_Count != 0)
- ; 2001 : _DEBUG_POINTER(_Ptr);
- ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2003 :
- ; 2004 : if (0 < _Count && 0 < this->_Mysize)
- ; 2005 : { // worth searching, do it
- ; 2006 : const _Elem *_Uptr = this->_Myptr()
- ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2008 : for (; ; --_Uptr)
- ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 2010 : return (_Uptr - this->_Myptr()); // found a match
- ; 2011 : else if (_Uptr == this->_Myptr())
- ; 2012 : break; // at beginning, no more chance for match
- ; 2013 : }
- ; 2014 :
- ; 2015 : return (npos); // no match
- ; 2016 : }
- ; 2017 :
- ; 2018 : size_type find_last_of(const _Elem *_Ptr,
- ; 2019 : size_type _Off = npos) const
- ; 2020 : { // look for one of [_Ptr, <null>) before _Off
- ; 2021 : _DEBUG_POINTER(_Ptr);
- ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2023 : }
- ; 2024 :
- ; 2025 : size_type find_last_of(_Elem _Ch,
- ; 2026 : size_type _Off = npos) const
- ; 2027 : { // look for _Ch before _Off
- ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 2029 : }
- ; 2030 :
- ; 2031 : size_type find_first_not_of(const _Myt& _Right,
- ; 2032 : size_type _Off = 0) const _NOEXCEPT
- ; 2033 : { // look for none of _Right at or after _Off
- ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
- ; 2035 : _Right.size()));
- ; 2036 : }
- ; 2037 :
- ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2039 : size_type _Off, size_type _Count) const
- ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
- ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2042 : if (_Count != 0)
- ; 2043 : _DEBUG_POINTER(_Ptr);
- ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2045 :
- ; 2046 : if (_Off < this->_Mysize)
- ; 2047 : { // room for match, look for it
- ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 2050 : _Uptr < _Vptr; ++_Uptr)
- ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2052 : return (_Uptr - this->_Myptr());
- ; 2053 : }
- ; 2054 : return (npos);
- ; 2055 : }
- ; 2056 :
- ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2058 : size_type _Off = 0) const
- ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 2060 : _DEBUG_POINTER(_Ptr);
- ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2062 : }
- ; 2063 :
- ; 2064 : size_type find_first_not_of(_Elem _Ch,
- ; 2065 : size_type _Off = 0) const
- ; 2066 : { // look for non _Ch at or after _Off
- ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2068 : }
- ; 2069 :
- ; 2070 : size_type find_last_not_of(const _Myt& _Right,
- ; 2071 : size_type _Off = npos) const _NOEXCEPT
- ; 2072 : { // look for none of _Right before _Off
- ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
- ; 2074 : }
- ; 2075 :
- ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2077 : size_type _Off, size_type _Count) const
- ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
- ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2080 : if (_Count != 0)
- ; 2081 : _DEBUG_POINTER(_Ptr);
- ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2083 :
- ; 2084 : if (0 < this->_Mysize)
- ; 2085 : { // worth searching, do it
- ; 2086 : const _Elem *_Uptr = this->_Myptr()
- ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2088 : for (; ; --_Uptr)
- ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2090 : return (_Uptr - this->_Myptr());
- ; 2091 : else if (_Uptr == this->_Myptr())
- ; 2092 : break;
- ; 2093 : }
- ; 2094 : return (npos);
- ; 2095 : }
- ; 2096 :
- ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2098 : size_type _Off = npos) const
- ; 2099 : { // look for none of [_Ptr, <null>) before _Off
- ; 2100 : _DEBUG_POINTER(_Ptr);
- ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2102 : }
- ; 2103 :
- ; 2104 : size_type find_last_not_of(_Elem _Ch,
- ; 2105 : size_type _Off = npos) const
- ; 2106 : { // look for non _Ch before _Off
- ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2108 : }
- ; 2109 :
- ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
- ; 2111 : { // return [_Off, _Off + _Count) as new string
- ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
- ; 2113 : }
- ; 2114 :
- ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
- ; 2116 : { // compare [0, _Mysize) with _Right
- ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
- ; 2118 : }
- ; 2119 :
- ; 2120 : int compare(size_type _Off, size_type _N0,
- ; 2121 : const _Myt& _Right) const
- ; 2122 : { // compare [_Off, _Off + _N0) with _Right
- ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
- ; 2124 : }
- ; 2125 :
- ; 2126 : int compare(size_type _Off,
- ; 2127 : size_type _N0, const _Myt& _Right,
- ; 2128 : size_type _Roff, size_type _Count) const
- ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 2130 : if (_Right.size() < _Roff)
- ; 2131 : _Xran(); // _Off off end
- ; 2132 : if (_Right._Mysize - _Roff < _Count)
- ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
- ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
- ; 2135 : }
- ; 2136 :
- ; 2137 : int compare(const _Elem *_Ptr) const
- ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
- ; 2139 : _DEBUG_POINTER(_Ptr);
- ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
- ; 2141 : }
- ; 2142 :
- ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
- ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 2145 : _DEBUG_POINTER(_Ptr);
- ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 2147 : }
- ; 2148 :
- ; 2149 : int compare(size_type _Off,
- ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
- ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2153 : if (_Count != 0)
- ; 2154 : _DEBUG_POINTER(_Ptr);
- ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2156 :
- ; 2157 : if (this->_Mysize < _Off)
- ; 2158 : _Xran(); // _Off off end
- ; 2159 : if (this->_Mysize - _Off < _N0)
- ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 2161 :
- ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
- ; 2163 : _N0 < _Count ? _N0 : _Count);
- ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
- ; 2165 : : _N0 == _Count ? 0 : +1);
- ; 2166 : }
- ; 2167 :
- ; 2168 : allocator_type get_allocator() const _NOEXCEPT
- ; 2169 : { // return allocator object for values
- ; 2170 : return (this->_Getal());
- ; 2171 : }
- ; 2172 :
- ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
- ; 2174 : { // assign _Count copies of _Ch beginning at _Off
- ; 2175 : if (_Count == 1)
- ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
- ; 2177 : else
- ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
- ; 2179 : }
- ; 2180 :
- ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
- ; 2182 : { // copy _Oldlen elements to newly allocated buffer
- ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
- ; 2184 : if (max_size() < _Newres)
- ; 2185 : _Newres = _Newsize; // undo roundup if too big
- ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
- ; 2187 : ;
- ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
- ; 2189 : _Newres = this->_Myres
- ; 2190 : + this->_Myres / 2; // grow exponentially if possible
- ; 2191 : else
- ; 2192 : _Newres = max_size(); // settle for max_size()
- ; 2193 :
- ; 2194 : _Elem *_Ptr;
- ; 2195 : _TRY_BEGIN
- ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2197 : _CATCH_ALL
- ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
- ; 2199 : _TRY_BEGIN
- ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2201 : _CATCH_ALL
- ; 2202 : _Tidy(true); // failed again, discard storage and reraise
- ; 2203 : _RERAISE;
- ; 2204 : _CATCH_END
- ; 2205 : _CATCH_END
- ; 2206 :
- ; 2207 : if (0 < _Oldlen)
- ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
- ; 2209 : _Oldlen); // copy existing elements
- ; 2210 : _Tidy(true);
- ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 2212 : this->_Myres = _Newres;
- ; 2213 : _Eos(_Oldlen);
- ; 2214 : }
- ; 2215 :
- ; 2216 : void _Eos(size_type _Newsize)
- ; 2217 : { // set new length and null terminator
- ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
- mov DWORD PTR [esi+16], 0
- ; 517 : : this->_Bx._Buf);
- jb SHORT $LN14@erase
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov eax, DWORD PTR [esi]
- pop edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1329 : return (*this);
- mov eax, esi
- pop esi
- ; 1330 : }
- pop ebp
- ret 8
- $LN14@erase:
- ; 517 : : this->_Bx._Buf);
- mov eax, esi
- pop edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax], 0
- pop esi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1330 : }
- pop ebp
- ret 8
- $LN3@erase:
- ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
- ; 1322 : else if (0 < _Count)
- test eax, eax
- je SHORT $LN40@erase
- ; 517 : : this->_Bx._Buf);
- cmp DWORD PTR [esi+20], 16 ; 00000010H
- jb SHORT $LN23@erase
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov ecx, DWORD PTR [esi]
- $LN23@erase:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1325 : size_type _Newsize = this->_Mysize - _Count;
- sub edi, eax
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 553 : : (_Elem *)_CSTD memmove(_First1, _First2, _Count));
- je SHORT $LN29@erase
- push edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
- add eax, ecx
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 553 : : (_Elem *)_CSTD memmove(_First1, _First2, _Count));
- push eax
- push ecx
- call DWORD PTR __imp__memmove
- add esp, 12 ; 0000000cH
- $LN29@erase:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 517 : : this->_Bx._Buf);
- cmp DWORD PTR [esi+20], 16 ; 00000010H
- ; 1331 :
- ; 1332 : iterator erase(const_iterator _Where)
- ; 1333 : { // erase element at _Where
- ; 1334 : size_type _Count = _Pdif(_Where, begin());
- ; 1335 : erase(_Count, 1);
- ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1337 : }
- ; 1338 :
- ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
- ; 1340 : { // erase substring [_First, _Last)
- ; 1341 : _DEBUG_RANGE(_First, _Last);
- ; 1342 : size_type _Count = _Pdif(_First, begin());
- ; 1343 : erase(_Count, _Pdif(_Last, _First));
- ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1345 : }
- ; 1346 :
- ; 1347 : void clear() _NOEXCEPT
- ; 1348 : { // erase all
- ; 1349 : _Eos(0);
- ; 1350 : }
- ; 1351 :
- ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
- ; 1353 : { // replace [_Off, _Off + _N0) with _Right
- ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
- ; 1355 : }
- ; 1356 :
- ; 1357 : _Myt& replace(size_type _Off,
- ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
- ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
- ; 1361 : _Xran(); // _Off or _Roff off end
- ; 1362 : if (this->_Mysize - _Off < _N0)
- ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1364 : size_type _Num = _Right.size() - _Roff;
- ; 1365 : if (_Num < _Count)
- ; 1366 : _Count = _Num; // trim _Count to size
- ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1368 : _Xlen(); // result too long
- ; 1369 :
- ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
- ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
- ; 1372 : if (this->_Mysize < _Newsize)
- ; 1373 : _Grow(_Newsize);
- ; 1374 :
- ; 1375 : if (this != &_Right)
- ; 1376 : { // no overlap, just move down and copy in new stuff
- ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
- ; 1379 : _Traits::copy(this->_Myptr() + _Off,
- ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
- ; 1381 : }
- ; 1382 : else if (_Count <= _N0)
- ; 1383 : { // hole doesn't get larger, just copy in substring
- ; 1384 : _Traits::move(this->_Myptr() + _Off,
- ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1388 : }
- ; 1389 : else if (_Roff <= _Off)
- ; 1390 : { // hole gets larger, substring begins before hole
- ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1393 : _Traits::move(this->_Myptr() + _Off,
- ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1395 : }
- ; 1396 : else if (_Off + _N0 <= _Roff)
- ; 1397 : { // hole gets larger, substring begins after hole
- ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1400 : _Traits::move(this->_Myptr() + _Off,
- ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
- ; 1402 : _Count); // fill hole
- ; 1403 : }
- ; 1404 : else
- ; 1405 : { // hole gets larger, substring begins in hole
- ; 1406 : _Traits::move(this->_Myptr() + _Off,
- ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
- ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
- ; 1411 : this->_Myptr() + _Roff + _Count,
- ; 1412 : _Count - _N0); // fill rest of new hole
- ; 1413 : }
- ; 1414 :
- ; 1415 : _Eos(_Newsize);
- ; 1416 : return (*this);
- ; 1417 : }
- ; 1418 :
- ; 1419 : _Myt& replace(size_type _Off,
- ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
- ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1423 : if (_Count != 0)
- ; 1424 : _DEBUG_POINTER(_Ptr);
- ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1426 :
- ; 1427 : if (_Inside(_Ptr))
- ; 1428 : return (replace(_Off, _N0, *this,
- ; 1429 : _Ptr - this->_Myptr(),
- ; 1430 : _Count)); // substring, replace carefully
- ; 1431 : if (this->_Mysize < _Off)
- ; 1432 : _Xran(); // _Off off end
- ; 1433 : if (this->_Mysize - _Off < _N0)
- ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1436 : _Xlen(); // result too long
- ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1438 :
- ; 1439 : if (_Count < _N0)
- ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1441 : this->_Myptr() + _Off + _N0,
- ; 1442 : _Nm); // smaller hole, move tail up
- ; 1443 : size_type _Num;
- ; 1444 : if ((0 < _Count || 0 < _N0)
- ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1446 : { // make room and rearrange
- ; 1447 : if (_N0 < _Count)
- ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
- ; 1451 : _Eos(_Num);
- ; 1452 : }
- ; 1453 : return (*this);
- ; 1454 : }
- ; 1455 :
- ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
- ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 1458 : _DEBUG_POINTER(_Ptr);
- ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 1460 : }
- ; 1461 :
- ; 1462 : _Myt& replace(size_type _Off,
- ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
- ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
- ; 1465 : if (this->_Mysize < _Off)
- ; 1466 : _Xran(); // _Off off end
- ; 1467 : if (this->_Mysize - _Off < _N0)
- ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1470 : _Xlen(); // result too long
- ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1472 :
- ; 1473 : if (_Count < _N0)
- ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1475 : this->_Myptr() + _Off + _N0,
- ; 1476 : _Nm); // smaller hole, move tail up
- ; 1477 : size_type _Num;
- ; 1478 : if ((0 < _Count || 0 < _N0)
- ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1480 : { // make room and rearrange
- ; 1481 : if (_N0 < _Count)
- ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
- ; 1485 : _Eos(_Num);
- ; 1486 : }
- ; 1487 : return (*this);
- ; 1488 : }
- ; 1489 :
- ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1491 : const _Myt& _Right)
- ; 1492 : { // replace [_First, _Last) with _Right
- ; 1493 : return (replace(
- ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
- ; 1495 : }
- ; 1496 :
- ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1498 : const _Elem *_Ptr, size_type _Count)
- ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
- ; 1500 : return (replace(
- ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
- ; 1502 : }
- ; 1503 :
- ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1505 : const _Elem *_Ptr)
- ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
- ; 1507 : return (replace(
- ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
- ; 1509 : }
- ; 1510 :
- ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1512 : size_type _Count, _Elem _Ch)
- ; 1513 : { // replace [_First, _Last) with _Count * _Ch
- ; 1514 : return (replace(
- ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
- ; 1516 : }
- ; 1517 :
- ; 1518 : template<class _Iter>
- ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1520 : _Myt&>::type
- ; 1521 : replace(const_iterator _First, const_iterator _Last,
- ; 1522 : _Iter _First2, _Iter _Last2)
- ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
- ; 1524 : _Myt _Right(_First2, _Last2);
- ; 1525 : replace(_First, _Last, _Right);
- ; 1526 : return (*this);
- ; 1527 : }
- ; 1528 :
- ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1530 : const_pointer _First2, const_pointer _Last2)
- ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1532 : if (_First2 == _Last2)
- ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1534 : else
- ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1536 : &*_First2, _Last2 - _First2);
- ; 1537 : return (*this);
- ; 1538 : }
- ; 1539 :
- ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1541 : pointer _First2, pointer _Last2)
- ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1543 : if (_First2 == _Last2)
- ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1545 : else
- ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1547 : &*_First2, _Last2 - _First2);
- ; 1548 : return (*this);
- ; 1549 : }
- ; 1550 :
- ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1552 : const_iterator _First2, const_iterator _Last2)
- ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1554 : if (_First2 == _Last2)
- ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1556 : else
- ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1558 : &*_First2, _Last2 - _First2);
- ; 1559 : return (*this);
- ; 1560 : }
- ; 1561 :
- ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1563 : iterator _First2, iterator _Last2)
- ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1565 : if (_First2 == _Last2)
- ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1567 : else
- ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1569 : &*_First2, _Last2 - _First2);
- ; 1570 : return (*this);
- ; 1571 : }
- ; 1572 :
- ; 1573 : iterator begin() _NOEXCEPT
- ; 1574 : { // return iterator for beginning of mutable sequence
- ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
- ; 1576 : }
- ; 1577 :
- ; 1578 : const_iterator begin() const _NOEXCEPT
- ; 1579 : { // return iterator for beginning of nonmutable sequence
- ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
- ; 1581 : }
- ; 1582 :
- ; 1583 : iterator end() _NOEXCEPT
- ; 1584 : { // return iterator for end of mutable sequence
- ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1586 : }
- ; 1587 :
- ; 1588 : const_iterator end() const _NOEXCEPT
- ; 1589 : { // return iterator for end of nonmutable sequence
- ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1591 : }
- ; 1592 :
- ; 1593 : reverse_iterator rbegin() _NOEXCEPT
- ; 1594 : { // return iterator for beginning of reversed mutable sequence
- ; 1595 : return (reverse_iterator(end()));
- ; 1596 : }
- ; 1597 :
- ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
- ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1600 : return (const_reverse_iterator(end()));
- ; 1601 : }
- ; 1602 :
- ; 1603 : reverse_iterator rend() _NOEXCEPT
- ; 1604 : { // return iterator for end of reversed mutable sequence
- ; 1605 : return (reverse_iterator(begin()));
- ; 1606 : }
- ; 1607 :
- ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
- ; 1609 : { // return iterator for end of reversed nonmutable sequence
- ; 1610 : return (const_reverse_iterator(begin()));
- ; 1611 : }
- ; 1612 :
- ; 1613 : #if _HAS_CPP0X
- ; 1614 : const_iterator cbegin() const _NOEXCEPT
- ; 1615 : { // return iterator for beginning of nonmutable sequence
- ; 1616 : return (((const _Myt *)this)->begin());
- ; 1617 : }
- ; 1618 :
- ; 1619 : const_iterator cend() const _NOEXCEPT
- ; 1620 : { // return iterator for end of nonmutable sequence
- ; 1621 : return (((const _Myt *)this)->end());
- ; 1622 : }
- ; 1623 :
- ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
- ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1626 : return (((const _Myt *)this)->rbegin());
- ; 1627 : }
- ; 1628 :
- ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
- ; 1630 : { // return iterator for end of reversed nonmutable sequence
- ; 1631 : return (((const _Myt *)this)->rend());
- ; 1632 : }
- ; 1633 :
- ; 1634 : void shrink_to_fit()
- ; 1635 : { // reduce capacity
- ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
- ; 1637 : { // worth shrinking, do it
- ; 1638 : _Myt _Tmp(*this);
- ; 1639 : swap(_Tmp);
- ; 1640 : }
- ; 1641 : }
- ; 1642 : #endif /* _HAS_CPP0X */
- ; 1643 :
- ; 1644 : reference at(size_type _Off)
- ; 1645 : { // subscript mutable sequence with checking
- ; 1646 : if (this->_Mysize <= _Off)
- ; 1647 : _Xran(); // _Off off end
- ; 1648 : return (this->_Myptr()[_Off]);
- ; 1649 : }
- ; 1650 :
- ; 1651 : const_reference at(size_type _Off) const
- ; 1652 : { // subscript nonmutable sequence with checking
- ; 1653 : if (this->_Mysize <= _Off)
- ; 1654 : _Xran(); // _Off off end
- ; 1655 : return (this->_Myptr()[_Off]);
- ; 1656 : }
- ; 1657 :
- ; 1658 : reference operator[](size_type _Off)
- ; 1659 : { // subscript mutable sequence
- ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1661 : if (this->_Mysize < _Off) // sic
- ; 1662 : _DEBUG_ERROR("string subscript out of range");
- ; 1663 :
- ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1667 :
- ; 1668 : return (this->_Myptr()[_Off]);
- ; 1669 : }
- ; 1670 :
- ; 1671 : const_reference operator[](size_type _Off) const
- ; 1672 : { // subscript nonmutable sequence
- ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1674 : if (this->_Mysize < _Off) // sic
- ; 1675 : _DEBUG_ERROR("string subscript out of range");
- ; 1676 :
- ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1680 :
- ; 1681 : return (this->_Myptr()[_Off]);
- ; 1682 : }
- ; 1683 :
- ; 1684 : void push_back(_Elem _Ch)
- ; 1685 : { // insert element at end
- ; 1686 : insert(end(), _Ch);
- ; 1687 : }
- ; 1688 :
- ; 1689 : #if _HAS_CPP0X
- ; 1690 : void pop_back()
- ; 1691 : { // erase element at end
- ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
- ; 1693 : }
- ; 1694 :
- ; 1695 : reference front()
- ; 1696 : { // return first element of mutable sequence
- ; 1697 : return (*begin());
- ; 1698 : }
- ; 1699 :
- ; 1700 : const_reference front() const
- ; 1701 : { // return first element of nonmutable sequence
- ; 1702 : return (*begin());
- ; 1703 : }
- ; 1704 :
- ; 1705 : reference back()
- ; 1706 : { // return last element of mutable sequence
- ; 1707 : return (*(end() - 1));
- ; 1708 : }
- ; 1709 :
- ; 1710 : const_reference back() const
- ; 1711 : { // return last element of nonmutable sequence
- ; 1712 : return (*(end() - 1));
- ; 1713 : }
- ; 1714 : #endif /* _HAS_CPP0X */
- ; 1715 :
- ; 1716 : const _Elem *c_str() const _NOEXCEPT
- ; 1717 : { // return pointer to null-terminated nonmutable array
- ; 1718 : return (this->_Myptr());
- ; 1719 : }
- ; 1720 :
- ; 1721 : const _Elem *data() const _NOEXCEPT
- ; 1722 : { // return pointer to nonmutable array
- ; 1723 : return (c_str());
- ; 1724 : }
- ; 1725 :
- ; 1726 : size_type length() const _NOEXCEPT
- ; 1727 : { // return length of sequence
- ; 1728 : return (this->_Mysize);
- ; 1729 : }
- ; 1730 :
- ; 1731 : size_type size() const _NOEXCEPT
- ; 1732 : { // return length of sequence
- ; 1733 : return (this->_Mysize);
- ; 1734 : }
- ; 1735 :
- ; 1736 : size_type max_size() const _NOEXCEPT
- ; 1737 : { // return maximum possible length of sequence
- ; 1738 : size_type _Num = this->_Getal().max_size();
- ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
- ; 1740 : }
- ; 1741 :
- ; 1742 : void resize(size_type _Newsize)
- ; 1743 : { // determine new length, padding with null elements as needed
- ; 1744 : resize(_Newsize, _Elem());
- ; 1745 : }
- ; 1746 :
- ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
- ; 1748 : { // determine new length, padding with _Ch elements as needed
- ; 1749 : if (_Newsize <= this->_Mysize)
- ; 1750 : _Eos(_Newsize);
- ; 1751 : else
- ; 1752 : append(_Newsize - this->_Mysize, _Ch);
- ; 1753 : }
- ; 1754 :
- ; 1755 : size_type capacity() const _NOEXCEPT
- ; 1756 : { // return current length of allocated storage
- ; 1757 : return (this->_Myres);
- ; 1758 : }
- ; 1759 :
- ; 1760 : void reserve(size_type _Newcap = 0)
- ; 1761 : { // determine new minimum length of allocated storage
- ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
- ; 1763 : { // change reservation
- ; 1764 : size_type _Size = this->_Mysize;
- ; 1765 : if (_Grow(_Newcap, true))
- ; 1766 : _Eos(_Size);
- ; 1767 : }
- ; 1768 : }
- ; 1769 :
- ; 1770 : bool empty() const _NOEXCEPT
- ; 1771 : { // test if sequence is empty
- ; 1772 : return (this->_Mysize == 0);
- ; 1773 : }
- ; 1774 :
- ; 1775 : _SCL_INSECURE_DEPRECATE
- ; 1776 :
- ; 1777 : size_type copy(_Elem *_Ptr,
- ; 1778 : size_type _Count, size_type _Off = 0) const
- ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
- ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1781 : if (_Count != 0)
- ; 1782 : _DEBUG_POINTER(_Ptr);
- ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1784 :
- ; 1785 : if (this->_Mysize < _Off)
- ; 1786 : _Xran(); // _Off off end
- ; 1787 : if (this->_Mysize - _Off < _Count)
- ; 1788 : _Count = this->_Mysize - _Off;
- ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
- ; 1790 : return (_Count);
- ; 1791 : }
- ; 1792 :
- ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
- ; 1794 : size_type _Count, size_type _Off = 0) const
- ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
- ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1797 : if (_Count != 0)
- ; 1798 : _DEBUG_POINTER(_Dest);
- ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1800 :
- ; 1801 : if (this->_Mysize < _Off)
- ; 1802 : _Xran(); // _Off off end
- ; 1803 : if (this->_Mysize - _Off < _Count)
- ; 1804 : _Count = this->_Mysize - _Off;
- ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
- ; 1806 : return (_Count);
- ; 1807 : }
- ; 1808 :
- ; 1809 : void _Swap_bx(_Myt& _Right)
- ; 1810 : { // exchange _Bx with _Right._Bx
- ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
- ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
- ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
- ; 1814 : else
- ; 1815 : { // swap large with small
- ; 1816 : pointer _Ptr = this->_Bx._Ptr;
- ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 1818 : _Traits::copy(this->_Bx._Buf,
- ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
- ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
- ; 1821 : }
- ; 1822 : else
- ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
- ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
- ; 1825 : else
- ; 1826 : { // swap small with large
- ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
- ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
- ; 1829 : _Traits::copy(_Right._Bx._Buf,
- ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
- ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 1832 : }
- ; 1833 : }
- ; 1834 :
- ; 1835 : void swap(_Myt& _Right)
- ; 1836 : { // exchange contents with _Right
- ; 1837 : if (this == &_Right)
- ; 1838 : ; // same object, do nothing
- ; 1839 : else if (this->_Getal() == _Right._Getal())
- ; 1840 : { // same allocator, swap control information
- ; 1841 : this->_Swap_all(_Right);
- ; 1842 : _Swap_bx(_Right);
- ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1844 : _STD swap(this->_Myres, _Right._Myres);
- ; 1845 : }
- ; 1846 :
- ; 1847 : #if _HAS_CPP0X
- ; 1848 : else if (_Alty::propagate_on_container_swap::value)
- ; 1849 : { // swap allocators and control information
- ; 1850 : this->_Swap_alloc(_Right);
- ; 1851 : _Swap_bx(_Right);
- ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
- ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
- ; 1854 : _STD swap(this->_Myres, _Right._Myres);
- ; 1855 : }
- ; 1856 : #endif /* _HAS_CPP0X */
- ; 1857 :
- ; 1858 : else
- ; 1859 : { // different allocator, do multiple assigns
- ; 1860 : _Myt _Tmp = *this;
- ; 1861 :
- ; 1862 : *this = _Right;
- ; 1863 : _Right = _Tmp;
- ; 1864 : }
- ; 1865 : }
- ; 1866 :
- ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
- ; 1868 : { // look for _Right beginning at or after _Off
- ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
- ; 1870 : }
- ; 1871 :
- ; 1872 : size_type find(const _Elem *_Ptr,
- ; 1873 : size_type _Off, size_type _Count) const
- ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
- ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1876 : if (_Count != 0)
- ; 1877 : _DEBUG_POINTER(_Ptr);
- ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1879 :
- ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
- ; 1881 : return (_Off); // null string always matches (if inside string)
- ; 1882 :
- ; 1883 : size_type _Nm;
- ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
- ; 1885 : { // room for match, look for it
- ; 1886 : const _Elem *_Uptr, *_Vptr;
- ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
- ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
- ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
- ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1891 : return (_Uptr - this->_Myptr()); // found a match
- ; 1892 : }
- ; 1893 :
- ; 1894 : return (npos); // no match
- ; 1895 : }
- ; 1896 :
- ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
- ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
- ; 1899 : _DEBUG_POINTER(_Ptr);
- ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1901 : }
- ; 1902 :
- ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
- ; 1904 : { // look for _Ch at or after _Off
- ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1906 : }
- ; 1907 :
- ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
- ; 1909 : { // look for _Right beginning before _Off
- ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
- ; 1911 : }
- ; 1912 :
- ; 1913 : size_type rfind(const _Elem *_Ptr,
- ; 1914 : size_type _Off, size_type _Count) const
- ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
- ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1917 : if (_Count != 0)
- ; 1918 : _DEBUG_POINTER(_Ptr);
- ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1920 :
- ; 1921 : if (_Count == 0)
- ; 1922 : return (_Off < this->_Mysize ? _Off
- ; 1923 : : this->_Mysize); // null always matches
- ; 1924 : if (_Count <= this->_Mysize)
- ; 1925 : { // room for match, look for it
- ; 1926 : const _Elem *_Uptr = this->_Myptr() +
- ; 1927 : (_Off < this->_Mysize - _Count ? _Off
- ; 1928 : : this->_Mysize - _Count);
- ; 1929 : for (; ; --_Uptr)
- ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
- ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
- ; 1932 : return (_Uptr - this->_Myptr()); // found a match
- ; 1933 : else if (_Uptr == this->_Myptr())
- ; 1934 : break; // at beginning, no more chance for match
- ; 1935 : }
- ; 1936 :
- ; 1937 : return (npos); // no match
- ; 1938 : }
- ; 1939 :
- ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
- ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
- ; 1942 : _DEBUG_POINTER(_Ptr);
- ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1944 : }
- ; 1945 :
- ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
- ; 1947 : { // look for _Ch before _Off
- ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 1949 : }
- ; 1950 :
- ; 1951 : size_type find_first_of(const _Myt& _Right,
- ; 1952 : size_type _Off = 0) const _NOEXCEPT
- ; 1953 : { // look for one of _Right at or after _Off
- ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1955 : }
- ; 1956 :
- ; 1957 : size_type find_first_of(const _Elem *_Ptr,
- ; 1958 : size_type _Off, size_type _Count) const
- ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
- ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1961 : if (_Count != 0)
- ; 1962 : _DEBUG_POINTER(_Ptr);
- ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1964 :
- ; 1965 : if (0 < _Count && _Off < this->_Mysize)
- ; 1966 : { // room for match, look for it
- ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 1969 : _Uptr < _Vptr; ++_Uptr)
- ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 1971 : return (_Uptr - this->_Myptr()); // found a match
- ; 1972 : }
- ; 1973 :
- ; 1974 : return (npos); // no match
- ; 1975 : }
- ; 1976 :
- ; 1977 : size_type find_first_of(const _Elem *_Ptr,
- ; 1978 : size_type _Off = 0) const
- ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 1980 : _DEBUG_POINTER(_Ptr);
- ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 1982 : }
- ; 1983 :
- ; 1984 : size_type find_first_of(_Elem _Ch,
- ; 1985 : size_type _Off = 0) const
- ; 1986 : { // look for _Ch at or after _Off
- ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
- ; 1988 : }
- ; 1989 :
- ; 1990 : size_type find_last_of(const _Myt& _Right,
- ; 1991 : size_type _Off = npos) const _NOEXCEPT
- ; 1992 : { // look for one of _Right before _Off
- ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
- ; 1994 : }
- ; 1995 :
- ; 1996 : size_type find_last_of(const _Elem *_Ptr,
- ; 1997 : size_type _Off, size_type _Count) const
- ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
- ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2000 : if (_Count != 0)
- ; 2001 : _DEBUG_POINTER(_Ptr);
- ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2003 :
- ; 2004 : if (0 < _Count && 0 < this->_Mysize)
- ; 2005 : { // worth searching, do it
- ; 2006 : const _Elem *_Uptr = this->_Myptr()
- ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2008 : for (; ; --_Uptr)
- ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
- ; 2010 : return (_Uptr - this->_Myptr()); // found a match
- ; 2011 : else if (_Uptr == this->_Myptr())
- ; 2012 : break; // at beginning, no more chance for match
- ; 2013 : }
- ; 2014 :
- ; 2015 : return (npos); // no match
- ; 2016 : }
- ; 2017 :
- ; 2018 : size_type find_last_of(const _Elem *_Ptr,
- ; 2019 : size_type _Off = npos) const
- ; 2020 : { // look for one of [_Ptr, <null>) before _Off
- ; 2021 : _DEBUG_POINTER(_Ptr);
- ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2023 : }
- ; 2024 :
- ; 2025 : size_type find_last_of(_Elem _Ch,
- ; 2026 : size_type _Off = npos) const
- ; 2027 : { // look for _Ch before _Off
- ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
- ; 2029 : }
- ; 2030 :
- ; 2031 : size_type find_first_not_of(const _Myt& _Right,
- ; 2032 : size_type _Off = 0) const _NOEXCEPT
- ; 2033 : { // look for none of _Right at or after _Off
- ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
- ; 2035 : _Right.size()));
- ; 2036 : }
- ; 2037 :
- ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2039 : size_type _Off, size_type _Count) const
- ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
- ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2042 : if (_Count != 0)
- ; 2043 : _DEBUG_POINTER(_Ptr);
- ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2045 :
- ; 2046 : if (_Off < this->_Mysize)
- ; 2047 : { // room for match, look for it
- ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
- ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
- ; 2050 : _Uptr < _Vptr; ++_Uptr)
- ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2052 : return (_Uptr - this->_Myptr());
- ; 2053 : }
- ; 2054 : return (npos);
- ; 2055 : }
- ; 2056 :
- ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
- ; 2058 : size_type _Off = 0) const
- ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
- ; 2060 : _DEBUG_POINTER(_Ptr);
- ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2062 : }
- ; 2063 :
- ; 2064 : size_type find_first_not_of(_Elem _Ch,
- ; 2065 : size_type _Off = 0) const
- ; 2066 : { // look for non _Ch at or after _Off
- ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2068 : }
- ; 2069 :
- ; 2070 : size_type find_last_not_of(const _Myt& _Right,
- ; 2071 : size_type _Off = npos) const _NOEXCEPT
- ; 2072 : { // look for none of _Right before _Off
- ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
- ; 2074 : }
- ; 2075 :
- ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2077 : size_type _Off, size_type _Count) const
- ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
- ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2080 : if (_Count != 0)
- ; 2081 : _DEBUG_POINTER(_Ptr);
- ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2083 :
- ; 2084 : if (0 < this->_Mysize)
- ; 2085 : { // worth searching, do it
- ; 2086 : const _Elem *_Uptr = this->_Myptr()
- ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
- ; 2088 : for (; ; --_Uptr)
- ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
- ; 2090 : return (_Uptr - this->_Myptr());
- ; 2091 : else if (_Uptr == this->_Myptr())
- ; 2092 : break;
- ; 2093 : }
- ; 2094 : return (npos);
- ; 2095 : }
- ; 2096 :
- ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
- ; 2098 : size_type _Off = npos) const
- ; 2099 : { // look for none of [_Ptr, <null>) before _Off
- ; 2100 : _DEBUG_POINTER(_Ptr);
- ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
- ; 2102 : }
- ; 2103 :
- ; 2104 : size_type find_last_not_of(_Elem _Ch,
- ; 2105 : size_type _Off = npos) const
- ; 2106 : { // look for non _Ch before _Off
- ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
- ; 2108 : }
- ; 2109 :
- ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
- ; 2111 : { // return [_Off, _Off + _Count) as new string
- ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
- ; 2113 : }
- ; 2114 :
- ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
- ; 2116 : { // compare [0, _Mysize) with _Right
- ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
- ; 2118 : }
- ; 2119 :
- ; 2120 : int compare(size_type _Off, size_type _N0,
- ; 2121 : const _Myt& _Right) const
- ; 2122 : { // compare [_Off, _Off + _N0) with _Right
- ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
- ; 2124 : }
- ; 2125 :
- ; 2126 : int compare(size_type _Off,
- ; 2127 : size_type _N0, const _Myt& _Right,
- ; 2128 : size_type _Roff, size_type _Count) const
- ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 2130 : if (_Right.size() < _Roff)
- ; 2131 : _Xran(); // _Off off end
- ; 2132 : if (_Right._Mysize - _Roff < _Count)
- ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
- ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
- ; 2135 : }
- ; 2136 :
- ; 2137 : int compare(const _Elem *_Ptr) const
- ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
- ; 2139 : _DEBUG_POINTER(_Ptr);
- ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
- ; 2141 : }
- ; 2142 :
- ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
- ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 2145 : _DEBUG_POINTER(_Ptr);
- ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 2147 : }
- ; 2148 :
- ; 2149 : int compare(size_type _Off,
- ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
- ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 2153 : if (_Count != 0)
- ; 2154 : _DEBUG_POINTER(_Ptr);
- ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 2156 :
- ; 2157 : if (this->_Mysize < _Off)
- ; 2158 : _Xran(); // _Off off end
- ; 2159 : if (this->_Mysize - _Off < _N0)
- ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 2161 :
- ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
- ; 2163 : _N0 < _Count ? _N0 : _Count);
- ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
- ; 2165 : : _N0 == _Count ? 0 : +1);
- ; 2166 : }
- ; 2167 :
- ; 2168 : allocator_type get_allocator() const _NOEXCEPT
- ; 2169 : { // return allocator object for values
- ; 2170 : return (this->_Getal());
- ; 2171 : }
- ; 2172 :
- ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
- ; 2174 : { // assign _Count copies of _Ch beginning at _Off
- ; 2175 : if (_Count == 1)
- ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
- ; 2177 : else
- ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
- ; 2179 : }
- ; 2180 :
- ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
- ; 2182 : { // copy _Oldlen elements to newly allocated buffer
- ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
- ; 2184 : if (max_size() < _Newres)
- ; 2185 : _Newres = _Newsize; // undo roundup if too big
- ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
- ; 2187 : ;
- ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
- ; 2189 : _Newres = this->_Myres
- ; 2190 : + this->_Myres / 2; // grow exponentially if possible
- ; 2191 : else
- ; 2192 : _Newres = max_size(); // settle for max_size()
- ; 2193 :
- ; 2194 : _Elem *_Ptr;
- ; 2195 : _TRY_BEGIN
- ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2197 : _CATCH_ALL
- ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
- ; 2199 : _TRY_BEGIN
- ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
- ; 2201 : _CATCH_ALL
- ; 2202 : _Tidy(true); // failed again, discard storage and reraise
- ; 2203 : _RERAISE;
- ; 2204 : _CATCH_END
- ; 2205 : _CATCH_END
- ; 2206 :
- ; 2207 : if (0 < _Oldlen)
- ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
- ; 2209 : _Oldlen); // copy existing elements
- ; 2210 : _Tidy(true);
- ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
- ; 2212 : this->_Myres = _Newres;
- ; 2213 : _Eos(_Oldlen);
- ; 2214 : }
- ; 2215 :
- ; 2216 : void _Eos(size_type _Newsize)
- ; 2217 : { // set new length and null terminator
- ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
- mov DWORD PTR [esi+16], edi
- ; 517 : : this->_Bx._Buf);
- jb SHORT $LN34@erase
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov eax, DWORD PTR [esi]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax+edi], 0
- pop edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1329 : return (*this);
- mov eax, esi
- pop esi
- ; 1330 : }
- pop ebp
- ret 8
- $LN34@erase:
- ; 517 : : this->_Bx._Buf);
- mov eax, esi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [eax+edi], 0
- $LN40@erase:
- pop edi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 1329 : return (*this);
- mov eax, esi
- pop esi
- ; 1330 : }
- pop ebp
- ret 8
- ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::erase
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ
- _TEXT SEGMENT
- ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::max_size, COMDAT
- ; _this$dead$ = ecx
- ; 1738 : size_type _Num = this->_Getal().max_size();
- ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
- mov eax, -2 ; fffffffeH
- ; 1740 : }
- ret 0
- ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::max_size
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; COMDAT ?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z
- _TEXT SEGMENT
- _this$ = -24 ; size = 4
- __Ptr$1$ = -20 ; size = 4
- __Ptr$ = -20 ; size = 4
- __$EHRec$ = -16 ; size = 16
- __Newres$ = 8 ; size = 4
- __Newsize$ = 8 ; size = 4
- __Oldlen$ = 12 ; size = 4
- ?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z PROC ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy, COMDAT
- ; _this$ = ecx
- ; 2182 : { // copy _Oldlen elements to newly allocated buffer
- push ebp
- mov ebp, esp
- push -1
- push __ehhandler$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z
- mov eax, DWORD PTR fs:0
- push eax
- sub esp, 12 ; 0000000cH
- push ebx
- push esi
- push edi
- mov eax, DWORD PTR ___security_cookie
- xor eax, ebp
- push eax
- lea eax, DWORD PTR __$EHRec$[ebp+4]
- mov DWORD PTR fs:0, eax
- mov DWORD PTR __$EHRec$[ebp], esp
- mov esi, ecx
- mov DWORD PTR _this$[ebp], esi
- ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
- mov eax, DWORD PTR __Newsize$[ebp]
- mov edi, eax
- or edi, 15 ; 0000000fH
- ; 2184 : if (max_size() < _Newres)
- cmp edi, -2 ; fffffffeH
- jbe SHORT $LN9@Copy
- ; 2185 : _Newres = _Newsize; // undo roundup if too big
- mov edi, eax
- jmp SHORT $LN47@Copy
- $LN9@Copy:
- ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
- mov ebx, DWORD PTR [esi+20]
- mov eax, -1431655765 ; aaaaaaabH
- mul edi
- mov ecx, ebx
- shr ecx, 1
- shr edx, 1
- cmp ecx, edx
- jbe SHORT $LN47@Copy
- ; 2187 : ;
- ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
- mov eax, -2 ; fffffffeH
- sub eax, ecx
- ; 2189 : _Newres = this->_Myres
- ; 2190 : + this->_Myres / 2; // grow exponentially if possible
- lea edi, DWORD PTR [ecx+ebx]
- cmp ebx, eax
- jbe SHORT $LN47@Copy
- ; 518 : }
- ; 519 :
- ; 520 : const value_type *_Myptr() const
- ; 521 : { // determine current pointer to buffer for nonmutable string
- ; 522 : return (this->_BUF_SIZE <= this->_Myres
- ; 523 : ? _STD addressof(*this->_Bx._Ptr)
- ; 524 : : this->_Bx._Buf);
- ; 525 : }
- ; 526 :
- ; 527 : union _Bxty
- ; 528 : { // storage for small buffer or pointer to larger one
- ; 529 : value_type _Buf[_BUF_SIZE];
- ; 530 : pointer _Ptr;
- ; 531 : char _Alias[_BUF_SIZE]; // to permit aliasing
- ; 532 : } _Bx;
- ; 533 :
- ; 534 : size_type _Mysize; // current length of string
- ; 535 : size_type _Myres; // current storage reserved for string
- ; 536 : };
- ; 537 :
- ; 538 : // TEMPLATE CLASS _String_alloc
- ; 539 : template<bool _Al_has_storage,
- ; 540 : class _Alloc_types>
- ; 541 : class _String_alloc
- ; 542 : : public _String_val<typename _Alloc_types::_Val_types>
- ; 543 : { // base class for basic_string to hold allocator with storage
- ; 544 : public:
- ; 545 : typedef _String_alloc<_Al_has_storage, _Alloc_types> _Myt;
- ; 546 : typedef typename _Alloc_types::_Alloc _Alloc;
- ; 547 :
- ; 548 : typedef typename _Alloc_types::_Alty _Alty;
- ; 549 :
- ; 550 : #if _ITERATOR_DEBUG_LEVEL == 0
- ; 551 : _String_alloc(const _Alloc& _Al = _Alloc())
- ; 552 : : _Alval(_Al)
- ; 553 : { // construct allocator from _Al
- ; 554 : }
- ; 555 :
- ; 556 : void _Change_alloc(const _Alty& _Al)
- ; 557 : { // replace old allocator
- ; 558 : _Alval = _Al;
- ; 559 : }
- ; 560 :
- ; 561 : void _Swap_alloc(_Myt& _Right)
- ; 562 : { // swap allocators
- ; 563 : _Swap_adl(this->_Alval, _Right._Alval);
- ; 564 : }
- ; 565 :
- ; 566 : #else /* _ITERATOR_DEBUG_LEVEL == 0 */
- ; 567 : _String_alloc(const _Alloc& _Al = _Alloc())
- ; 568 : : _Alval(_Al)
- ; 569 : { // construct allocator from _Al
- ; 570 : _Alloc_proxy();
- ; 571 : }
- ; 572 :
- ; 573 : ~_String_alloc() _NOEXCEPT
- ; 574 : { // destroy the object
- ; 575 : _Free_proxy();
- ; 576 : }
- ; 577 :
- ; 578 : void _Change_alloc(const _Alty& _Al)
- ; 579 : { // replace old allocator
- ; 580 : _Free_proxy();
- ; 581 : _Alval = _Al;
- ; 582 : _Alloc_proxy();
- ; 583 : }
- ; 584 :
- ; 585 : void _Swap_alloc(_Myt& _Right)
- ; 586 : { // swap allocators
- ; 587 : _Swap_adl(_Alval, _Right._Alval);
- ; 588 : _Swap_adl(this->_Myproxy, _Right._Myproxy);
- ; 589 : }
- ; 590 :
- ; 591 : void _Alloc_proxy()
- ; 592 : { // construct proxy from _Alval
- ; 593 : typename _Alloc::template rebind<_Container_proxy>::other
- ; 594 : _Alproxy(_Alval);
- ; 595 : this->_Myproxy = _Alproxy.allocate(1);
- ; 596 : _Alproxy.construct(this->_Myproxy, _Container_proxy());
- ; 597 : this->_Myproxy->_Mycont = this;
- ; 598 : }
- ; 599 :
- ; 600 : void _Free_proxy()
- ; 601 : { // destroy proxy
- ; 602 : typename _Alloc::template rebind<_Container_proxy>::other
- ; 603 : _Alproxy(_Alval);
- ; 604 : this->_Orphan_all();
- ; 605 : _Alproxy.destroy(this->_Myproxy);
- ; 606 : _Alproxy.deallocate(this->_Myproxy, 1);
- ; 607 : this->_Myproxy = 0;
- ; 608 : }
- ; 609 : #endif /* _ITERATOR_DEBUG_LEVEL == 0 */
- ; 610 :
- ; 611 : _Alty& _Getal()
- ; 612 : { // get reference to allocator
- ; 613 : return (_Alval);
- ; 614 : }
- ; 615 :
- ; 616 : const _Alty& _Getal() const
- ; 617 : { // get reference to allocator
- ; 618 : return (_Alval);
- ; 619 : }
- ; 620 :
- ; 621 : _Alty _Alval; // allocator object for strings
- ; 622 : };
- ; 623 :
- ; 624 : template<class _Alloc_types>
- ; 625 : class _String_alloc<false, _Alloc_types>
- ; 626 : : public _String_val<typename _Alloc_types::_Val_types>
- ; 627 : { // base class for basic_string to hold allocator with no storage
- ; 628 : public:
- ; 629 : typedef _String_alloc<false, _Alloc_types> _Myt;
- ; 630 : typedef typename _Alloc_types::_Alloc _Alloc;
- ; 631 :
- ; 632 : typedef typename _Alloc_types::_Alty _Alty;
- ; 633 :
- ; 634 : #if _ITERATOR_DEBUG_LEVEL == 0
- ; 635 : _String_alloc(const _Alloc& = _Alloc())
- ; 636 : { // construct allocator from _Al
- ; 637 : }
- ; 638 :
- ; 639 : void _Change_alloc(const _Alty&)
- ; 640 : { // replace old allocator
- ; 641 : }
- ; 642 :
- ; 643 : void _Swap_alloc(_Myt&)
- ; 644 : { // swap allocators
- ; 645 : }
- ; 646 :
- ; 647 : #else /* _ITERATOR_DEBUG_LEVEL == 0 */
- ; 648 : _String_alloc(const _Alloc& = _Alloc())
- ; 649 : { // construct allocator from _Al
- ; 650 : _Alloc_proxy();
- ; 651 : }
- ; 652 :
- ; 653 : ~_String_alloc() _NOEXCEPT
- ; 654 : { // destroy the object
- ; 655 : _Free_proxy();
- ; 656 : }
- ; 657 :
- ; 658 : void _Change_alloc(const _Alty&)
- ; 659 : { // replace old allocator
- ; 660 : }
- ; 661 :
- ; 662 : void _Swap_alloc(_Myt& _Right)
- ; 663 : { // swap allocators
- ; 664 : _Swap_adl(this->_Myproxy, _Right._Myproxy);
- ; 665 : }
- ; 666 :
- ; 667 : void _Alloc_proxy()
- ; 668 : { // construct proxy from _Alval
- ; 669 : typename _Alloc::template rebind<_Container_proxy>::other
- ; 670 : _Alproxy;
- ; 671 : this->_Myproxy = _Alproxy.allocate(1);
- ; 672 : _Alproxy.construct(this->_Myproxy, _Container_proxy());
- ; 673 : this->_Myproxy->_Mycont = this;
- ; 674 : }
- ; 675 :
- ; 676 : void _Free_proxy()
- ; 677 : { // destroy proxy
- ; 678 : typename _Alloc::template rebind<_Container_proxy>::other
- ; 679 : _Alproxy;
- ; 680 : this->_Orphan_all();
- ; 681 : _Alproxy.destroy(this->_Myproxy);
- ; 682 : _Alproxy.deallocate(this->_Myproxy, 1);
- ; 683 : this->_Myproxy = 0;
- ; 684 : }
- ; 685 : #endif /* _ITERATOR_DEBUG_LEVEL == 0 */
- ; 686 :
- ; 687 : _Alty _Getal() const
- ; 688 : { // get reference to allocator
- ; 689 : return (_Alty());
- ; 690 : }
- ; 691 : };
- ; 692 :
- ; 693 : // TEMPLATE CLASS basic_string
- ; 694 : template<class _Elem,
- ; 695 : class _Traits,
- ; 696 : class _Alloc>
- ; 697 : class basic_string
- ; 698 : : public _String_alloc<!is_empty<_Alloc>::value,
- ; 699 : _String_base_types<_Elem, _Alloc> >
- ; 700 : { // null-terminated transparent array of elements
- ; 701 : public:
- ; 702 : typedef basic_string<_Elem, _Traits, _Alloc> _Myt;
- ; 703 : typedef _String_alloc<!is_empty<_Alloc>::value,
- ; 704 : _String_base_types<_Elem, _Alloc> > _Mybase;
- ; 705 : typedef _Traits traits_type;
- ; 706 : typedef _Alloc allocator_type;
- ; 707 :
- ; 708 : typedef typename _Mybase::_Alty _Alty;
- ; 709 :
- ; 710 : typedef typename _Mybase::value_type value_type;
- ; 711 : typedef typename _Mybase::size_type size_type;
- ; 712 : typedef typename _Mybase::difference_type difference_type;
- ; 713 : typedef typename _Mybase::pointer pointer;
- ; 714 : typedef typename _Mybase::const_pointer const_pointer;
- ; 715 : typedef typename _Mybase::reference reference;
- ; 716 : typedef typename _Mybase::const_reference const_reference;
- ; 717 :
- ; 718 : typedef typename _Mybase::iterator iterator;
- ; 719 : typedef typename _Mybase::const_iterator const_iterator;
- ; 720 :
- ; 721 : typedef _STD reverse_iterator<iterator> reverse_iterator;
- ; 722 : typedef _STD reverse_iterator<const_iterator> const_reverse_iterator;
- ; 723 :
- ; 724 : basic_string(const _Myt& _Right)
- ; 725 :
- ; 726 : #if _HAS_CPP0X
- ; 727 : : _Mybase(_Right._Getal().select_on_container_copy_construction())
- ; 728 :
- ; 729 : #else /* _HAS_CPP0X */
- ; 730 : : _Mybase(_Right._Getal())
- ; 731 : #endif /* _HAS_CPP0X */
- ; 732 :
- ; 733 : { // construct by copying _Right
- ; 734 : _Tidy();
- ; 735 : assign(_Right, 0, npos);
- ; 736 : }
- ; 737 :
- ; 738 : #if _HAS_CPP0X
- ; 739 : basic_string(const _Myt& _Right, const _Alloc& _Al)
- ; 740 : : _Mybase(_Al)
- ; 741 : { // construct by copying with allocator
- ; 742 : _Tidy();
- ; 743 : assign(_Right, 0, npos);
- ; 744 : }
- ; 745 : #endif /* _HAS_CPP0X */
- ; 746 :
- ; 747 : basic_string()
- ; 748 : : _Mybase()
- ; 749 : { // construct empty string
- ; 750 : _Tidy();
- ; 751 : }
- ; 752 :
- ; 753 : explicit basic_string(const _Alloc& _Al)
- ; 754 : : _Mybase(_Al)
- ; 755 : { // construct empty string with allocator
- ; 756 : _Tidy();
- ; 757 : }
- ; 758 :
- ; 759 : basic_string(const _Myt& _Right, size_type _Roff,
- ; 760 : size_type _Count = npos)
- ; 761 : : _Mybase(_Right._Getal())
- ; 762 : { // construct from _Right [_Roff, _Roff + _Count)
- ; 763 : _Tidy();
- ; 764 : assign(_Right, _Roff, _Count);
- ; 765 : }
- ; 766 :
- ; 767 : basic_string(const _Myt& _Right, size_type _Roff, size_type _Count,
- ; 768 : const _Alloc& _Al)
- ; 769 : : _Mybase(_Al)
- ; 770 : { // construct from _Right [_Roff, _Roff + _Count) with allocator
- ; 771 : _Tidy();
- ; 772 : assign(_Right, _Roff, _Count);
- ; 773 : }
- ; 774 :
- ; 775 : basic_string(const _Elem *_Ptr, size_type _Count)
- ; 776 : : _Mybase()
- ; 777 : { // construct from [_Ptr, _Ptr + _Count)
- ; 778 : _Tidy();
- ; 779 : assign(_Ptr, _Count);
- ; 780 : }
- ; 781 :
- ; 782 : basic_string(const _Elem *_Ptr, size_type _Count, const _Alloc& _Al)
- ; 783 : : _Mybase(_Al)
- ; 784 : { // construct from [_Ptr, _Ptr + _Count) with allocator
- ; 785 : _Tidy();
- ; 786 : assign(_Ptr, _Count);
- ; 787 : }
- ; 788 :
- ; 789 : basic_string(const _Elem *_Ptr)
- ; 790 : : _Mybase()
- ; 791 : { // construct from [_Ptr, <null>)
- ; 792 : _Tidy();
- ; 793 : assign(_Ptr);
- ; 794 : }
- ; 795 :
- ; 796 : basic_string(const _Elem *_Ptr, const _Alloc& _Al)
- ; 797 : : _Mybase(_Al)
- ; 798 : { // construct from [_Ptr, <null>) with allocator
- ; 799 : _Tidy();
- ; 800 : assign(_Ptr);
- ; 801 : }
- ; 802 :
- ; 803 : basic_string(size_type _Count, _Elem _Ch)
- ; 804 : : _Mybase()
- ; 805 : { // construct from _Count * _Ch
- ; 806 : _Tidy();
- ; 807 : assign(_Count, _Ch);
- ; 808 : }
- ; 809 :
- ; 810 : basic_string(size_type _Count, _Elem _Ch, const _Alloc& _Al)
- ; 811 : : _Mybase(_Al)
- ; 812 : { // construct from _Count * _Ch with allocator
- ; 813 : _Tidy();
- ; 814 : assign(_Count, _Ch);
- ; 815 : }
- ; 816 :
- ; 817 : template<class _Iter>
- ; 818 : basic_string(_Iter _First, _Iter _Last,
- ; 819 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 820 : void>::type ** = 0)
- ; 821 : : _Mybase()
- ; 822 : { // construct from [_First, _Last)
- ; 823 : _Tidy();
- ; 824 : _Construct(_First, _Last, _Iter_cat(_First));
- ; 825 : }
- ; 826 :
- ; 827 : template<class _Iter>
- ; 828 : basic_string(_Iter _First, _Iter _Last, const _Alloc& _Al,
- ; 829 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 830 : void>::type ** = 0)
- ; 831 : : _Mybase(_Al)
- ; 832 : { // construct from [_First, _Last) with allocator
- ; 833 : _Tidy();
- ; 834 : _Construct(_First, _Last, _Iter_cat(_First));
- ; 835 : }
- ; 836 :
- ; 837 : template<class _Iter>
- ; 838 : void _Construct(_Iter _First,
- ; 839 : _Iter _Last, input_iterator_tag)
- ; 840 : { // initialize from [_First, _Last), input iterators
- ; 841 : _TRY_BEGIN
- ; 842 : for (; _First != _Last; ++_First)
- ; 843 : append((size_type)1, (_Elem)*_First);
- ; 844 : _CATCH_ALL
- ; 845 : _Tidy(true);
- ; 846 : _RERAISE;
- ; 847 : _CATCH_END
- ; 848 : }
- ; 849 :
- ; 850 : template<class _Iter>
- ; 851 : void _Construct(_Iter _First,
- ; 852 : _Iter _Last, forward_iterator_tag)
- ; 853 : { // initialize from [_First, _Last), forward iterators
- ; 854 : _DEBUG_RANGE(_First, _Last);
- ; 855 : size_type _Count = 0;
- ; 856 : _Distance(_First, _Last, _Count);
- ; 857 : reserve(_Count);
- ; 858 :
- ; 859 : _TRY_BEGIN
- ; 860 : for (; _First != _Last; ++_First)
- ; 861 : append((size_type)1, (_Elem)*_First);
- ; 862 : _CATCH_ALL
- ; 863 : _Tidy(true);
- ; 864 : _RERAISE;
- ; 865 : _CATCH_END
- ; 866 : }
- ; 867 :
- ; 868 : basic_string(const_pointer _First, const_pointer _Last)
- ; 869 : : _Mybase()
- ; 870 : { // construct from [_First, _Last), const pointers
- ; 871 : _DEBUG_RANGE(_First, _Last);
- ; 872 : _Tidy();
- ; 873 : if (_First != _Last)
- ; 874 : assign(&*_First, _Last - _First);
- ; 875 : }
- ; 876 :
- ; 877 : basic_string(const_pointer _First, const_pointer _Last,
- ; 878 : const _Alloc& _Al)
- ; 879 : : _Mybase(_Al)
- ; 880 : { // construct from [_First, _Last), const pointers
- ; 881 : _DEBUG_RANGE(_First, _Last);
- ; 882 : _Tidy();
- ; 883 : if (_First != _Last)
- ; 884 : assign(&*_First, _Last - _First);
- ; 885 : }
- ; 886 :
- ; 887 : basic_string(const_iterator _First, const_iterator _Last)
- ; 888 : : _Mybase()
- ; 889 : { // construct from [_First, _Last), const_iterators
- ; 890 : _DEBUG_RANGE(_First, _Last);
- ; 891 : _Tidy();
- ; 892 : if (_First != _Last)
- ; 893 : assign(&*_First, _Last - _First);
- ; 894 : }
- ; 895 :
- ; 896 : basic_string(_Myt&& _Right) _NOEXCEPT
- ; 897 : : _Mybase(_Right._Getal())
- ; 898 : { // construct by moving _Right
- ; 899 : _Tidy();
- ; 900 : _Assign_rv(_STD forward<_Myt>(_Right));
- ; 901 : }
- ; 902 :
- ; 903 : basic_string(_Myt&& _Right, const _Alloc& _Al)
- ; 904 : : _Mybase(_Al)
- ; 905 : { // construct by moving _Right, allocator
- ; 906 : if (this->_Getal() != _Right._Getal())
- ; 907 : assign(_Right.begin(), _Right.end());
- ; 908 : else
- ; 909 : _Assign_rv(_STD forward<_Myt>(_Right));
- ; 910 : }
- ; 911 :
- ; 912 : _Myt& operator=(_Myt&& _Right) _NOEXCEPT
- ; 913 : { // assign by moving _Right
- ; 914 : if (this != &_Right)
- ; 915 : { // different, assign it
- ; 916 : _Tidy(true);
- ; 917 :
- ; 918 : #if _HAS_CPP0X
- ; 919 : if (this->_Getal() != _Right._Getal()
- ; 920 : && _Alty::propagate_on_container_move_assignment::value)
- ; 921 : this->_Change_alloc(_Right._Getal());
- ; 922 : #endif /* _HAS_CPP0X */
- ; 923 :
- ; 924 : if (this->_Getal() != _Right._Getal())
- ; 925 : assign(_Right.begin(), _Right.end());
- ; 926 : else
- ; 927 : _Assign_rv(_STD forward<_Myt>(_Right));
- ; 928 : }
- ; 929 : return (*this);
- ; 930 : }
- ; 931 :
- ; 932 : _Myt& assign(_Myt&& _Right) _NOEXCEPT
- ; 933 : { // assign by moving _Right
- ; 934 : if (this == &_Right)
- ; 935 : ;
- ; 936 : else if (get_allocator() != _Right.get_allocator()
- ; 937 : && this->_BUF_SIZE <= _Right._Myres)
- ; 938 : *this = _Right;
- ; 939 : else
- ; 940 : { // not same, clear this and steal from _Right
- ; 941 : _Tidy(true);
- ; 942 : _Assign_rv(_STD forward<_Myt>(_Right));
- ; 943 : }
- ; 944 : return (*this);
- ; 945 : }
- ; 946 :
- ; 947 : void _Assign_rv(_Myt&& _Right)
- ; 948 : { // assign by moving _Right
- ; 949 : if (_Right._Myres < this->_BUF_SIZE)
- ; 950 : _Traits::move(this->_Bx._Buf, _Right._Bx._Buf,
- ; 951 : _Right._Mysize + 1);
- ; 952 : else
- ; 953 : { // copy pointer
- ; 954 : this->_Getal().construct(&this->_Bx._Ptr, _Right._Bx._Ptr);
- ; 955 : _Right._Bx._Ptr = pointer();
- ; 956 : }
- ; 957 : this->_Mysize = _Right._Mysize;
- ; 958 : this->_Myres = _Right._Myres;
- ; 959 : _Right._Tidy();
- ; 960 : }
- ; 961 :
- ; 962 : ~basic_string() _NOEXCEPT
- ; 963 : { // destroy the string
- ; 964 : _Tidy(true);
- ; 965 : }
- ; 966 :
- ; 967 : _PGLOBAL static const size_type npos; // bad/missing length/position
- ; 968 :
- ; 969 : _Myt& operator=(const _Myt& _Right)
- ; 970 : { // assign _Right
- ; 971 : if (this != &_Right)
- ; 972 : { // different, assign it
- ; 973 : #if _HAS_CPP0X
- ; 974 : if (this->_Getal() != _Right._Getal()
- ; 975 : && _Alty::propagate_on_container_copy_assignment::value)
- ; 976 : { // change allocator before copying
- ; 977 : _Tidy(true);
- ; 978 : this->_Change_alloc(_Right._Getal());
- ; 979 : }
- ; 980 : #endif /* _HAS_CPP0X */
- ; 981 :
- ; 982 : assign(_Right);
- ; 983 : }
- ; 984 : return (*this);
- ; 985 : }
- ; 986 :
- ; 987 : _Myt& operator=(const _Elem *_Ptr)
- ; 988 : { // assign [_Ptr, <null>)
- ; 989 : return (assign(_Ptr));
- ; 990 : }
- ; 991 :
- ; 992 : _Myt& operator=(_Elem _Ch)
- ; 993 : { // assign 1 * _Ch
- ; 994 : return (assign(1, _Ch));
- ; 995 : }
- ; 996 :
- ; 997 : _Myt& operator+=(const _Myt& _Right)
- ; 998 : { // append _Right
- ; 999 : return (append(_Right));
- ; 1000 : }
- ; 1001 :
- ; 1002 : _Myt& operator+=(const _Elem *_Ptr)
- ; 1003 : { // append [_Ptr, <null>)
- ; 1004 : return (append(_Ptr));
- ; 1005 : }
- ; 1006 :
- ; 1007 : _Myt& operator+=(_Elem _Ch)
- ; 1008 : { // append 1 * _Ch
- ; 1009 : return (append((size_type)1, _Ch));
- ; 1010 : }
- ; 1011 :
- ; 1012 : _Myt& append(const _Myt& _Right)
- ; 1013 : { // append _Right
- ; 1014 : return (append(_Right, 0, npos));
- ; 1015 : }
- ; 1016 :
- ; 1017 : _Myt& append(const _Myt& _Right,
- ; 1018 : size_type _Roff, size_type _Count)
- ; 1019 : { // append _Right [_Roff, _Roff + _Count)
- ; 1020 : if (_Right.size() < _Roff)
- ; 1021 : _Xran(); // _Roff off end
- ; 1022 : size_type _Num = _Right.size() - _Roff;
- ; 1023 : if (_Num < _Count)
- ; 1024 : _Count = _Num; // trim _Count to size
- ; 1025 : if (npos - this->_Mysize <= _Count)
- ; 1026 : _Xlen(); // result too long
- ; 1027 :
- ; 1028 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1029 : { // make room and append new stuff
- ; 1030 : _Traits::copy(this->_Myptr() + this->_Mysize,
- ; 1031 : _Right._Myptr() + _Roff, _Count);
- ; 1032 : _Eos(_Num);
- ; 1033 : }
- ; 1034 : return (*this);
- ; 1035 : }
- ; 1036 :
- ; 1037 : _Myt& append(const _Elem *_Ptr, size_type _Count)
- ; 1038 : { // append [_Ptr, _Ptr + _Count)
- ; 1039 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1040 : if (_Count != 0)
- ; 1041 : _DEBUG_POINTER(_Ptr);
- ; 1042 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1043 :
- ; 1044 : if (_Inside(_Ptr))
- ; 1045 : return (append(*this,
- ; 1046 : _Ptr - this->_Myptr(), _Count)); // substring
- ; 1047 : if (npos - this->_Mysize <= _Count)
- ; 1048 : _Xlen(); // result too long
- ; 1049 :
- ; 1050 : size_type _Num;
- ; 1051 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1052 : { // make room and append new stuff
- ; 1053 : _Traits::copy(this->_Myptr() + this->_Mysize, _Ptr, _Count);
- ; 1054 : _Eos(_Num);
- ; 1055 : }
- ; 1056 : return (*this);
- ; 1057 : }
- ; 1058 :
- ; 1059 : _Myt& append(const _Elem *_Ptr)
- ; 1060 : { // append [_Ptr, <null>)
- ; 1061 : _DEBUG_POINTER(_Ptr);
- ; 1062 : return (append(_Ptr, _Traits::length(_Ptr)));
- ; 1063 : }
- ; 1064 :
- ; 1065 : _Myt& append(size_type _Count, _Elem _Ch)
- ; 1066 : { // append _Count * _Ch
- ; 1067 : if (npos - this->_Mysize <= _Count)
- ; 1068 : _Xlen(); // result too long
- ; 1069 :
- ; 1070 : size_type _Num;
- ; 1071 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1072 : { // make room and append new stuff using assign
- ; 1073 : _Chassign(this->_Mysize, _Count, _Ch);
- ; 1074 : _Eos(_Num);
- ; 1075 : }
- ; 1076 : return (*this);
- ; 1077 : }
- ; 1078 :
- ; 1079 : template<class _Iter>
- ; 1080 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1081 : _Myt&>::type
- ; 1082 : append(_Iter _First, _Iter _Last)
- ; 1083 : { // append [_First, _Last), input iterators
- ; 1084 : return (replace(end(), end(), _First, _Last));
- ; 1085 : }
- ; 1086 :
- ; 1087 : _Myt& append(const_pointer _First, const_pointer _Last)
- ; 1088 : { // append [_First, _Last), const pointers
- ; 1089 : return (replace(end(), end(), _First, _Last));
- ; 1090 : }
- ; 1091 :
- ; 1092 : _Myt& append(const_iterator _First, const_iterator _Last)
- ; 1093 : { // append [_First, _Last), const_iterators
- ; 1094 : return (replace(end(), end(), _First, _Last));
- ; 1095 : }
- ; 1096 :
- ; 1097 : _Myt& assign(const _Myt& _Right)
- ; 1098 : { // assign _Right
- ; 1099 : return (assign(_Right, 0, npos));
- ; 1100 : }
- ; 1101 :
- ; 1102 : _Myt& assign(const _Myt& _Right,
- ; 1103 : size_type _Roff, size_type _Count)
- ; 1104 : { // assign _Right [_Roff, _Roff + _Count)
- ; 1105 : if (_Right.size() < _Roff)
- ; 1106 : _Xran(); // _Roff off end
- ; 1107 : size_type _Num = _Right.size() - _Roff;
- ; 1108 : if (_Count < _Num)
- ; 1109 : _Num = _Count; // trim _Num to size
- ; 1110 :
- ; 1111 : if (this == &_Right)
- ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
- ; 1113 : else if (_Grow(_Num))
- ; 1114 : { // make room and assign new stuff
- ; 1115 : _Traits::copy(this->_Myptr(),
- ; 1116 : _Right._Myptr() + _Roff, _Num);
- ; 1117 : _Eos(_Num);
- ; 1118 : }
- ; 1119 : return (*this);
- ; 1120 : }
- ; 1121 :
- ; 1122 : _Myt& assign(const _Elem *_Ptr, size_type _Count)
- ; 1123 : { // assign [_Ptr, _Ptr + _Count)
- ; 1124 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1125 : if (_Count != 0)
- ; 1126 : _DEBUG_POINTER(_Ptr);
- ; 1127 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1128 :
- ; 1129 : if (_Inside(_Ptr))
- ; 1130 : return (assign(*this,
- ; 1131 : _Ptr - this->_Myptr(), _Count)); // substring
- ; 1132 :
- ; 1133 : if (_Grow(_Count))
- ; 1134 : { // make room and assign new stuff
- ; 1135 : _Traits::copy(this->_Myptr(), _Ptr, _Count);
- ; 1136 : _Eos(_Count);
- ; 1137 : }
- ; 1138 : return (*this);
- ; 1139 : }
- ; 1140 :
- ; 1141 : _Myt& assign(const _Elem *_Ptr)
- ; 1142 : { // assign [_Ptr, <null>)
- ; 1143 : _DEBUG_POINTER(_Ptr);
- ; 1144 : return (assign(_Ptr, _Traits::length(_Ptr)));
- ; 1145 : }
- ; 1146 :
- ; 1147 : _Myt& assign(size_type _Count, _Elem _Ch)
- ; 1148 : { // assign _Count * _Ch
- ; 1149 : if (_Count == npos)
- ; 1150 : _Xlen(); // result too long
- ; 1151 :
- ; 1152 : if (_Grow(_Count))
- ; 1153 : { // make room and assign new stuff
- ; 1154 : _Chassign(0, _Count, _Ch);
- ; 1155 : _Eos(_Count);
- ; 1156 : }
- ; 1157 : return (*this);
- ; 1158 : }
- ; 1159 :
- ; 1160 : template<class _Iter>
- ; 1161 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1162 : _Myt&>::type
- ; 1163 : assign(_Iter _First, _Iter _Last)
- ; 1164 : { // assign [First, _Last), input iterators
- ; 1165 : return (replace(begin(), end(), _First, _Last));
- ; 1166 : }
- ; 1167 :
- ; 1168 : _Myt& assign(const_pointer _First, const_pointer _Last)
- ; 1169 : { // assign [First, _Last), const pointers
- ; 1170 : return (replace(begin(), end(), _First, _Last));
- ; 1171 : }
- ; 1172 :
- ; 1173 : _Myt& assign(const_iterator _First, const_iterator _Last)
- ; 1174 : { // assign [First, _Last), const_iterators
- ; 1175 : return (replace(begin(), end(), _First, _Last));
- ; 1176 : }
- ; 1177 :
- ; 1178 : _Myt& insert(size_type _Off, const _Myt& _Right)
- ; 1179 : { // insert _Right at _Off
- ; 1180 : return (insert(_Off, _Right, 0, npos));
- ; 1181 : }
- ; 1182 :
- ; 1183 : _Myt& insert(size_type _Off,
- ; 1184 : const _Myt& _Right, size_type _Roff, size_type _Count)
- ; 1185 : { // insert _Right [_Roff, _Roff + _Count) at _Off
- ; 1186 : if (this->_Mysize < _Off || _Right.size() < _Roff)
- ; 1187 : _Xran(); // _Off or _Roff off end
- ; 1188 : size_type _Num = _Right.size() - _Roff;
- ; 1189 : if (_Num < _Count)
- ; 1190 : _Count = _Num; // trim _Count to size
- ; 1191 : if (npos - this->_Mysize <= _Count)
- ; 1192 : _Xlen(); // result too long
- ; 1193 :
- ; 1194 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1195 : { // make room and insert new stuff
- ; 1196 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1197 : this->_Myptr() + _Off,
- ; 1198 : this->_Mysize - _Off); // empty out hole
- ; 1199 : if (this == &_Right)
- ; 1200 : _Traits::move(this->_Myptr() + _Off,
- ; 1201 : this->_Myptr() + (_Off < _Roff ? _Roff + _Count : _Roff),
- ; 1202 : _Count); // substring
- ; 1203 : else
- ; 1204 : _Traits::copy(this->_Myptr() + _Off,
- ; 1205 : _Right._Myptr() + _Roff, _Count); // fill hole
- ; 1206 : _Eos(_Num);
- ; 1207 : }
- ; 1208 : return (*this);
- ; 1209 : }
- ; 1210 :
- ; 1211 : _Myt& insert(size_type _Off,
- ; 1212 : const _Elem *_Ptr, size_type _Count)
- ; 1213 : { // insert [_Ptr, _Ptr + _Count) at _Off
- ; 1214 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1215 : if (_Count != 0)
- ; 1216 : _DEBUG_POINTER(_Ptr);
- ; 1217 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1218 :
- ; 1219 : if (_Inside(_Ptr))
- ; 1220 : return (insert(_Off, *this,
- ; 1221 : _Ptr - this->_Myptr(), _Count)); // substring
- ; 1222 : if (this->_Mysize < _Off)
- ; 1223 : _Xran(); // _Off off end
- ; 1224 : if (npos - this->_Mysize <= _Count)
- ; 1225 : _Xlen(); // result too long
- ; 1226 : size_type _Num;
- ; 1227 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1228 : { // make room and insert new stuff
- ; 1229 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1230 : this->_Myptr() + _Off,
- ; 1231 : this->_Mysize - _Off); // empty out hole
- ; 1232 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
- ; 1233 : _Eos(_Num);
- ; 1234 : }
- ; 1235 : return (*this);
- ; 1236 : }
- ; 1237 :
- ; 1238 : _Myt& insert(size_type _Off, const _Elem *_Ptr)
- ; 1239 : { // insert [_Ptr, <null>) at _Off
- ; 1240 : _DEBUG_POINTER(_Ptr);
- ; 1241 : return (insert(_Off, _Ptr, _Traits::length(_Ptr)));
- ; 1242 : }
- ; 1243 :
- ; 1244 : _Myt& insert(size_type _Off,
- ; 1245 : size_type _Count, _Elem _Ch)
- ; 1246 : { // insert _Count * _Ch at _Off
- ; 1247 : if (this->_Mysize < _Off)
- ; 1248 : _Xran(); // _Off off end
- ; 1249 : if (npos - this->_Mysize <= _Count)
- ; 1250 : _Xlen(); // result too long
- ; 1251 : size_type _Num;
- ; 1252 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
- ; 1253 : { // make room and insert new stuff
- ; 1254 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1255 : this->_Myptr() + _Off,
- ; 1256 : this->_Mysize - _Off); // empty out hole
- ; 1257 : _Chassign(_Off, _Count, _Ch); // fill hole
- ; 1258 : _Eos(_Num);
- ; 1259 : }
- ; 1260 : return (*this);
- ; 1261 : }
- ; 1262 :
- ; 1263 : iterator insert(const_iterator _Where)
- ; 1264 : { // insert <null> at _Where
- ; 1265 : return (insert(_Where, _Elem()));
- ; 1266 : }
- ; 1267 :
- ; 1268 : iterator insert(const_iterator _Where, _Elem _Ch)
- ; 1269 : { // insert _Ch at _Where
- ; 1270 : size_type _Off = _Pdif(_Where, begin());
- ; 1271 : insert(_Off, 1, _Ch);
- ; 1272 : return (begin() + _Off);
- ; 1273 : }
- ; 1274 :
- ; 1275 : iterator insert(const_iterator _Where, size_type _Count, _Elem _Ch)
- ; 1276 : { // insert _Count * _Elem at _Where
- ; 1277 : size_type _Off = _Pdif(_Where, begin());
- ; 1278 : insert(_Off, _Count, _Ch);
- ; 1279 : return (begin() + _Off);
- ; 1280 : }
- ; 1281 :
- ; 1282 : template<class _Iter>
- ; 1283 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1284 : iterator>::type
- ; 1285 : insert(const_iterator _Where, _Iter _First, _Iter _Last)
- ; 1286 : { // insert [_First, _Last) at _Where, input iterators
- ; 1287 : size_type _Off = _Pdif(_Where, begin());
- ; 1288 : replace(_Where, _Where, _First, _Last);
- ; 1289 : return (begin() + _Off);
- ; 1290 : }
- ; 1291 :
- ; 1292 : iterator insert(const_iterator _Where,
- ; 1293 : const_pointer _First, const_pointer _Last)
- ; 1294 : { // insert [_First, _Last) at _Where, const pointers
- ; 1295 : size_type _Off = _Pdif(_Where, begin());
- ; 1296 : replace(_Where, _Where, _First, _Last);
- ; 1297 : return (begin() + _Off);
- ; 1298 : }
- ; 1299 :
- ; 1300 : iterator insert(const_iterator _Where,
- ; 1301 : const_iterator _First, const_iterator _Last)
- ; 1302 : { // insert [_First, _Last) at _Where, const_iterators
- ; 1303 : size_type _Off = _Pdif(_Where, begin());
- ; 1304 : replace(_Where, _Where, _First, _Last);
- ; 1305 : return (begin() + _Off);
- ; 1306 : }
- ; 1307 :
- ; 1308 : _Myt& erase(size_type _Off = 0)
- ; 1309 : { // erase elements [_Off, ...)
- ; 1310 : if (this->_Mysize < _Off)
- ; 1311 : _Xran(); // _Off off end
- ; 1312 : _Eos(_Off);
- ; 1313 : return (*this);
- ; 1314 : }
- ; 1315 :
- ; 1316 : _Myt& erase(size_type _Off, size_type _Count)
- ; 1317 : { // erase elements [_Off, _Off + _Count)
- ; 1318 : if (this->_Mysize < _Off)
- ; 1319 : _Xran(); // _Off off end
- ; 1320 : if (this->_Mysize - _Off <= _Count)
- ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
- ; 1322 : else if (0 < _Count)
- ; 1323 : { // move elements down
- ; 1324 : value_type *_Ptr = this->_Myptr() + _Off;
- ; 1325 : size_type _Newsize = this->_Mysize - _Count;
- ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
- ; 1327 : _Eos(_Newsize);
- ; 1328 : }
- ; 1329 : return (*this);
- ; 1330 : }
- ; 1331 :
- ; 1332 : iterator erase(const_iterator _Where)
- ; 1333 : { // erase element at _Where
- ; 1334 : size_type _Count = _Pdif(_Where, begin());
- ; 1335 : erase(_Count, 1);
- ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1337 : }
- ; 1338 :
- ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
- ; 1340 : { // erase substring [_First, _Last)
- ; 1341 : _DEBUG_RANGE(_First, _Last);
- ; 1342 : size_type _Count = _Pdif(_First, begin());
- ; 1343 : erase(_Count, _Pdif(_Last, _First));
- ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
- ; 1345 : }
- ; 1346 :
- ; 1347 : void clear() _NOEXCEPT
- ; 1348 : { // erase all
- ; 1349 : _Eos(0);
- ; 1350 : }
- ; 1351 :
- ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
- ; 1353 : { // replace [_Off, _Off + _N0) with _Right
- ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
- ; 1355 : }
- ; 1356 :
- ; 1357 : _Myt& replace(size_type _Off,
- ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
- ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
- ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
- ; 1361 : _Xran(); // _Off or _Roff off end
- ; 1362 : if (this->_Mysize - _Off < _N0)
- ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1364 : size_type _Num = _Right.size() - _Roff;
- ; 1365 : if (_Num < _Count)
- ; 1366 : _Count = _Num; // trim _Count to size
- ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1368 : _Xlen(); // result too long
- ; 1369 :
- ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
- ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
- ; 1372 : if (this->_Mysize < _Newsize)
- ; 1373 : _Grow(_Newsize);
- ; 1374 :
- ; 1375 : if (this != &_Right)
- ; 1376 : { // no overlap, just move down and copy in new stuff
- ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
- ; 1379 : _Traits::copy(this->_Myptr() + _Off,
- ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
- ; 1381 : }
- ; 1382 : else if (_Count <= _N0)
- ; 1383 : { // hole doesn't get larger, just copy in substring
- ; 1384 : _Traits::move(this->_Myptr() + _Off,
- ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1388 : }
- ; 1389 : else if (_Roff <= _Off)
- ; 1390 : { // hole gets larger, substring begins before hole
- ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1393 : _Traits::move(this->_Myptr() + _Off,
- ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
- ; 1395 : }
- ; 1396 : else if (_Off + _N0 <= _Roff)
- ; 1397 : { // hole gets larger, substring begins after hole
- ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1400 : _Traits::move(this->_Myptr() + _Off,
- ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
- ; 1402 : _Count); // fill hole
- ; 1403 : }
- ; 1404 : else
- ; 1405 : { // hole gets larger, substring begins in hole
- ; 1406 : _Traits::move(this->_Myptr() + _Off,
- ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
- ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
- ; 1411 : this->_Myptr() + _Roff + _Count,
- ; 1412 : _Count - _N0); // fill rest of new hole
- ; 1413 : }
- ; 1414 :
- ; 1415 : _Eos(_Newsize);
- ; 1416 : return (*this);
- ; 1417 : }
- ; 1418 :
- ; 1419 : _Myt& replace(size_type _Off,
- ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
- ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
- ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1423 : if (_Count != 0)
- ; 1424 : _DEBUG_POINTER(_Ptr);
- ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1426 :
- ; 1427 : if (_Inside(_Ptr))
- ; 1428 : return (replace(_Off, _N0, *this,
- ; 1429 : _Ptr - this->_Myptr(),
- ; 1430 : _Count)); // substring, replace carefully
- ; 1431 : if (this->_Mysize < _Off)
- ; 1432 : _Xran(); // _Off off end
- ; 1433 : if (this->_Mysize - _Off < _N0)
- ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1436 : _Xlen(); // result too long
- ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1438 :
- ; 1439 : if (_Count < _N0)
- ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1441 : this->_Myptr() + _Off + _N0,
- ; 1442 : _Nm); // smaller hole, move tail up
- ; 1443 : size_type _Num;
- ; 1444 : if ((0 < _Count || 0 < _N0)
- ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1446 : { // make room and rearrange
- ; 1447 : if (_N0 < _Count)
- ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
- ; 1451 : _Eos(_Num);
- ; 1452 : }
- ; 1453 : return (*this);
- ; 1454 : }
- ; 1455 :
- ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
- ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
- ; 1458 : _DEBUG_POINTER(_Ptr);
- ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
- ; 1460 : }
- ; 1461 :
- ; 1462 : _Myt& replace(size_type _Off,
- ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
- ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
- ; 1465 : if (this->_Mysize < _Off)
- ; 1466 : _Xran(); // _Off off end
- ; 1467 : if (this->_Mysize - _Off < _N0)
- ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
- ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
- ; 1470 : _Xlen(); // result too long
- ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
- ; 1472 :
- ; 1473 : if (_Count < _N0)
- ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1475 : this->_Myptr() + _Off + _N0,
- ; 1476 : _Nm); // smaller hole, move tail up
- ; 1477 : size_type _Num;
- ; 1478 : if ((0 < _Count || 0 < _N0)
- ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
- ; 1480 : { // make room and rearrange
- ; 1481 : if (_N0 < _Count)
- ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
- ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
- ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
- ; 1485 : _Eos(_Num);
- ; 1486 : }
- ; 1487 : return (*this);
- ; 1488 : }
- ; 1489 :
- ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1491 : const _Myt& _Right)
- ; 1492 : { // replace [_First, _Last) with _Right
- ; 1493 : return (replace(
- ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
- ; 1495 : }
- ; 1496 :
- ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1498 : const _Elem *_Ptr, size_type _Count)
- ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
- ; 1500 : return (replace(
- ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
- ; 1502 : }
- ; 1503 :
- ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1505 : const _Elem *_Ptr)
- ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
- ; 1507 : return (replace(
- ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
- ; 1509 : }
- ; 1510 :
- ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1512 : size_type _Count, _Elem _Ch)
- ; 1513 : { // replace [_First, _Last) with _Count * _Ch
- ; 1514 : return (replace(
- ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
- ; 1516 : }
- ; 1517 :
- ; 1518 : template<class _Iter>
- ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
- ; 1520 : _Myt&>::type
- ; 1521 : replace(const_iterator _First, const_iterator _Last,
- ; 1522 : _Iter _First2, _Iter _Last2)
- ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
- ; 1524 : _Myt _Right(_First2, _Last2);
- ; 1525 : replace(_First, _Last, _Right);
- ; 1526 : return (*this);
- ; 1527 : }
- ; 1528 :
- ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1530 : const_pointer _First2, const_pointer _Last2)
- ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1532 : if (_First2 == _Last2)
- ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1534 : else
- ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1536 : &*_First2, _Last2 - _First2);
- ; 1537 : return (*this);
- ; 1538 : }
- ; 1539 :
- ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1541 : pointer _First2, pointer _Last2)
- ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
- ; 1543 : if (_First2 == _Last2)
- ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1545 : else
- ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1547 : &*_First2, _Last2 - _First2);
- ; 1548 : return (*this);
- ; 1549 : }
- ; 1550 :
- ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1552 : const_iterator _First2, const_iterator _Last2)
- ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1554 : if (_First2 == _Last2)
- ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1556 : else
- ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1558 : &*_First2, _Last2 - _First2);
- ; 1559 : return (*this);
- ; 1560 : }
- ; 1561 :
- ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
- ; 1563 : iterator _First2, iterator _Last2)
- ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
- ; 1565 : if (_First2 == _Last2)
- ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
- ; 1567 : else
- ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
- ; 1569 : &*_First2, _Last2 - _First2);
- ; 1570 : return (*this);
- ; 1571 : }
- ; 1572 :
- ; 1573 : iterator begin() _NOEXCEPT
- ; 1574 : { // return iterator for beginning of mutable sequence
- ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
- ; 1576 : }
- ; 1577 :
- ; 1578 : const_iterator begin() const _NOEXCEPT
- ; 1579 : { // return iterator for beginning of nonmutable sequence
- ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
- ; 1581 : }
- ; 1582 :
- ; 1583 : iterator end() _NOEXCEPT
- ; 1584 : { // return iterator for end of mutable sequence
- ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1586 : }
- ; 1587 :
- ; 1588 : const_iterator end() const _NOEXCEPT
- ; 1589 : { // return iterator for end of nonmutable sequence
- ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
- ; 1591 : }
- ; 1592 :
- ; 1593 : reverse_iterator rbegin() _NOEXCEPT
- ; 1594 : { // return iterator for beginning of reversed mutable sequence
- ; 1595 : return (reverse_iterator(end()));
- ; 1596 : }
- ; 1597 :
- ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
- ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1600 : return (const_reverse_iterator(end()));
- ; 1601 : }
- ; 1602 :
- ; 1603 : reverse_iterator rend() _NOEXCEPT
- ; 1604 : { // return iterator for end of reversed mutable sequence
- ; 1605 : return (reverse_iterator(begin()));
- ; 1606 : }
- ; 1607 :
- ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
- ; 1609 : { // return iterator for end of reversed nonmutable sequence
- ; 1610 : return (const_reverse_iterator(begin()));
- ; 1611 : }
- ; 1612 :
- ; 1613 : #if _HAS_CPP0X
- ; 1614 : const_iterator cbegin() const _NOEXCEPT
- ; 1615 : { // return iterator for beginning of nonmutable sequence
- ; 1616 : return (((const _Myt *)this)->begin());
- ; 1617 : }
- ; 1618 :
- ; 1619 : const_iterator cend() const _NOEXCEPT
- ; 1620 : { // return iterator for end of nonmutable sequence
- ; 1621 : return (((const _Myt *)this)->end());
- ; 1622 : }
- ; 1623 :
- ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
- ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
- ; 1626 : return (((const _Myt *)this)->rbegin());
- ; 1627 : }
- ; 1628 :
- ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
- ; 1630 : { // return iterator for end of reversed nonmutable sequence
- ; 1631 : return (((const _Myt *)this)->rend());
- ; 1632 : }
- ; 1633 :
- ; 1634 : void shrink_to_fit()
- ; 1635 : { // reduce capacity
- ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
- ; 1637 : { // worth shrinking, do it
- ; 1638 : _Myt _Tmp(*this);
- ; 1639 : swap(_Tmp);
- ; 1640 : }
- ; 1641 : }
- ; 1642 : #endif /* _HAS_CPP0X */
- ; 1643 :
- ; 1644 : reference at(size_type _Off)
- ; 1645 : { // subscript mutable sequence with checking
- ; 1646 : if (this->_Mysize <= _Off)
- ; 1647 : _Xran(); // _Off off end
- ; 1648 : return (this->_Myptr()[_Off]);
- ; 1649 : }
- ; 1650 :
- ; 1651 : const_reference at(size_type _Off) const
- ; 1652 : { // subscript nonmutable sequence with checking
- ; 1653 : if (this->_Mysize <= _Off)
- ; 1654 : _Xran(); // _Off off end
- ; 1655 : return (this->_Myptr()[_Off]);
- ; 1656 : }
- ; 1657 :
- ; 1658 : reference operator[](size_type _Off)
- ; 1659 : { // subscript mutable sequence
- ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1661 : if (this->_Mysize < _Off) // sic
- ; 1662 : _DEBUG_ERROR("string subscript out of range");
- ; 1663 :
- ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1667 :
- ; 1668 : return (this->_Myptr()[_Off]);
- ; 1669 : }
- ; 1670 :
- ; 1671 : const_reference operator[](size_type _Off) const
- ; 1672 : { // subscript nonmutable sequence
- ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 1674 : if (this->_Mysize < _Off) // sic
- ; 1675 : _DEBUG_ERROR("string subscript out of range");
- ; 1676 :
- ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
- ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
- ; 1680 :
- ; 1681 : return (this->_Myptr()[_Off]);
- ; 1682 : }
- ; 1683 :
- ; 1684 : void push_back(_Elem _Ch)
- ; 1685 : { // insert element at end
- ; 1686 : insert(end(), _Ch);
- ; 1687 : }
- ; 1688 :
- ; 1689 : #if _HAS_CPP0X
- ; 1690 : void pop_back()
- ; 1691 : { // erase element at end
- ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
- ; 1693 : }
- ; 1694 :
- ; 1695 : reference front()
- ; 1696 : { // return first element of mutable sequence
- ; 1697 : return (*begin());
- ; 1698 : }
- ; 1699 :
- ; 1700 : const_reference front() const
- ; 1701 : { // return first element of nonmutable sequence
- ; 1702 : return (*begin());
- ; 1703 : }
- ; 1704 :
- ; 1705 : reference back()
- ; 1706 : { // return last element of mutable sequence
- ; 1707 : return (*(end() - 1));
- ; 1708 : }
- ; 1709 :
- ; 1710 : const_reference back() const
- ; 1711 : { // return last element of nonmutable sequence
- ; 1712 : return (*(end() - 1));
- ; 1713 : }
- ; 1714 : #endif /* _HAS_CPP0X */
- ; 1715 :
- ; 1716 : const _Elem *c_str() const _NOEXCEPT
- ; 1717 : { // return pointer to null-terminated nonmutable array
- ; 1718 : return (this->_Myptr());
- ; 1719 : }
- ; 1720 :
- ; 1721 : const _Elem *data() const _NOEXCEPT
- ; 1722 : { // return pointer to nonmutable array
- ; 1723 : return (c_str());
- ; 1724 : }
- ; 1725 :
- ; 1726 : size_type length() const _NOEXCEPT
- ; 1727 : { // return length of sequence
- ; 1728 : return (this->_Mysize);
- ; 1729 : }
- ; 1730 :
- ; 1731 : size_type size() const _NOEXCEPT
- ; 1732 : { // return length of sequence
- ; 1733 : return (this->_Mysize);
- ; 1734 : }
- ; 1735 :
- ; 1736 : size_type max_size() const _NOEXCEPT
- ; 1737 : { // return maximum possible length of sequence
- ; 1738 : size_type _Num = this->_Getal().max_size();
- ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
- mov edi, -2 ; fffffffeH
- $LN47@Copy:
- ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
- lea ecx, DWORD PTR [edi+1]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; 23 : void *_Ptr = 0;
- xor eax, eax
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 2195 : _TRY_BEGIN
- mov DWORD PTR __$EHRec$[ebp+12], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; 23 : void *_Ptr = 0;
- mov DWORD PTR __Ptr$1$[ebp], eax
- ; 24 :
- ; 25 : if (_Count == 0)
- test ecx, ecx
- je SHORT $LN19@Copy
- ; 26 : ;
- ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
- ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
- cmp ecx, -1
- ja SHORT $LN62@Copy
- push ecx
- call DWORD PTR __imp_??2@YAPAXI@Z
- add esp, 4
- mov DWORD PTR __Ptr$1$[ebp], eax
- test eax, eax
- jne SHORT $LN19@Copy
- $LN62@Copy:
- ; 29 : _Xbad_alloc(); // report no memory
- call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
- $LN174@Copy:
- __catch$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z$0:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
- mov eax, DWORD PTR __Newsize$[ebp]
- mov DWORD PTR __Newres$[ebp], eax
- ; 2199 : _TRY_BEGIN
- ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
- inc eax
- mov DWORD PTR __$EHRec$[ebp], esp
- push eax
- mov BYTE PTR __$EHRec$[ebp+12], 2
- call ?allocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEPADI@Z ; std::_Wrap_alloc<std::allocator<char> >::allocate
- mov DWORD PTR __Ptr$[ebp], eax
- ; 2204 : _CATCH_END
- ; 2205 : _CATCH_END
- mov eax, $LN171@Copy
- ret 0
- $LN171@Copy:
- mov eax, DWORD PTR __Ptr$[ebp]
- mov esi, DWORD PTR _this$[ebp]
- mov edi, DWORD PTR __Newres$[ebp]
- mov DWORD PTR __Ptr$1$[ebp], eax
- $LN19@Copy:
- ; 2206 :
- ; 2207 : if (0 < _Oldlen)
- mov ebx, DWORD PTR __Oldlen$[ebp]
- test ebx, ebx
- je SHORT $LN112@Copy
- ; 517 : : this->_Bx._Buf);
- cmp DWORD PTR [esi+20], 16 ; 00000010H
- jb SHORT $LN105@Copy
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov ecx, DWORD PTR [esi]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 517 : : this->_Bx._Buf);
- jmp SHORT $LN106@Copy
- __catch$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z$1:
- ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
- mov esi, DWORD PTR _this$[ebp]
- cmp DWORD PTR [esi+20], 16 ; 00000010H
- jb SHORT $LN91@Copy
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; 586 : ::operator delete(_Ptr);
- push DWORD PTR [esi]
- call DWORD PTR __imp_??3@YAXPAX@Z
- add esp, 4
- $LN91@Copy:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 2203 : _RERAISE;
- push 0
- ; 2257 : { // copy any leftovers to small buffer and deallocate
- ; 2258 : pointer _Ptr = this->_Bx._Ptr;
- ; 2259 : this->_Getal().destroy(&this->_Bx._Ptr);
- ; 2260 : if (0 < _Newsize)
- ; 2261 : _Traits::copy(this->_Bx._Buf,
- ; 2262 : _STD addressof(*_Ptr), _Newsize);
- ; 2263 : this->_Getal().deallocate(_Ptr, this->_Myres + 1);
- ; 2264 : }
- ; 2265 : this->_Myres = this->_BUF_SIZE - 1;
- mov DWORD PTR [esi+20], 15 ; 0000000fH
- ; 2215 :
- ; 2216 : void _Eos(size_type _Newsize)
- ; 2217 : { // set new length and null terminator
- ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
- mov DWORD PTR [esi+16], 0
- ; 2203 : _RERAISE;
- push 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [esi], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 2203 : _RERAISE;
- call __CxxThrowException@8
- $LN175@Copy:
- $LN105@Copy:
- ; 517 : : this->_Bx._Buf);
- mov ecx, esi
- $LN106@Copy:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 530 : : (_Elem *)_CSTD memcpy(_First1, _First2, _Count));
- test ebx, ebx
- je SHORT $LN112@Copy
- push ebx
- push ecx
- push eax
- call _memcpy
- add esp, 12 ; 0000000cH
- $LN112@Copy:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
- cmp DWORD PTR [esi+20], 16 ; 00000010H
- jb SHORT $LN131@Copy
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; 586 : ::operator delete(_Ptr);
- push DWORD PTR [esi]
- call DWORD PTR __imp_??3@YAXPAX@Z
- add esp, 4
- $LN131@Copy:
- ; 617 : _VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
- mov eax, DWORD PTR __Ptr$1$[ebp]
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [esi], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; 617 : _VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
- mov DWORD PTR [esi], eax
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 2212 : this->_Myres = _Newres;
- mov DWORD PTR [esi+20], edi
- ; 2215 :
- ; 2216 : void _Eos(size_type _Newsize)
- ; 2217 : { // set new length and null terminator
- ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
- mov DWORD PTR [esi+16], ebx
- ; 517 : : this->_Bx._Buf);
- cmp edi, 16 ; 00000010H
- jb SHORT $LN166@Copy
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov esi, eax
- $LN166@Copy:
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
- ; 564 : _Left = _Right;
- mov BYTE PTR [esi+ebx], 0
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
- ; 2214 : }
- mov ecx, DWORD PTR __$EHRec$[ebp+4]
- mov DWORD PTR fs:0, ecx
- pop ecx
- pop edi
- pop esi
- pop ebx
- mov esp, ebp
- pop ebp
- ret 8
- $LN173@Copy:
- _TEXT ENDS
- ; COMDAT text$x
- text$x SEGMENT
- __ehhandler$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z:
- mov edx, DWORD PTR [esp+8]
- lea eax, DWORD PTR [edx+12]
- mov ecx, DWORD PTR [edx-28]
- xor ecx, eax
- call @__security_check_cookie@4
- mov eax, OFFSET __ehfuncinfo$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z
- jmp ___CxxFrameHandler3
- text$x ENDS
- ?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z ENDP ; std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ
- _TEXT SEGMENT
- ?capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ PROC ; std::vector<double,std::allocator<double> >::capacity, COMDAT
- ; _this$ = ecx
- ; 967 : return (this->_Myend - this->_Myfirst);
- mov eax, DWORD PTR [ecx+8]
- sub eax, DWORD PTR [ecx]
- sar eax, 3
- ; 968 : }
- ret 0
- ?capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ ENDP ; std::vector<double,std::allocator<double> >::capacity
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?allocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEPANI@Z
- _TEXT SEGMENT
- __Count$ = 8 ; size = 4
- ?allocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEPANI@Z PROC ; std::_Wrap_alloc<std::allocator<double> >::allocate, COMDAT
- ; _this$dead$ = ecx
- ; 875 : { // allocate array of _Count elements
- push ebp
- mov ebp, esp
- ; 25 : if (_Count == 0)
- mov eax, DWORD PTR __Count$[ebp]
- xor ecx, ecx
- test eax, eax
- je SHORT $LN6@allocate
- ; 26 : ;
- ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
- ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
- cmp eax, 536870911 ; 1fffffffH
- ja SHORT $LN5@allocate
- shl eax, 3
- push eax
- call DWORD PTR __imp_??2@YAPAXI@Z
- mov ecx, eax
- add esp, 4
- test ecx, ecx
- jne SHORT $LN6@allocate
- $LN5@allocate:
- ; 29 : _Xbad_alloc(); // report no memory
- call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
- $LN15@allocate:
- $LN6@allocate:
- ; 876 : return (_Mybase::allocate(_Count));
- mov eax, ecx
- ; 877 : }
- pop ebp
- ret 4
- $LN14@allocate:
- ?allocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEPANI@Z ENDP ; std::_Wrap_alloc<std::allocator<double> >::allocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?max_size@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QBEIXZ
- _TEXT SEGMENT
- ?max_size@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QBEIXZ PROC ; std::_Wrap_alloc<std::allocator<double> >::max_size, COMDAT
- ; _this$dead$ = ecx
- ; 914 : return (_Mytraits::max_size(*this));
- mov eax, 536870911 ; 1fffffffH
- ; 915 : }
- ret 0
- ?max_size@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QBEIXZ ENDP ; std::_Wrap_alloc<std::allocator<double> >::max_size
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ??0?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAE@PANPBU_Container_base0@1@@Z
- _TEXT SEGMENT
- __Parg$ = 8 ; size = 4
- __Pvector$dead$ = 12 ; size = 4
- ??0?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAE@PANPBU_Container_base0@1@@Z PROC ; std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >, COMDAT
- ; _this$ = ecx
- ; 47 : { // construct with pointer _Parg
- push ebp
- mov ebp, esp
- mov eax, DWORD PTR __Parg$[ebp]
- mov DWORD PTR [ecx], eax
- ; 48 : this->_Adopt(_Pvector);
- ; 49 : }
- mov eax, ecx
- pop ebp
- ret 8
- ??0?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAE@PANPBU_Container_base0@1@@Z ENDP ; std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ??Y?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAEAAV01@H@Z
- _TEXT SEGMENT
- __Off$ = 8 ; size = 4
- ??Y?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAEAAV01@H@Z PROC ; std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >::operator+=, COMDAT
- ; _this$ = ecx
- ; 153 : { // increment by integer
- push ebp
- mov ebp, esp
- ; 154 : #if _ITERATOR_DEBUG_LEVEL == 2
- ; 155 : if (this->_Getcont() == 0
- ; 156 : || this->_Ptr + _Off < ((_Myvec *)this->_Getcont())->_Myfirst
- ; 157 : || ((_Myvec *)this->_Getcont())->_Mylast < this->_Ptr + _Off)
- ; 158 : { // report error
- ; 159 : _DEBUG_ERROR("vector iterator + offset out of range");
- ; 160 : _SCL_SECURE_OUT_OF_RANGE;
- ; 161 : }
- ; 162 :
- ; 163 : #elif _ITERATOR_DEBUG_LEVEL == 1
- ; 164 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
- ; 165 : _SCL_SECURE_VALIDATE_RANGE(
- ; 166 : ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr + _Off
- ; 167 : && this->_Ptr + _Off <= ((_Myvec *)this->_Getcont())->_Mylast);
- ; 168 : #endif /* _ITERATOR_DEBUG_LEVEL */
- ; 169 :
- ; 170 : _Ptr += _Off;
- mov eax, DWORD PTR __Off$[ebp]
- shl eax, 3
- add DWORD PTR [ecx], eax
- ; 171 : return (*this);
- mov eax, ecx
- ; 172 : }
- pop ebp
- ret 4
- ??Y?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAEAAV01@H@Z ENDP ; std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >::operator+=
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ?_Compat@?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBEXABV12@@Z
- _TEXT SEGMENT
- ___formal$dead$ = 8 ; size = 4
- ?_Compat@?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBEXABV12@@Z PROC ; std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >::_Compat, COMDAT
- ; _this$dead$ = ecx
- ; 255 : }
- ret 4
- ?_Compat@?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBEXABV12@@Z ENDP ; std::_Vector_const_iterator<std::_Vector_val<std::_Simple_types<double> > >::_Compat
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?allocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEPADI@Z
- _TEXT SEGMENT
- __Count$ = 8 ; size = 4
- ?allocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEPADI@Z PROC ; std::_Wrap_alloc<std::allocator<char> >::allocate, COMDAT
- ; _this$dead$ = ecx
- ; 875 : { // allocate array of _Count elements
- push ebp
- mov ebp, esp
- ; 25 : if (_Count == 0)
- mov eax, DWORD PTR __Count$[ebp]
- xor ecx, ecx
- test eax, eax
- je SHORT $LN6@allocate
- ; 26 : ;
- ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
- ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
- cmp eax, -1
- ja SHORT $LN5@allocate
- push eax
- call DWORD PTR __imp_??2@YAPAXI@Z
- mov ecx, eax
- add esp, 4
- test ecx, ecx
- jne SHORT $LN6@allocate
- $LN5@allocate:
- ; 29 : _Xbad_alloc(); // report no memory
- call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
- $LN15@allocate:
- $LN6@allocate:
- ; 876 : return (_Mybase::allocate(_Count));
- mov eax, ecx
- ; 877 : }
- pop ebp
- ret 4
- $LN14@allocate:
- ?allocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEPADI@Z ENDP ; std::_Wrap_alloc<std::allocator<char> >::allocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?max_size@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QBEIXZ
- _TEXT SEGMENT
- ?max_size@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QBEIXZ PROC ; std::_Wrap_alloc<std::allocator<char> >::max_size, COMDAT
- ; _this$dead$ = ecx
- ; 914 : return (_Mytraits::max_size(*this));
- or eax, -1
- ; 915 : }
- ret 0
- ?max_size@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QBEIXZ ENDP ; std::_Wrap_alloc<std::allocator<char> >::max_size
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?allocate@?$allocator@N@std@@QAEPANI@Z
- _TEXT SEGMENT
- __Count$ = 8 ; size = 4
- ?allocate@?$allocator@N@std@@QAEPANI@Z PROC ; std::allocator<double>::allocate, COMDAT
- ; _this$dead$ = ecx
- ; 590 : { // allocate array of _Count elements
- push ebp
- mov ebp, esp
- ; 25 : if (_Count == 0)
- mov eax, DWORD PTR __Count$[ebp]
- xor ecx, ecx
- test eax, eax
- je SHORT $LN4@allocate
- ; 26 : ;
- ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
- ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
- cmp eax, 536870911 ; 1fffffffH
- ja SHORT $LN3@allocate
- shl eax, 3
- push eax
- call DWORD PTR __imp_??2@YAPAXI@Z
- mov ecx, eax
- add esp, 4
- test ecx, ecx
- jne SHORT $LN4@allocate
- $LN3@allocate:
- ; 29 : _Xbad_alloc(); // report no memory
- call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
- $LN12@allocate:
- $LN4@allocate:
- ; 591 : return (_Allocate(_Count, (pointer)0));
- mov eax, ecx
- ; 592 : }
- pop ebp
- ret 4
- $LN11@allocate:
- ?allocate@?$allocator@N@std@@QAEPANI@Z ENDP ; std::allocator<double>::allocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?max_size@?$allocator_traits@V?$allocator@N@std@@@std@@SAIABV?$allocator@N@2@@Z
- _TEXT SEGMENT
- ?max_size@?$allocator_traits@V?$allocator@N@std@@@std@@SAIABV?$allocator@N@2@@Z PROC ; std::allocator_traits<std::allocator<double> >::max_size, COMDAT
- ; __Al$dead$ = ecx
- ; 762 : return (_Al.max_size());
- mov eax, 536870911 ; 1fffffffH
- ; 763 : }
- ret 0
- ?max_size@?$allocator_traits@V?$allocator@N@std@@@std@@SAIABV?$allocator@N@2@@Z ENDP ; std::allocator_traits<std::allocator<double> >::max_size
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?allocate@?$allocator@D@std@@QAEPADI@Z
- _TEXT SEGMENT
- __Count$ = 8 ; size = 4
- ?allocate@?$allocator@D@std@@QAEPADI@Z PROC ; std::allocator<char>::allocate, COMDAT
- ; _this$dead$ = ecx
- ; 590 : { // allocate array of _Count elements
- push ebp
- mov ebp, esp
- ; 25 : if (_Count == 0)
- mov eax, DWORD PTR __Count$[ebp]
- xor ecx, ecx
- test eax, eax
- je SHORT $LN4@allocate
- ; 26 : ;
- ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
- ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
- cmp eax, -1
- ja SHORT $LN3@allocate
- push eax
- call DWORD PTR __imp_??2@YAPAXI@Z
- mov ecx, eax
- add esp, 4
- test ecx, ecx
- jne SHORT $LN4@allocate
- $LN3@allocate:
- ; 29 : _Xbad_alloc(); // report no memory
- call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
- $LN12@allocate:
- $LN4@allocate:
- ; 591 : return (_Allocate(_Count, (pointer)0));
- mov eax, ecx
- ; 592 : }
- pop ebp
- ret 4
- $LN11@allocate:
- ?allocate@?$allocator@D@std@@QAEPADI@Z ENDP ; std::allocator<char>::allocate
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?max_size@?$allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z
- _TEXT SEGMENT
- ?max_size@?$allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z PROC ; std::allocator_traits<std::allocator<char> >::max_size, COMDAT
- ; __Al$dead$ = ecx
- ; 762 : return (_Al.max_size());
- or eax, -1
- ; 763 : }
- ret 0
- ?max_size@?$allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z ENDP ; std::allocator_traits<std::allocator<char> >::max_size
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?max_size@?$allocator@N@std@@QBEIXZ
- _TEXT SEGMENT
- ?max_size@?$allocator@N@std@@QBEIXZ PROC ; std::allocator<double>::max_size, COMDAT
- ; _this$dead$ = ecx
- ; 628 : return ((size_t)(-1) / sizeof (_Ty));
- mov eax, 536870911 ; 1fffffffH
- ; 629 : }
- ret 0
- ?max_size@?$allocator@N@std@@QBEIXZ ENDP ; std::allocator<double>::max_size
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ?max_size@?$allocator@D@std@@QBEIXZ
- _TEXT SEGMENT
- ?max_size@?$allocator@D@std@@QBEIXZ PROC ; std::allocator<char>::max_size, COMDAT
- ; _this$dead$ = ecx
- ; 628 : return ((size_t)(-1) / sizeof (_Ty));
- or eax, -1
- ; 629 : }
- ret 0
- ?max_size@?$allocator@D@std@@QBEIXZ ENDP ; std::allocator<char>::max_size
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??__E?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A@@YAXXZ
- text$yc SEGMENT
- ??__E?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A@@YAXXZ PROC ; `dynamic initializer for 'std::_Error_objects<int>::_Generic_object'', COMDAT
- ; 627 : { // estimate maximum array size
- push OFFSET ??__F?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A@@YAXXZ ; `dynamic atexit destructor for 'std::_Error_objects<int>::_Generic_object''
- call _atexit
- pop ecx
- ret 0
- ??__E?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A@@YAXXZ ENDP ; `dynamic initializer for 'std::_Error_objects<int>::_Generic_object''
- text$yc ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??__E?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A@@YAXXZ
- text$yc SEGMENT
- ??__E?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A@@YAXXZ PROC ; `dynamic initializer for 'std::_Error_objects<int>::_Iostream_object'', COMDAT
- ; 627 : { // estimate maximum array size
- push OFFSET ??__F?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A@@YAXXZ ; `dynamic atexit destructor for 'std::_Error_objects<int>::_Iostream_object''
- call _atexit
- pop ecx
- ret 0
- ??__E?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A@@YAXXZ ENDP ; `dynamic initializer for 'std::_Error_objects<int>::_Iostream_object''
- text$yc ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??__E?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A@@YAXXZ
- text$yc SEGMENT
- ??__E?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A@@YAXXZ PROC ; `dynamic initializer for 'std::_Error_objects<int>::_System_object'', COMDAT
- ; 627 : { // estimate maximum array size
- push OFFSET ??__F?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A@@YAXXZ ; `dynamic atexit destructor for 'std::_Error_objects<int>::_System_object''
- call _atexit
- pop ecx
- ret 0
- ??__E?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A@@YAXXZ ENDP ; `dynamic initializer for 'std::_Error_objects<int>::_System_object''
- text$yc ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$construct@PADAAPAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPADAAPAD@Z
- _TEXT SEGMENT
- __Ptr$ = 8 ; size = 4
- __V0$ = 12 ; size = 4
- ??$construct@PADAAPAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPADAAPAD@Z PROC ; std::_Wrap_alloc<std::allocator<char> >::construct<char *,char * &>, COMDAT
- ; _this$dead$ = ecx
- ; 903 : _VARIADIC_EXPAND_0X(_WRAP_ALLOC_CONSTRUCT, , , , )
- push ebp
- mov ebp, esp
- ; 617 : _VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
- mov ecx, DWORD PTR __Ptr$[ebp]
- test ecx, ecx
- je SHORT $LN11@construct
- mov eax, DWORD PTR __V0$[ebp]
- mov eax, DWORD PTR [eax]
- mov DWORD PTR [ecx], eax
- $LN11@construct:
- ; 903 : _VARIADIC_EXPAND_0X(_WRAP_ALLOC_CONSTRUCT, , , , )
- pop ebp
- ret 8
- ??$construct@PADAAPAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPADAAPAD@Z ENDP ; std::_Wrap_alloc<std::allocator<char> >::construct<char *,char * &>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$destroy@PAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPAD@Z
- _TEXT SEGMENT
- __Ptr$dead$ = 8 ; size = 4
- ??$destroy@PAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPAD@Z PROC ; std::_Wrap_alloc<std::allocator<char> >::destroy<char *>, COMDAT
- ; _this$dead$ = ecx
- ; 908 : { // destroy object at _Ptr
- ; 909 : _Mytraits::destroy(*this, _Ptr);
- ; 910 : }
- ret 4
- ??$destroy@PAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPAD@Z ENDP ; std::_Wrap_alloc<std::allocator<char> >::destroy<char *>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
- ; COMDAT ??$addressof@D@std@@YAPADAAD@Z
- _TEXT SEGMENT
- ??$addressof@D@std@@YAPADAAD@Z PROC ; std::addressof<char>, COMDAT
- ; __Val$ = ecx
- ; 86 : return (reinterpret_cast<_Ty *>(
- ; 87 : (&const_cast<char&>(
- ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
- mov eax, ecx
- ; 89 : }
- ret 0
- ??$addressof@D@std@@YAPADAAD@Z ENDP ; std::addressof<char>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; COMDAT ??$_Uninitialized_default_fill_n@PANIU?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPANIAAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z
- _TEXT SEGMENT
- __Al$dead$ = 8 ; size = 4
- ??$_Uninitialized_default_fill_n@PANIU?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPANIAAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z PROC ; std::_Uninitialized_default_fill_n<double *,unsigned int,std::_Wrap_alloc<std::allocator<double> > >, COMDAT
- ; __First$ = ecx
- ; __Count$ = edx
- ; 668 : { // copy _Count * _Val_type(_First)() to raw _First, using _Al
- push edi
- mov edi, ecx
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; 2678 : for (; 0 < _Count; --_Count, ++_Dest)
- test edx, edx
- je SHORT $LN11@Uninitiali
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; 660 : _Fill_n(_First, _Count, (_Valty)0);
- and edx, 536870911 ; 1fffffffH
- add edx, edx
- mov ecx, edx
- xor eax, eax
- rep stosd
- $LN11@Uninitiali:
- pop edi
- ; 669 : _Uninit_def_fill_n(_First, _Count, _Al,
- ; 670 : _Val_type(_First), _Ptr_cat(_First, _First));
- ; 671 : }
- ret 0
- ??$_Uninitialized_default_fill_n@PANIU?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPANIAAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z ENDP ; std::_Uninitialized_default_fill_n<double *,unsigned int,std::_Wrap_alloc<std::allocator<double> > >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@H@std@@@std@@@std@@YAXPAH0AAU?$_Wrap_alloc@V?$allocator@H@std@@@0@@Z
- _TEXT SEGMENT
- __Al$dead$ = 8 ; size = 4
- ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@H@std@@@std@@@std@@YAXPAH0AAU?$_Wrap_alloc@V?$allocator@H@std@@@0@@Z PROC ; std::_Destroy_range<std::_Wrap_alloc<std::allocator<int> > >, COMDAT
- ; __First$dead$ = ecx
- ; __Last$dead$ = edx
- ; 80 : _Destroy_range(_First, _Last, _Al, _Ptr_cat(_First, _Last));
- ; 81 : }
- ret 0
- ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@H@std@@@std@@@std@@YAXPAH0AAU?$_Wrap_alloc@V?$allocator@H@std@@@0@@Z ENDP ; std::_Destroy_range<std::_Wrap_alloc<std::allocator<int> > >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; COMDAT ??$_Move@PANPAN@std@@YAPANPAN00@Z
- _TEXT SEGMENT
- __Dest$ = 8 ; size = 4
- ??$_Move@PANPAN@std@@YAPANPAN00@Z PROC ; std::_Move<double *,double *>, COMDAT
- ; __First$ = ecx
- ; __Last$ = edx
- ; 2485 : { // move [_First, _Last) to [_Dest, ...), unchecked
- push ebp
- mov ebp, esp
- push esi
- ; 2476 : _CSTD memmove(&*_Dest, &*_First,
- ; 2477 : _Count * sizeof (*_First));
- mov esi, DWORD PTR __Dest$[ebp]
- sub edx, ecx
- push edi
- ; 2475 : ptrdiff_t _Count = _Last - _First;
- sar edx, 3
- ; 2476 : _CSTD memmove(&*_Dest, &*_First,
- ; 2477 : _Count * sizeof (*_First));
- lea edi, DWORD PTR [edx*8]
- push edi
- push ecx
- push esi
- call DWORD PTR __imp__memmove
- add esp, 12 ; 0000000cH
- ; 2478 : return (_Dest + _Count);
- lea eax, DWORD PTR [edi+esi]
- pop edi
- pop esi
- ; 2486 : return (_Move(_First, _Last,
- ; 2487 : _Dest, _Ptr_cat(_First, _Dest)));
- ; 2488 : }
- pop ebp
- ret 0
- ??$_Move@PANPAN@std@@YAPANPAN00@Z ENDP ; std::_Move<double *,double *>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPAN0AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z
- _TEXT SEGMENT
- __Al$dead$ = 8 ; size = 4
- ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPAN0AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z PROC ; std::_Destroy_range<std::_Wrap_alloc<std::allocator<double> > >, COMDAT
- ; __First$dead$ = ecx
- ; __Last$dead$ = edx
- ; 80 : _Destroy_range(_First, _Last, _Al, _Ptr_cat(_First, _Last));
- ; 81 : }
- ret 0
- ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPAN0AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z ENDP ; std::_Destroy_range<std::_Wrap_alloc<std::allocator<double> > >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; COMDAT ??$_Umove@PAN@?$vector@NV?$allocator@N@std@@@std@@IAEPANPAN00@Z
- _TEXT SEGMENT
- __First$ = 8 ; size = 4
- __Last$ = 12 ; size = 4
- __Ptr$ = 16 ; size = 4
- ??$_Umove@PAN@?$vector@NV?$allocator@N@std@@@std@@IAEPANPAN00@Z PROC ; std::vector<double,std::allocator<double> >::_Umove<double *>, COMDAT
- ; _this$dead$ = ecx
- ; 1557 : pointer _Umove(_Iter _First, _Iter _Last, pointer _Ptr)
- push ebp
- mov ebp, esp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; 461 : size_t _Count = (size_t)(_Last - _First);
- mov ecx, DWORD PTR __First$[ebp]
- mov eax, DWORD PTR __Last$[ebp]
- sub eax, ecx
- push esi
- sar eax, 3
- ; 462 : return ((_Ty2 *)_CSTD memmove(&*_Dest, &*_First,
- ; 463 : _Count * sizeof (*_First)) + _Count); // NB: non-overlapping move
- lea esi, DWORD PTR [eax*8]
- push esi
- push ecx
- push DWORD PTR __Ptr$[ebp]
- call DWORD PTR __imp__memmove
- add esp, 12 ; 0000000cH
- add eax, esi
- pop esi
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
- ; 1562 : }
- pop ebp
- ret 12 ; 0000000cH
- ??$_Umove@PAN@?$vector@NV?$allocator@N@std@@@std@@IAEPANPAN00@Z ENDP ; std::vector<double,std::allocator<double> >::_Umove<double *>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$_Allocate@N@std@@YAPANIPAN@Z
- _TEXT SEGMENT
- ??$_Allocate@N@std@@YAPANIPAN@Z PROC ; std::_Allocate<double>, COMDAT
- ; __Count$ = ecx
- ; 23 : void *_Ptr = 0;
- ; 24 :
- ; 25 : if (_Count == 0)
- ; 26 : ;
- ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
- ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
- cmp ecx, 536870911 ; 1fffffffH
- ja SHORT $LN1@Allocate
- lea eax, DWORD PTR [ecx*8]
- push eax
- call DWORD PTR __imp_??2@YAPAXI@Z
- add esp, 4
- test eax, eax
- jne SHORT $LN7@Allocate
- $LN1@Allocate:
- ; 29 : _Xbad_alloc(); // report no memory
- jmp DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
- $LN7@Allocate:
- ; 30 :
- ; 31 : return ((_Ty *)_Ptr);
- ; 32 : }
- ret 0
- ??$_Allocate@N@std@@YAPANIPAN@Z ENDP ; std::_Allocate<double>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$_Allocate@D@std@@YAPADIPAD@Z
- _TEXT SEGMENT
- ??$_Allocate@D@std@@YAPADIPAD@Z PROC ; std::_Allocate<char>, COMDAT
- ; __Count$ = ecx
- ; 23 : void *_Ptr = 0;
- ; 24 :
- ; 25 : if (_Count == 0)
- ; 26 : ;
- ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
- ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
- cmp ecx, -1
- ja SHORT $LN1@Allocate
- push ecx
- call DWORD PTR __imp_??2@YAPAXI@Z
- add esp, 4
- test eax, eax
- jne SHORT $LN7@Allocate
- $LN1@Allocate:
- ; 29 : _Xbad_alloc(); // report no memory
- jmp DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
- $LN7@Allocate:
- ; 30 :
- ; 31 : return ((_Ty *)_Ptr);
- ; 32 : }
- ret 0
- ??$_Allocate@D@std@@YAPADIPAD@Z ENDP ; std::_Allocate<char>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\system_error
- ; COMDAT ??__F?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A@@YAXXZ
- text$yd SEGMENT
- ??__F?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A@@YAXXZ PROC ; `dynamic atexit destructor for 'std::_Error_objects<int>::_System_object'', COMDAT
- ; 167 : { // destroy the object
- mov DWORD PTR ?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A, OFFSET ??_7error_category@std@@6B@ ; std::_Error_objects<int>::_System_object
- ret 0
- ??__F?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A@@YAXXZ ENDP ; `dynamic atexit destructor for 'std::_Error_objects<int>::_System_object''
- text$yd ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\system_error
- ; COMDAT ??__F?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A@@YAXXZ
- text$yd SEGMENT
- ??__F?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A@@YAXXZ PROC ; `dynamic atexit destructor for 'std::_Error_objects<int>::_Iostream_object'', COMDAT
- ; 167 : { // destroy the object
- mov DWORD PTR ?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A, OFFSET ??_7error_category@std@@6B@ ; std::_Error_objects<int>::_Iostream_object
- ret 0
- ??__F?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A@@YAXXZ ENDP ; `dynamic atexit destructor for 'std::_Error_objects<int>::_Iostream_object''
- text$yd ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\system_error
- ; COMDAT ??__F?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A@@YAXXZ
- text$yd SEGMENT
- ??__F?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A@@YAXXZ PROC ; `dynamic atexit destructor for 'std::_Error_objects<int>::_Generic_object'', COMDAT
- ; 167 : { // destroy the object
- mov DWORD PTR ?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A, OFFSET ??_7error_category@std@@6B@ ; std::_Error_objects<int>::_Generic_object
- ret 0
- ??__F?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A@@YAXXZ ENDP ; `dynamic atexit destructor for 'std::_Error_objects<int>::_Generic_object''
- text$yd ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits
- ; COMDAT ??$forward@AAPAD@std@@YAAAPADAAPAD@Z
- _TEXT SEGMENT
- ??$forward@AAPAD@std@@YAAAPADAAPAD@Z PROC ; std::forward<char * &>, COMDAT
- ; __Arg$ = ecx
- ; 1776 : return (static_cast<_Ty&&>(_Arg));
- mov eax, ecx
- ; 1777 : }
- ret 0
- ??$forward@AAPAD@std@@YAAAPADAAPAD@Z ENDP ; std::forward<char * &>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$construct@PADAAPAD@?$allocator_traits@V?$allocator@D@std@@@std@@SAXAAV?$allocator@D@1@PAPADAAPAD@Z
- _TEXT SEGMENT
- __V0$ = 8 ; size = 4
- ??$construct@PADAAPAD@?$allocator_traits@V?$allocator@D@std@@@std@@SAXAAV?$allocator@D@1@PAPADAAPAD@Z PROC ; std::allocator_traits<std::allocator<char> >::construct<char *,char * &>, COMDAT
- ; __Al$dead$ = ecx
- ; __Ptr$ = edx
- ; 751 : _VARIADIC_EXPAND_0X(_ALLOC_TRAITS_SPECIAL_CONSTRUCT, , , , )
- push ebp
- mov ebp, esp
- ; 617 : _VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
- test edx, edx
- je SHORT $LN7@construct
- mov eax, DWORD PTR __V0$[ebp]
- mov eax, DWORD PTR [eax]
- mov DWORD PTR [edx], eax
- $LN7@construct:
- ; 751 : _VARIADIC_EXPAND_0X(_ALLOC_TRAITS_SPECIAL_CONSTRUCT, , , , )
- pop ebp
- ret 0
- ??$construct@PADAAPAD@?$allocator_traits@V?$allocator@D@std@@@std@@SAXAAV?$allocator@D@1@PAPADAAPAD@Z ENDP ; std::allocator_traits<std::allocator<char> >::construct<char *,char * &>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$destroy@PAD@?$allocator_traits@V?$allocator@D@std@@@std@@SAXAAV?$allocator@D@1@PAPAD@Z
- _TEXT SEGMENT
- ??$destroy@PAD@?$allocator_traits@V?$allocator@D@std@@@std@@SAXAAV?$allocator@D@1@PAPAD@Z PROC ; std::allocator_traits<std::allocator<char> >::destroy<char *>, COMDAT
- ; __Al$dead$ = ecx
- ; __Ptr$dead$ = edx
- ; 756 : { // destroy object at _Ptr
- ; 757 : _Al.destroy(_Ptr);
- ; 758 : }
- ret 0
- ??$destroy@PAD@?$allocator_traits@V?$allocator@D@std@@@std@@SAXAAV?$allocator@D@1@PAPAD@Z ENDP ; std::allocator_traits<std::allocator<char> >::destroy<char *>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; COMDAT ??$_Val_type@PAN@std@@YAPANPAN@Z
- _TEXT SEGMENT
- ??$_Val_type@PAN@std@@YAPANPAN@Z PROC ; std::_Val_type<double *>, COMDAT
- ; ___formal$dead$ = ecx
- ; 711 : return (0);
- xor eax, eax
- ; 712 : }
- ret 0
- ??$_Val_type@PAN@std@@YAPANPAN@Z ENDP ; std::_Val_type<double *>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; COMDAT ??$_Ptr_cat@NN@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAN0@Z
- _TEXT SEGMENT
- __Cat$ = -1 ; size = 1
- ??$_Ptr_cat@NN@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAN0@Z PROC ; std::_Ptr_cat<double,double>, COMDAT
- ; ___formal$dead$ = ecx
- ; ___formal$dead$ = edx
- ; 437 : { // return pointer category from pointers
- push ebp
- mov ebp, esp
- push ecx
- ; 438 : typename _Ptr_cat_helper<_Elem1, _Elem2>::type _Cat;
- ; 439 : return (_Cat);
- mov al, BYTE PTR __Cat$[ebp]
- ; 440 : }
- mov esp, ebp
- pop ebp
- ret 0
- ??$_Ptr_cat@NN@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAN0@Z ENDP ; std::_Ptr_cat<double,double>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; COMDAT ??$_Uninit_def_fill_n@NIN@std@@YAXPANIAAU?$_Wrap_alloc@V?$allocator@N@std@@@0@0U_Scalar_ptr_iterator_tag@0@@Z
- _TEXT SEGMENT
- ___formal$dead$ = 8 ; size = 4
- ___formal$dead$ = 12 ; size = 4
- ___formal$ = 16 ; size = 1
- ??$_Uninit_def_fill_n@NIN@std@@YAXPANIAAU?$_Wrap_alloc@V?$allocator@N@std@@@0@0U_Scalar_ptr_iterator_tag@0@@Z PROC ; std::_Uninit_def_fill_n<double,unsigned int,double>, COMDAT
- ; __First$ = ecx
- ; __Count$ = edx
- ; 659 : { // copy _Count * _Valty() to raw _First, using _Al, scalar type
- push edi
- mov edi, ecx
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; 2678 : for (; 0 < _Count; --_Count, ++_Dest)
- test edx, edx
- je SHORT $LN5@Uninit_def
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; 660 : _Fill_n(_First, _Count, (_Valty)0);
- and edx, 536870911 ; 1fffffffH
- add edx, edx
- mov ecx, edx
- xor eax, eax
- rep stosd
- $LN5@Uninit_def:
- pop edi
- ; 661 : }
- ret 0
- ??$_Uninit_def_fill_n@NIN@std@@YAXPANIAAU?$_Wrap_alloc@V?$allocator@N@std@@@0@0U_Scalar_ptr_iterator_tag@0@@Z ENDP ; std::_Uninit_def_fill_n<double,unsigned int,double>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; COMDAT ??$_Ptr_cat@HH@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAH0@Z
- _TEXT SEGMENT
- __Cat$ = -1 ; size = 1
- ??$_Ptr_cat@HH@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAH0@Z PROC ; std::_Ptr_cat<int,int>, COMDAT
- ; ___formal$dead$ = ecx
- ; ___formal$dead$ = edx
- ; 437 : { // return pointer category from pointers
- push ebp
- mov ebp, esp
- push ecx
- ; 438 : typename _Ptr_cat_helper<_Elem1, _Elem2>::type _Cat;
- ; 439 : return (_Cat);
- mov al, BYTE PTR __Cat$[ebp]
- ; 440 : }
- mov esp, ebp
- pop ebp
- ret 0
- ??$_Ptr_cat@HH@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAH0@Z ENDP ; std::_Ptr_cat<int,int>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@H@std@@@std@@@std@@YAXPAH0AAU?$_Wrap_alloc@V?$allocator@H@std@@@0@U_Scalar_ptr_iterator_tag@0@@Z
- _TEXT SEGMENT
- __Al$dead$ = 8 ; size = 4
- ___formal$ = 12 ; size = 1
- ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@H@std@@@std@@@std@@YAXPAH0AAU?$_Wrap_alloc@V?$allocator@H@std@@@0@U_Scalar_ptr_iterator_tag@0@@Z PROC ; std::_Destroy_range<std::_Wrap_alloc<std::allocator<int> > >, COMDAT
- ; __First$dead$ = ecx
- ; __Last$dead$ = edx
- ; 97 : }
- ret 0
- ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@H@std@@@std@@@std@@YAXPAH0AAU?$_Wrap_alloc@V?$allocator@H@std@@@0@U_Scalar_ptr_iterator_tag@0@@Z ENDP ; std::_Destroy_range<std::_Wrap_alloc<std::allocator<int> > >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; COMDAT ??$_Move@PANPAN@std@@YAPANPAN00U_Scalar_ptr_iterator_tag@0@@Z
- _TEXT SEGMENT
- __Dest$ = 8 ; size = 4
- ___formal$ = 12 ; size = 1
- ??$_Move@PANPAN@std@@YAPANPAN00U_Scalar_ptr_iterator_tag@0@@Z PROC ; std::_Move<double *,double *>, COMDAT
- ; __First$ = ecx
- ; __Last$ = edx
- ; 2474 : { // move [_First, _Last) to [_Dest, ...), pointers to scalars
- push ebp
- mov ebp, esp
- push esi
- ; 2475 : ptrdiff_t _Count = _Last - _First;
- ; 2476 : _CSTD memmove(&*_Dest, &*_First,
- ; 2477 : _Count * sizeof (*_First));
- mov esi, DWORD PTR __Dest$[ebp]
- sub edx, ecx
- push edi
- sar edx, 3
- lea edi, DWORD PTR [edx*8]
- push edi
- push ecx
- push esi
- call DWORD PTR __imp__memmove
- add esp, 12 ; 0000000cH
- ; 2478 : return (_Dest + _Count);
- lea eax, DWORD PTR [edi+esi]
- pop edi
- pop esi
- ; 2479 : }
- pop ebp
- ret 0
- ??$_Move@PANPAN@std@@YAPANPAN00U_Scalar_ptr_iterator_tag@0@@Z ENDP ; std::_Move<double *,double *>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPAN0AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@U_Scalar_ptr_iterator_tag@0@@Z
- _TEXT SEGMENT
- __Al$dead$ = 8 ; size = 4
- ___formal$ = 12 ; size = 1
- ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPAN0AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@U_Scalar_ptr_iterator_tag@0@@Z PROC ; std::_Destroy_range<std::_Wrap_alloc<std::allocator<double> > >, COMDAT
- ; __First$dead$ = ecx
- ; __Last$dead$ = edx
- ; 97 : }
- ret 0
- ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPAN0AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@U_Scalar_ptr_iterator_tag@0@@Z ENDP ; std::_Destroy_range<std::_Wrap_alloc<std::allocator<double> > >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; COMDAT ??$_Uninitialized_move@PANPANU?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAPANPAN00AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z
- _TEXT SEGMENT
- __Dest$ = 8 ; size = 4
- __Al$dead$ = 12 ; size = 4
- ??$_Uninitialized_move@PANPANU?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAPANPAN00AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z PROC ; std::_Uninitialized_move<double *,double *,std::_Wrap_alloc<std::allocator<double> > >, COMDAT
- ; __First$ = ecx
- ; __Last$ = edx
- ; 471 : { // move [_First, _Last) to raw _Dest, using _Al
- push ebp
- mov ebp, esp
- ; 461 : size_t _Count = (size_t)(_Last - _First);
- sub edx, ecx
- push esi
- sar edx, 3
- ; 462 : return ((_Ty2 *)_CSTD memmove(&*_Dest, &*_First,
- ; 463 : _Count * sizeof (*_First)) + _Count); // NB: non-overlapping move
- lea esi, DWORD PTR [edx*8]
- push esi
- push ecx
- push DWORD PTR __Dest$[ebp]
- call DWORD PTR __imp__memmove
- add esp, 12 ; 0000000cH
- add eax, esi
- pop esi
- ; 472 : return (_Uninit_move(_First, _Last, _Dest, _Al,
- ; 473 : _Val_type(_First), _Ptr_cat(_First, _Dest)));
- ; 474 : }
- pop ebp
- ret 0
- ??$_Uninitialized_move@PANPANU?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAPANPAN00AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z ENDP ; std::_Uninitialized_move<double *,double *,std::_Wrap_alloc<std::allocator<double> > >
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$construct@PADAAPAD@?$allocator@D@std@@QAEXPAPADAAPAD@Z
- _TEXT SEGMENT
- __Ptr$ = 8 ; size = 4
- __V0$ = 12 ; size = 4
- ??$construct@PADAAPAD@?$allocator@D@std@@QAEXPAPADAAPAD@Z PROC ; std::allocator<char>::construct<char *,char * &>, COMDAT
- ; _this$dead$ = ecx
- ; 617 : _VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
- push ebp
- mov ebp, esp
- mov ecx, DWORD PTR __Ptr$[ebp]
- test ecx, ecx
- je SHORT $LN3@construct
- mov eax, DWORD PTR __V0$[ebp]
- mov eax, DWORD PTR [eax]
- mov DWORD PTR [ecx], eax
- $LN3@construct:
- pop ebp
- ret 8
- ??$construct@PADAAPAD@?$allocator@D@std@@QAEXPAPADAAPAD@Z ENDP ; std::allocator<char>::construct<char *,char * &>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
- ; COMDAT ??$destroy@PAD@?$allocator@D@std@@QAEXPAPAD@Z
- _TEXT SEGMENT
- __Ptr$dead$ = 8 ; size = 4
- ??$destroy@PAD@?$allocator@D@std@@QAEXPAPAD@Z PROC ; std::allocator<char>::destroy<char *>, COMDAT
- ; _this$dead$ = ecx
- ; 622 : { // destroy object at _Ptr
- ; 623 : _Ptr->~_Uty();
- ; 624 : }
- ret 4
- ??$destroy@PAD@?$allocator@D@std@@QAEXPAPAD@Z ENDP ; std::allocator<char>::destroy<char *>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
- ; COMDAT ??$_Fill_n@PANIN@std@@YAPANPANIABN@Z
- _TEXT SEGMENT
- __Val$ = 8 ; size = 4
- ??$_Fill_n@PANIN@std@@YAPANPANIABN@Z PROC ; std::_Fill_n<double *,unsigned int,double>, COMDAT
- ; __Dest$ = ecx
- ; __Count$ = edx
- ; 2677 : { // copy _Val _Count times through [_Dest, ...)
- push ebp
- mov ebp, esp
- ; 2678 : for (; 0 < _Count; --_Count, ++_Dest)
- test edx, edx
- je SHORT $LN9@Fill_n
- mov eax, DWORD PTR __Val$[ebp]
- npad 6
- $LL3@Fill_n:
- ; 2679 : *_Dest = _Val;
- movsd xmm0, QWORD PTR [eax]
- movsd QWORD PTR [ecx], xmm0
- add ecx, 8
- dec edx
- jne SHORT $LL3@Fill_n
- $LN9@Fill_n:
- ; 2680 : return (_Dest);
- mov eax, ecx
- ; 2681 : }
- pop ebp
- ret 0
- ??$_Fill_n@PANIN@std@@YAPANPANIABN@Z ENDP ; std::_Fill_n<double *,unsigned int,double>
- _TEXT ENDS
- ; Function compile flags: /Ogtp
- ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
- ; COMDAT ??$_Uninit_move@NNN@std@@YAPANPAN00AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@0U_Scalar_ptr_iterator_tag@0@@Z
- _TEXT SEGMENT
- __Dest$ = 8 ; size = 4
- ___formal$dead$ = 12 ; size = 4
- ___formal$dead$ = 16 ; size = 4
- ___formal$ = 20 ; size = 1
- ??$_Uninit_move@NNN@std@@YAPANPAN00AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@0U_Scalar_ptr_iterator_tag@0@@Z PROC ; std::_Uninit_move<double,double,double>, COMDAT
- ; __First$ = ecx
- ; __Last$ = edx
- ; 458 : { // move [_First, _Last) to raw _Dest, scalar type
- push ebp
- mov ebp, esp
- ; 459 : _DEBUG_RANGE(_First, _Last);
- ; 460 : _DEBUG_POINTER(_Dest);
- ; 461 : size_t _Count = (size_t)(_Last - _First);
- sub edx, ecx
- push esi
- sar edx, 3
- ; 462 : return ((_Ty2 *)_CSTD memmove(&*_Dest, &*_First,
- ; 463 : _Count * sizeof (*_First)) + _Count); // NB: non-overlapping move
- lea esi, DWORD PTR [edx*8]
- push esi
- push ecx
- push DWORD PTR __Dest$[ebp]
- call DWORD PTR __imp__memmove
- add esp, 12 ; 0000000cH
- add eax, esi
- pop esi
- ; 464 : }
- pop ebp
- ret 0
- ??$_Uninit_move@NNN@std@@YAPANPAN00AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@0U_Scalar_ptr_iterator_tag@0@@Z ENDP ; std::_Uninit_move<double,double,double>
- _TEXT ENDS
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement