Advertisement
Guest User

asm_file_part_2

a guest
Dec 17th, 2012
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 471.25 KB | None | 0 0
  1.  
  2. mov DWORD PTR [esi+16], edi
  3.  
  4. ; 517 : : this->_Bx._Buf);
  5.  
  6. jb SHORT $LN108@assign
  7. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  8.  
  9. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  10.  
  11. mov eax, DWORD PTR [esi]
  12. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  13.  
  14. ; 564 : _Left = _Right;
  15.  
  16. mov BYTE PTR [eax+edi], 0
  17. pop edi
  18. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  19.  
  20. ; 1138 : return (*this);
  21.  
  22. mov eax, esi
  23. pop esi
  24. pop ebx
  25.  
  26. ; 1139 : }
  27.  
  28. pop ebp
  29. ret 8
  30. $LN108@assign:
  31.  
  32. ; 517 : : this->_Bx._Buf);
  33.  
  34. mov eax, esi
  35. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  36.  
  37. ; 564 : _Left = _Right;
  38.  
  39. mov BYTE PTR [eax+edi], 0
  40. $LN112@assign:
  41. pop edi
  42. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  43.  
  44. ; 1138 : return (*this);
  45.  
  46. mov eax, esi
  47. pop esi
  48. pop ebx
  49.  
  50. ; 1139 : }
  51.  
  52. pop ebp
  53. ret 8
  54. $LN118@assign:
  55. ?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
  56. _TEXT ENDS
  57. ; Function compile flags: /Ogtp
  58. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  59. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  60. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  61. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  62. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  63. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  64. ; COMDAT ?_Eos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXI@Z
  65. _TEXT SEGMENT
  66. __Newsize$ = 8 ; size = 4
  67. ?_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
  68. ; _this$ = ecx
  69.  
  70. ; 2217 : { // set new length and null terminator
  71.  
  72. push ebp
  73. mov ebp, esp
  74.  
  75. ; 517 : : this->_Bx._Buf);
  76.  
  77. cmp DWORD PTR [ecx+20], 16 ; 00000010H
  78.  
  79. ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
  80.  
  81. mov edx, DWORD PTR __Newsize$[ebp]
  82. mov DWORD PTR [ecx+16], edx
  83.  
  84. ; 517 : : this->_Bx._Buf);
  85.  
  86. jb SHORT $LN5@Eos
  87. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  88.  
  89. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  90.  
  91. mov eax, DWORD PTR [ecx]
  92. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  93.  
  94. ; 564 : _Left = _Right;
  95.  
  96. mov BYTE PTR [eax+edx], 0
  97. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  98.  
  99. ; 2219 : }
  100.  
  101. pop ebp
  102. ret 4
  103. $LN5@Eos:
  104. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  105.  
  106. ; 564 : _Left = _Right;
  107.  
  108. mov BYTE PTR [ecx+edx], 0
  109. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  110.  
  111. ; 2219 : }
  112.  
  113. pop ebp
  114. ret 4
  115. ?_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
  116. _TEXT ENDS
  117. ; Function compile flags: /Ogtp
  118. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  119. ; COMDAT ?_Xran@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ
  120. _TEXT SEGMENT
  121. ?_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
  122. ; _this$dead$ = ecx
  123.  
  124. ; 2276 : _Xout_of_range("invalid string position");
  125.  
  126. push OFFSET ??_C@_0BI@CFPLBAOH@invalid?5string?5position?$AA@
  127. call DWORD PTR __imp_?_Xout_of_range@std@@YAXPBD@Z
  128. $LN4@Xran:
  129. $LN3@Xran:
  130. int 3
  131. ?_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
  132. _TEXT ENDS
  133. ; Function compile flags: /Ogtp
  134. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  135. ; COMDAT ??0?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAE@XZ
  136. _TEXT SEGMENT
  137. ??0?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAE@XZ PROC ; std::_Wrap_alloc<std::allocator<char> >::_Wrap_alloc<std::allocator<char> >, COMDAT
  138. ; _this$ = ecx
  139.  
  140. ; 831 : }
  141.  
  142. mov eax, ecx
  143. ret 0
  144. ??0?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAE@XZ ENDP ; std::_Wrap_alloc<std::allocator<char> >::_Wrap_alloc<std::allocator<char> >
  145. _TEXT ENDS
  146. ; Function compile flags: /Ogtp
  147. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  148. ; COMDAT ?deallocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPADI@Z
  149. _TEXT SEGMENT
  150. __Ptr$ = 8 ; size = 4
  151. __Count$dead$ = 12 ; size = 4
  152. ?deallocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPADI@Z PROC ; std::_Wrap_alloc<std::allocator<char> >::deallocate, COMDAT
  153. ; _this$dead$ = ecx
  154.  
  155. ; 886 : { // deallocate object at _Ptr, ignore size
  156.  
  157. push ebp
  158. mov ebp, esp
  159.  
  160. ; 586 : ::operator delete(_Ptr);
  161.  
  162. push DWORD PTR __Ptr$[ebp]
  163. call DWORD PTR __imp_??3@YAXPAX@Z
  164. add esp, 4
  165.  
  166. ; 887 : _Mybase::deallocate(_Ptr, _Count);
  167. ; 888 : }
  168.  
  169. pop ebp
  170. ret 8
  171. ?deallocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPADI@Z ENDP ; std::_Wrap_alloc<std::allocator<char> >::deallocate
  172. _TEXT ENDS
  173. ; Function compile flags: /Ogtp
  174. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  175. ; COMDAT ??0?$_String_val@U?$_Simple_types@D@std@@@std@@QAE@XZ
  176. _TEXT SEGMENT
  177. ??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
  178. ; _this$ = ecx
  179.  
  180. ; 497 : { // initialize values
  181. ; 498 : _Mysize = 0;
  182.  
  183. mov DWORD PTR [ecx+16], 0
  184.  
  185. ; 499 : _Myres = 0;
  186.  
  187. mov DWORD PTR [ecx+20], 0
  188.  
  189. ; 500 : }
  190.  
  191. mov eax, ecx
  192. ret 0
  193. ??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> >
  194. _TEXT ENDS
  195. ; Function compile flags: /Ogtp
  196. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  197. ; COMDAT ?_Destroy@?$vector@HV?$allocator@H@std@@@std@@IAEXPAH0@Z
  198. _TEXT SEGMENT
  199. __First$dead$ = 8 ; size = 4
  200. __Last$dead$ = 12 ; size = 4
  201. ?_Destroy@?$vector@HV?$allocator@H@std@@@std@@IAEXPAH0@Z PROC ; std::vector<int,std::allocator<int> >::_Destroy, COMDAT
  202. ; _this$dead$ = ecx
  203.  
  204. ; 1479 : _Alty _Alval(this->_Getal());
  205. ; 1480 : _Destroy_range(_First, _Last, _Alval);
  206. ; 1481 : }
  207.  
  208. ret 8
  209. ?_Destroy@?$vector@HV?$allocator@H@std@@@std@@IAEXPAH0@Z ENDP ; std::vector<int,std::allocator<int> >::_Destroy
  210. _TEXT ENDS
  211. ; Function compile flags: /Ogtp
  212. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  213. ; 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
  214. _TEXT SEGMENT
  215. ___$ReturnUdt$ = 8 ; size = 4
  216. ?_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
  217. ; _this$dead$ = ecx
  218.  
  219. ; 646 : { // get reference to allocator
  220.  
  221. push ebp
  222. mov ebp, esp
  223.  
  224. ; 647 : return (_Alty());
  225.  
  226. mov eax, DWORD PTR ___$ReturnUdt$[ebp]
  227.  
  228. ; 648 : }
  229.  
  230. pop ebp
  231. ret 4
  232. ?_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
  233. _TEXT ENDS
  234. ; Function compile flags: /Ogtp
  235. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  236. ; COMDAT ?deallocate@?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAEXPAHI@Z
  237. _TEXT SEGMENT
  238. __Ptr$ = 8 ; size = 4
  239. __Count$dead$ = 12 ; size = 4
  240. ?deallocate@?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAEXPAHI@Z PROC ; std::_Wrap_alloc<std::allocator<int> >::deallocate, COMDAT
  241. ; _this$dead$ = ecx
  242.  
  243. ; 886 : { // deallocate object at _Ptr, ignore size
  244.  
  245. push ebp
  246. mov ebp, esp
  247.  
  248. ; 586 : ::operator delete(_Ptr);
  249.  
  250. push DWORD PTR __Ptr$[ebp]
  251. call DWORD PTR __imp_??3@YAXPAX@Z
  252. add esp, 4
  253.  
  254. ; 887 : _Mybase::deallocate(_Ptr, _Count);
  255. ; 888 : }
  256.  
  257. pop ebp
  258. ret 8
  259. ?deallocate@?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAEXPAHI@Z ENDP ; std::_Wrap_alloc<std::allocator<int> >::deallocate
  260. _TEXT ENDS
  261. ; Function compile flags: /Ogtp
  262. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  263. ; COMDAT ??0?$_Vector_val@U?$_Simple_types@H@std@@@std@@QAE@XZ
  264. _TEXT SEGMENT
  265. ??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
  266. ; _this$ = ecx
  267.  
  268. ; 485 : { // initialize values
  269. ; 486 : _Myfirst = pointer();
  270.  
  271. mov DWORD PTR [ecx], 0
  272.  
  273. ; 487 : _Mylast = pointer();
  274.  
  275. mov DWORD PTR [ecx+4], 0
  276.  
  277. ; 488 : _Myend = pointer();
  278.  
  279. mov DWORD PTR [ecx+8], 0
  280.  
  281. ; 489 : }
  282.  
  283. mov eax, ecx
  284. ret 0
  285. ??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> >
  286. _TEXT ENDS
  287. ; Function compile flags: /Ogtp
  288. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  289. ; COMDAT ?begin@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@XZ
  290. _TEXT SEGMENT
  291. ___$ReturnUdt$ = 8 ; size = 4
  292. ?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
  293. ; _this$ = ecx
  294.  
  295. ; 981 : { // return iterator for beginning of mutable sequence
  296.  
  297. push ebp
  298. mov ebp, esp
  299.  
  300. ; 47 : { // construct with pointer _Parg
  301.  
  302. mov eax, DWORD PTR ___$ReturnUdt$[ebp]
  303. mov ecx, DWORD PTR [ecx]
  304. mov DWORD PTR [eax], ecx
  305.  
  306. ; 982 : return (iterator(this->_Myfirst, this));
  307. ; 983 : }
  308.  
  309. pop ebp
  310. ret 4
  311. ?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
  312. _TEXT ENDS
  313. ; Function compile flags: /Ogtp
  314. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  315. ; COMDAT ?end@?$vector@NV?$allocator@N@std@@@std@@QAE?AV?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@2@XZ
  316. _TEXT SEGMENT
  317. ___$ReturnUdt$ = 8 ; size = 4
  318. ?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
  319. ; _this$ = ecx
  320.  
  321. ; 991 : { // return iterator for end of mutable sequence
  322.  
  323. push ebp
  324. mov ebp, esp
  325.  
  326. ; 47 : { // construct with pointer _Parg
  327.  
  328. mov eax, DWORD PTR ___$ReturnUdt$[ebp]
  329. mov ecx, DWORD PTR [ecx+4]
  330. mov DWORD PTR [eax], ecx
  331.  
  332. ; 992 : return (iterator(this->_Mylast, this));
  333. ; 993 : }
  334.  
  335. pop ebp
  336. ret 4
  337. ?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
  338. _TEXT ENDS
  339. ; Function compile flags: /Ogtp
  340. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  341. ; COMDAT ?size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ
  342. _TEXT SEGMENT
  343. ?size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ PROC ; std::vector<double,std::allocator<double> >::size, COMDAT
  344. ; _this$ = ecx
  345.  
  346. ; 1087 : return (this->_Mylast - this->_Myfirst);
  347.  
  348. mov eax, DWORD PTR [ecx+4]
  349. sub eax, DWORD PTR [ecx]
  350. sar eax, 3
  351.  
  352. ; 1088 : }
  353.  
  354. ret 0
  355. ?size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ ENDP ; std::vector<double,std::allocator<double> >::size
  356. _TEXT ENDS
  357. ; Function compile flags: /Ogtp
  358. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  359. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  360. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  361. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  362. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  363. ; 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
  364. _TEXT SEGMENT
  365. ___$ReturnUdt$ = 8 ; size = 4
  366. __First_arg$ = 12 ; size = 4
  367. __Last_arg$ = 16 ; size = 4
  368. ?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
  369. ; _this$ = ecx
  370.  
  371. ; 1381 : { // erase [_First, _Last)
  372.  
  373. push ebp
  374. mov ebp, esp
  375.  
  376. ; 1382 : if (_First_arg == begin() && _Last_arg == end())
  377.  
  378. mov eax, DWORD PTR __Last_arg$[ebp]
  379. push ebx
  380. mov ebx, ecx
  381. push edi
  382.  
  383. ; 48 : this->_Adopt(_Pvector);
  384. ; 49 : }
  385. ; 50 :
  386. ; 51 : typedef pointer _Unchecked_type;
  387. ; 52 :
  388. ; 53 : _Myiter& _Rechecked(_Unchecked_type _Right)
  389. ; 54 : { // reset from unchecked iterator
  390. ; 55 : this->_Ptr = (_Tptr)_Right;
  391. ; 56 : return (*this);
  392. ; 57 : }
  393. ; 58 :
  394. ; 59 : _Unchecked_type _Unchecked() const
  395. ; 60 : { // make an unchecked iterator
  396. ; 61 : return (_Unchecked_type(this->_Ptr));
  397. ; 62 : }
  398. ; 63 :
  399. ; 64 : reference operator*() const
  400. ; 65 : { // return designated object
  401. ; 66 : #if _ITERATOR_DEBUG_LEVEL == 2
  402. ; 67 : if (this->_Getcont() == 0
  403. ; 68 : || this->_Ptr == 0
  404. ; 69 : || this->_Ptr < ((_Myvec *)this->_Getcont())->_Myfirst
  405. ; 70 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
  406. ; 71 : { // report error
  407. ; 72 : _DEBUG_ERROR("vector iterator not dereferencable");
  408. ; 73 : _SCL_SECURE_OUT_OF_RANGE;
  409. ; 74 : }
  410. ; 75 :
  411. ; 76 : #elif _ITERATOR_DEBUG_LEVEL == 1
  412. ; 77 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  413. ; 78 : _SCL_SECURE_VALIDATE_RANGE(
  414. ; 79 : this->_Ptr != _Tptr()
  415. ; 80 : && ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr
  416. ; 81 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
  417. ; 82 : #endif /* _ITERATOR_DEBUG_LEVEL */
  418. ; 83 :
  419. ; 84 : _Analysis_assume_(this->_Ptr != _Tptr());
  420. ; 85 :
  421. ; 86 : return (*this->_Ptr);
  422. ; 87 : }
  423. ; 88 :
  424. ; 89 : pointer operator->() const
  425. ; 90 : { // return pointer to class object
  426. ; 91 : return (_STD pointer_traits<pointer>::pointer_to(**this));
  427. ; 92 : }
  428. ; 93 :
  429. ; 94 : _Myiter& operator++()
  430. ; 95 : { // preincrement
  431. ; 96 : #if _ITERATOR_DEBUG_LEVEL == 2
  432. ; 97 : if (this->_Getcont() == 0
  433. ; 98 : || this->_Ptr == 0
  434. ; 99 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
  435. ; 100 : { // report error
  436. ; 101 : _DEBUG_ERROR("vector iterator not incrementable");
  437. ; 102 : _SCL_SECURE_OUT_OF_RANGE;
  438. ; 103 : }
  439. ; 104 :
  440. ; 105 : #elif _ITERATOR_DEBUG_LEVEL == 1
  441. ; 106 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  442. ; 107 : _SCL_SECURE_VALIDATE_RANGE(
  443. ; 108 : this->_Ptr != _Tptr()
  444. ; 109 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
  445. ; 110 : #endif /* _ITERATOR_DEBUG_LEVEL */
  446. ; 111 :
  447. ; 112 : ++this->_Ptr;
  448. ; 113 : return (*this);
  449. ; 114 : }
  450. ; 115 :
  451. ; 116 : _Myiter operator++(int)
  452. ; 117 : { // postincrement
  453. ; 118 : _Myiter _Tmp = *this;
  454. ; 119 : ++*this;
  455. ; 120 : return (_Tmp);
  456. ; 121 : }
  457. ; 122 :
  458. ; 123 : _Myiter& operator--()
  459. ; 124 : { // predecrement
  460. ; 125 : #if _ITERATOR_DEBUG_LEVEL == 2
  461. ; 126 : if (this->_Getcont() == 0
  462. ; 127 : || this->_Ptr == 0
  463. ; 128 : || this->_Ptr <= ((_Myvec *)this->_Getcont())->_Myfirst)
  464. ; 129 : { // report error
  465. ; 130 : _DEBUG_ERROR("vector iterator not decrementable");
  466. ; 131 : _SCL_SECURE_OUT_OF_RANGE;
  467. ; 132 : }
  468. ; 133 :
  469. ; 134 : #elif _ITERATOR_DEBUG_LEVEL == 1
  470. ; 135 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  471. ; 136 : _SCL_SECURE_VALIDATE_RANGE(
  472. ; 137 : this->_Ptr != _Tptr()
  473. ; 138 : && ((_Myvec *)this->_Getcont())->_Myfirst < this->_Ptr);
  474. ; 139 : #endif /* _ITERATOR_DEBUG_LEVEL */
  475. ; 140 :
  476. ; 141 : --this->_Ptr;
  477. ; 142 : return (*this);
  478. ; 143 : }
  479. ; 144 :
  480. ; 145 : _Myiter operator--(int)
  481. ; 146 : { // postdecrement
  482. ; 147 : _Myiter _Tmp = *this;
  483. ; 148 : --*this;
  484. ; 149 : return (_Tmp);
  485. ; 150 : }
  486. ; 151 :
  487. ; 152 : _Myiter& operator+=(difference_type _Off)
  488. ; 153 : { // increment by integer
  489. ; 154 : #if _ITERATOR_DEBUG_LEVEL == 2
  490. ; 155 : if (this->_Getcont() == 0
  491. ; 156 : || this->_Ptr + _Off < ((_Myvec *)this->_Getcont())->_Myfirst
  492. ; 157 : || ((_Myvec *)this->_Getcont())->_Mylast < this->_Ptr + _Off)
  493. ; 158 : { // report error
  494. ; 159 : _DEBUG_ERROR("vector iterator + offset out of range");
  495. ; 160 : _SCL_SECURE_OUT_OF_RANGE;
  496. ; 161 : }
  497. ; 162 :
  498. ; 163 : #elif _ITERATOR_DEBUG_LEVEL == 1
  499. ; 164 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  500. ; 165 : _SCL_SECURE_VALIDATE_RANGE(
  501. ; 166 : ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr + _Off
  502. ; 167 : && this->_Ptr + _Off <= ((_Myvec *)this->_Getcont())->_Mylast);
  503. ; 168 : #endif /* _ITERATOR_DEBUG_LEVEL */
  504. ; 169 :
  505. ; 170 : _Ptr += _Off;
  506. ; 171 : return (*this);
  507. ; 172 : }
  508. ; 173 :
  509. ; 174 : _Myiter operator+(difference_type _Off) const
  510. ; 175 : { // return this + integer
  511. ; 176 : _Myiter _Tmp = *this;
  512. ; 177 : return (_Tmp += _Off);
  513. ; 178 : }
  514. ; 179 :
  515. ; 180 : _Myiter& operator-=(difference_type _Off)
  516. ; 181 : { // decrement by integer
  517. ; 182 : return (*this += -_Off);
  518. ; 183 : }
  519. ; 184 :
  520. ; 185 : _Myiter operator-(difference_type _Off) const
  521. ; 186 : { // return this - integer
  522. ; 187 : _Myiter _Tmp = *this;
  523. ; 188 : return (_Tmp -= _Off);
  524. ; 189 : }
  525. ; 190 :
  526. ; 191 : difference_type operator-(const _Myiter& _Right) const
  527. ; 192 : { // return difference of iterators
  528. ; 193 : _Compat(_Right);
  529. ; 194 : return (this->_Ptr - _Right._Ptr);
  530. ; 195 : }
  531. ; 196 :
  532. ; 197 : reference operator[](difference_type _Off) const
  533. ; 198 : { // subscript
  534. ; 199 : return (*(*this + _Off));
  535. ; 200 : }
  536. ; 201 :
  537. ; 202 : bool operator==(const _Myiter& _Right) const
  538. ; 203 : { // test for iterator equality
  539. ; 204 : _Compat(_Right);
  540. ; 205 : return (this->_Ptr == _Right._Ptr);
  541.  
  542. mov ecx, DWORD PTR [ebx]
  543. mov edi, DWORD PTR __First_arg$[ebp]
  544. cmp edi, ecx
  545.  
  546. ; 1382 : if (_First_arg == begin() && _Last_arg == end())
  547.  
  548. jne SHORT $LN4@erase
  549.  
  550. ; 48 : this->_Adopt(_Pvector);
  551. ; 49 : }
  552. ; 50 :
  553. ; 51 : typedef pointer _Unchecked_type;
  554. ; 52 :
  555. ; 53 : _Myiter& _Rechecked(_Unchecked_type _Right)
  556. ; 54 : { // reset from unchecked iterator
  557. ; 55 : this->_Ptr = (_Tptr)_Right;
  558. ; 56 : return (*this);
  559. ; 57 : }
  560. ; 58 :
  561. ; 59 : _Unchecked_type _Unchecked() const
  562. ; 60 : { // make an unchecked iterator
  563. ; 61 : return (_Unchecked_type(this->_Ptr));
  564. ; 62 : }
  565. ; 63 :
  566. ; 64 : reference operator*() const
  567. ; 65 : { // return designated object
  568. ; 66 : #if _ITERATOR_DEBUG_LEVEL == 2
  569. ; 67 : if (this->_Getcont() == 0
  570. ; 68 : || this->_Ptr == 0
  571. ; 69 : || this->_Ptr < ((_Myvec *)this->_Getcont())->_Myfirst
  572. ; 70 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
  573. ; 71 : { // report error
  574. ; 72 : _DEBUG_ERROR("vector iterator not dereferencable");
  575. ; 73 : _SCL_SECURE_OUT_OF_RANGE;
  576. ; 74 : }
  577. ; 75 :
  578. ; 76 : #elif _ITERATOR_DEBUG_LEVEL == 1
  579. ; 77 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  580. ; 78 : _SCL_SECURE_VALIDATE_RANGE(
  581. ; 79 : this->_Ptr != _Tptr()
  582. ; 80 : && ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr
  583. ; 81 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
  584. ; 82 : #endif /* _ITERATOR_DEBUG_LEVEL */
  585. ; 83 :
  586. ; 84 : _Analysis_assume_(this->_Ptr != _Tptr());
  587. ; 85 :
  588. ; 86 : return (*this->_Ptr);
  589. ; 87 : }
  590. ; 88 :
  591. ; 89 : pointer operator->() const
  592. ; 90 : { // return pointer to class object
  593. ; 91 : return (_STD pointer_traits<pointer>::pointer_to(**this));
  594. ; 92 : }
  595. ; 93 :
  596. ; 94 : _Myiter& operator++()
  597. ; 95 : { // preincrement
  598. ; 96 : #if _ITERATOR_DEBUG_LEVEL == 2
  599. ; 97 : if (this->_Getcont() == 0
  600. ; 98 : || this->_Ptr == 0
  601. ; 99 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
  602. ; 100 : { // report error
  603. ; 101 : _DEBUG_ERROR("vector iterator not incrementable");
  604. ; 102 : _SCL_SECURE_OUT_OF_RANGE;
  605. ; 103 : }
  606. ; 104 :
  607. ; 105 : #elif _ITERATOR_DEBUG_LEVEL == 1
  608. ; 106 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  609. ; 107 : _SCL_SECURE_VALIDATE_RANGE(
  610. ; 108 : this->_Ptr != _Tptr()
  611. ; 109 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
  612. ; 110 : #endif /* _ITERATOR_DEBUG_LEVEL */
  613. ; 111 :
  614. ; 112 : ++this->_Ptr;
  615. ; 113 : return (*this);
  616. ; 114 : }
  617. ; 115 :
  618. ; 116 : _Myiter operator++(int)
  619. ; 117 : { // postincrement
  620. ; 118 : _Myiter _Tmp = *this;
  621. ; 119 : ++*this;
  622. ; 120 : return (_Tmp);
  623. ; 121 : }
  624. ; 122 :
  625. ; 123 : _Myiter& operator--()
  626. ; 124 : { // predecrement
  627. ; 125 : #if _ITERATOR_DEBUG_LEVEL == 2
  628. ; 126 : if (this->_Getcont() == 0
  629. ; 127 : || this->_Ptr == 0
  630. ; 128 : || this->_Ptr <= ((_Myvec *)this->_Getcont())->_Myfirst)
  631. ; 129 : { // report error
  632. ; 130 : _DEBUG_ERROR("vector iterator not decrementable");
  633. ; 131 : _SCL_SECURE_OUT_OF_RANGE;
  634. ; 132 : }
  635. ; 133 :
  636. ; 134 : #elif _ITERATOR_DEBUG_LEVEL == 1
  637. ; 135 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  638. ; 136 : _SCL_SECURE_VALIDATE_RANGE(
  639. ; 137 : this->_Ptr != _Tptr()
  640. ; 138 : && ((_Myvec *)this->_Getcont())->_Myfirst < this->_Ptr);
  641. ; 139 : #endif /* _ITERATOR_DEBUG_LEVEL */
  642. ; 140 :
  643. ; 141 : --this->_Ptr;
  644. ; 142 : return (*this);
  645. ; 143 : }
  646. ; 144 :
  647. ; 145 : _Myiter operator--(int)
  648. ; 146 : { // postdecrement
  649. ; 147 : _Myiter _Tmp = *this;
  650. ; 148 : --*this;
  651. ; 149 : return (_Tmp);
  652. ; 150 : }
  653. ; 151 :
  654. ; 152 : _Myiter& operator+=(difference_type _Off)
  655. ; 153 : { // increment by integer
  656. ; 154 : #if _ITERATOR_DEBUG_LEVEL == 2
  657. ; 155 : if (this->_Getcont() == 0
  658. ; 156 : || this->_Ptr + _Off < ((_Myvec *)this->_Getcont())->_Myfirst
  659. ; 157 : || ((_Myvec *)this->_Getcont())->_Mylast < this->_Ptr + _Off)
  660. ; 158 : { // report error
  661. ; 159 : _DEBUG_ERROR("vector iterator + offset out of range");
  662. ; 160 : _SCL_SECURE_OUT_OF_RANGE;
  663. ; 161 : }
  664. ; 162 :
  665. ; 163 : #elif _ITERATOR_DEBUG_LEVEL == 1
  666. ; 164 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  667. ; 165 : _SCL_SECURE_VALIDATE_RANGE(
  668. ; 166 : ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr + _Off
  669. ; 167 : && this->_Ptr + _Off <= ((_Myvec *)this->_Getcont())->_Mylast);
  670. ; 168 : #endif /* _ITERATOR_DEBUG_LEVEL */
  671. ; 169 :
  672. ; 170 : _Ptr += _Off;
  673. ; 171 : return (*this);
  674. ; 172 : }
  675. ; 173 :
  676. ; 174 : _Myiter operator+(difference_type _Off) const
  677. ; 175 : { // return this + integer
  678. ; 176 : _Myiter _Tmp = *this;
  679. ; 177 : return (_Tmp += _Off);
  680. ; 178 : }
  681. ; 179 :
  682. ; 180 : _Myiter& operator-=(difference_type _Off)
  683. ; 181 : { // decrement by integer
  684. ; 182 : return (*this += -_Off);
  685. ; 183 : }
  686. ; 184 :
  687. ; 185 : _Myiter operator-(difference_type _Off) const
  688. ; 186 : { // return this - integer
  689. ; 187 : _Myiter _Tmp = *this;
  690. ; 188 : return (_Tmp -= _Off);
  691. ; 189 : }
  692. ; 190 :
  693. ; 191 : difference_type operator-(const _Myiter& _Right) const
  694. ; 192 : { // return difference of iterators
  695. ; 193 : _Compat(_Right);
  696. ; 194 : return (this->_Ptr - _Right._Ptr);
  697. ; 195 : }
  698. ; 196 :
  699. ; 197 : reference operator[](difference_type _Off) const
  700. ; 198 : { // subscript
  701. ; 199 : return (*(*this + _Off));
  702. ; 200 : }
  703. ; 201 :
  704. ; 202 : bool operator==(const _Myiter& _Right) const
  705. ; 203 : { // test for iterator equality
  706. ; 204 : _Compat(_Right);
  707. ; 205 : return (this->_Ptr == _Right._Ptr);
  708.  
  709. cmp eax, DWORD PTR [ebx+4]
  710.  
  711. ; 1382 : if (_First_arg == begin() && _Last_arg == end())
  712.  
  713. jne SHORT $LN4@erase
  714.  
  715. ; 1411 :
  716. ; 1412 : void clear() _NOEXCEPT
  717. ; 1413 : { // erase all
  718. ; 1414 : this->_Orphan_all();
  719. ; 1415 : _Destroy(this->_Myfirst, this->_Mylast);
  720. ; 1416 : this->_Mylast = this->_Myfirst;
  721.  
  722. mov DWORD PTR [ebx+4], ecx
  723. $LN77@erase:
  724.  
  725. ; 47 : { // construct with pointer _Parg
  726.  
  727. mov eax, DWORD PTR ___$ReturnUdt$[ebp]
  728. mov DWORD PTR [eax], edi
  729. pop edi
  730. pop ebx
  731.  
  732. ; 1407 : }
  733. ; 1408 : }
  734. ; 1409 : return (_Make_iter(_First_arg));
  735. ; 1410 : }
  736.  
  737. pop ebp
  738. ret 12 ; 0000000cH
  739. $LN4@erase:
  740.  
  741. ; 48 : this->_Adopt(_Pvector);
  742. ; 49 : }
  743. ; 50 :
  744. ; 51 : typedef pointer _Unchecked_type;
  745. ; 52 :
  746. ; 53 : _Myiter& _Rechecked(_Unchecked_type _Right)
  747. ; 54 : { // reset from unchecked iterator
  748. ; 55 : this->_Ptr = (_Tptr)_Right;
  749. ; 56 : return (*this);
  750. ; 57 : }
  751. ; 58 :
  752. ; 59 : _Unchecked_type _Unchecked() const
  753. ; 60 : { // make an unchecked iterator
  754. ; 61 : return (_Unchecked_type(this->_Ptr));
  755. ; 62 : }
  756. ; 63 :
  757. ; 64 : reference operator*() const
  758. ; 65 : { // return designated object
  759. ; 66 : #if _ITERATOR_DEBUG_LEVEL == 2
  760. ; 67 : if (this->_Getcont() == 0
  761. ; 68 : || this->_Ptr == 0
  762. ; 69 : || this->_Ptr < ((_Myvec *)this->_Getcont())->_Myfirst
  763. ; 70 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
  764. ; 71 : { // report error
  765. ; 72 : _DEBUG_ERROR("vector iterator not dereferencable");
  766. ; 73 : _SCL_SECURE_OUT_OF_RANGE;
  767. ; 74 : }
  768. ; 75 :
  769. ; 76 : #elif _ITERATOR_DEBUG_LEVEL == 1
  770. ; 77 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  771. ; 78 : _SCL_SECURE_VALIDATE_RANGE(
  772. ; 79 : this->_Ptr != _Tptr()
  773. ; 80 : && ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr
  774. ; 81 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
  775. ; 82 : #endif /* _ITERATOR_DEBUG_LEVEL */
  776. ; 83 :
  777. ; 84 : _Analysis_assume_(this->_Ptr != _Tptr());
  778. ; 85 :
  779. ; 86 : return (*this->_Ptr);
  780. ; 87 : }
  781. ; 88 :
  782. ; 89 : pointer operator->() const
  783. ; 90 : { // return pointer to class object
  784. ; 91 : return (_STD pointer_traits<pointer>::pointer_to(**this));
  785. ; 92 : }
  786. ; 93 :
  787. ; 94 : _Myiter& operator++()
  788. ; 95 : { // preincrement
  789. ; 96 : #if _ITERATOR_DEBUG_LEVEL == 2
  790. ; 97 : if (this->_Getcont() == 0
  791. ; 98 : || this->_Ptr == 0
  792. ; 99 : || ((_Myvec *)this->_Getcont())->_Mylast <= this->_Ptr)
  793. ; 100 : { // report error
  794. ; 101 : _DEBUG_ERROR("vector iterator not incrementable");
  795. ; 102 : _SCL_SECURE_OUT_OF_RANGE;
  796. ; 103 : }
  797. ; 104 :
  798. ; 105 : #elif _ITERATOR_DEBUG_LEVEL == 1
  799. ; 106 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  800. ; 107 : _SCL_SECURE_VALIDATE_RANGE(
  801. ; 108 : this->_Ptr != _Tptr()
  802. ; 109 : && this->_Ptr < ((_Myvec *)this->_Getcont())->_Mylast);
  803. ; 110 : #endif /* _ITERATOR_DEBUG_LEVEL */
  804. ; 111 :
  805. ; 112 : ++this->_Ptr;
  806. ; 113 : return (*this);
  807. ; 114 : }
  808. ; 115 :
  809. ; 116 : _Myiter operator++(int)
  810. ; 117 : { // postincrement
  811. ; 118 : _Myiter _Tmp = *this;
  812. ; 119 : ++*this;
  813. ; 120 : return (_Tmp);
  814. ; 121 : }
  815. ; 122 :
  816. ; 123 : _Myiter& operator--()
  817. ; 124 : { // predecrement
  818. ; 125 : #if _ITERATOR_DEBUG_LEVEL == 2
  819. ; 126 : if (this->_Getcont() == 0
  820. ; 127 : || this->_Ptr == 0
  821. ; 128 : || this->_Ptr <= ((_Myvec *)this->_Getcont())->_Myfirst)
  822. ; 129 : { // report error
  823. ; 130 : _DEBUG_ERROR("vector iterator not decrementable");
  824. ; 131 : _SCL_SECURE_OUT_OF_RANGE;
  825. ; 132 : }
  826. ; 133 :
  827. ; 134 : #elif _ITERATOR_DEBUG_LEVEL == 1
  828. ; 135 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  829. ; 136 : _SCL_SECURE_VALIDATE_RANGE(
  830. ; 137 : this->_Ptr != _Tptr()
  831. ; 138 : && ((_Myvec *)this->_Getcont())->_Myfirst < this->_Ptr);
  832. ; 139 : #endif /* _ITERATOR_DEBUG_LEVEL */
  833. ; 140 :
  834. ; 141 : --this->_Ptr;
  835. ; 142 : return (*this);
  836. ; 143 : }
  837. ; 144 :
  838. ; 145 : _Myiter operator--(int)
  839. ; 146 : { // postdecrement
  840. ; 147 : _Myiter _Tmp = *this;
  841. ; 148 : --*this;
  842. ; 149 : return (_Tmp);
  843. ; 150 : }
  844. ; 151 :
  845. ; 152 : _Myiter& operator+=(difference_type _Off)
  846. ; 153 : { // increment by integer
  847. ; 154 : #if _ITERATOR_DEBUG_LEVEL == 2
  848. ; 155 : if (this->_Getcont() == 0
  849. ; 156 : || this->_Ptr + _Off < ((_Myvec *)this->_Getcont())->_Myfirst
  850. ; 157 : || ((_Myvec *)this->_Getcont())->_Mylast < this->_Ptr + _Off)
  851. ; 158 : { // report error
  852. ; 159 : _DEBUG_ERROR("vector iterator + offset out of range");
  853. ; 160 : _SCL_SECURE_OUT_OF_RANGE;
  854. ; 161 : }
  855. ; 162 :
  856. ; 163 : #elif _ITERATOR_DEBUG_LEVEL == 1
  857. ; 164 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  858. ; 165 : _SCL_SECURE_VALIDATE_RANGE(
  859. ; 166 : ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr + _Off
  860. ; 167 : && this->_Ptr + _Off <= ((_Myvec *)this->_Getcont())->_Mylast);
  861. ; 168 : #endif /* _ITERATOR_DEBUG_LEVEL */
  862. ; 169 :
  863. ; 170 : _Ptr += _Off;
  864. ; 171 : return (*this);
  865. ; 172 : }
  866. ; 173 :
  867. ; 174 : _Myiter operator+(difference_type _Off) const
  868. ; 175 : { // return this + integer
  869. ; 176 : _Myiter _Tmp = *this;
  870. ; 177 : return (_Tmp += _Off);
  871. ; 178 : }
  872. ; 179 :
  873. ; 180 : _Myiter& operator-=(difference_type _Off)
  874. ; 181 : { // decrement by integer
  875. ; 182 : return (*this += -_Off);
  876. ; 183 : }
  877. ; 184 :
  878. ; 185 : _Myiter operator-(difference_type _Off) const
  879. ; 186 : { // return this - integer
  880. ; 187 : _Myiter _Tmp = *this;
  881. ; 188 : return (_Tmp -= _Off);
  882. ; 189 : }
  883. ; 190 :
  884. ; 191 : difference_type operator-(const _Myiter& _Right) const
  885. ; 192 : { // return difference of iterators
  886. ; 193 : _Compat(_Right);
  887. ; 194 : return (this->_Ptr - _Right._Ptr);
  888. ; 195 : }
  889. ; 196 :
  890. ; 197 : reference operator[](difference_type _Off) const
  891. ; 198 : { // subscript
  892. ; 199 : return (*(*this + _Off));
  893. ; 200 : }
  894. ; 201 :
  895. ; 202 : bool operator==(const _Myiter& _Right) const
  896. ; 203 : { // test for iterator equality
  897. ; 204 : _Compat(_Right);
  898. ; 205 : return (this->_Ptr == _Right._Ptr);
  899.  
  900. cmp edi, eax
  901.  
  902. ; 1383 : clear();
  903. ; 1384 : else if (_First_arg != _Last_arg)
  904.  
  905. je SHORT $LN77@erase
  906. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  907.  
  908. ; 2475 : ptrdiff_t _Count = _Last - _First;
  909.  
  910. mov ecx, DWORD PTR [ebx+4]
  911. sub ecx, eax
  912. push esi
  913. sar ecx, 3
  914.  
  915. ; 2477 : _Count * sizeof (*_First));
  916.  
  917. lea esi, DWORD PTR [ecx*8]
  918. push esi
  919. push eax
  920. push edi
  921. call DWORD PTR __imp__memmove
  922. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  923.  
  924. ; 47 : { // construct with pointer _Parg
  925.  
  926. mov ecx, DWORD PTR __First_arg$[ebp]
  927. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  928.  
  929. ; 2477 : _Count * sizeof (*_First));
  930.  
  931. add esp, 12 ; 0000000cH
  932.  
  933. ; 2478 : return (_Dest + _Count);
  934.  
  935. lea eax, DWORD PTR [esi+edi]
  936. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  937.  
  938. ; 1406 : this->_Mylast = _Ptr;
  939.  
  940. mov DWORD PTR [ebx+4], eax
  941.  
  942. ; 47 : { // construct with pointer _Parg
  943.  
  944. mov eax, DWORD PTR ___$ReturnUdt$[ebp]
  945. pop esi
  946. pop edi
  947. mov DWORD PTR [eax], ecx
  948. pop ebx
  949.  
  950. ; 1407 : }
  951. ; 1408 : }
  952. ; 1409 : return (_Make_iter(_First_arg));
  953. ; 1410 : }
  954.  
  955. pop ebp
  956. ret 12 ; 0000000cH
  957. ?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
  958. _TEXT ENDS
  959. ; Function compile flags: /Ogtp
  960. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  961. ; COMDAT ?_Destroy@?$vector@NV?$allocator@N@std@@@std@@IAEXPAN0@Z
  962. _TEXT SEGMENT
  963. __First$dead$ = 8 ; size = 4
  964. __Last$dead$ = 12 ; size = 4
  965. ?_Destroy@?$vector@NV?$allocator@N@std@@@std@@IAEXPAN0@Z PROC ; std::vector<double,std::allocator<double> >::_Destroy, COMDAT
  966. ; _this$dead$ = ecx
  967.  
  968. ; 1479 : _Alty _Alval(this->_Getal());
  969. ; 1480 : _Destroy_range(_First, _Last, _Alval);
  970. ; 1481 : }
  971.  
  972. ret 8
  973. ?_Destroy@?$vector@NV?$allocator@N@std@@@std@@IAEXPAN0@Z ENDP ; std::vector<double,std::allocator<double> >::_Destroy
  974. _TEXT ENDS
  975. ; Function compile flags: /Ogtp
  976. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  977. ; COMDAT ?_Reserve@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z
  978. _TEXT SEGMENT
  979. __Count$ = 8 ; size = 4
  980. ?_Reserve@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z PROC ; std::vector<double,std::allocator<double> >::_Reserve, COMDAT
  981. ; _this$ = ecx
  982.  
  983. ; 1525 : { // ensure room for _Count new elements, grow exponentially
  984.  
  985. push ebp
  986. mov ebp, esp
  987.  
  988. ; 968 : }
  989. ; 969 :
  990. ; 970 : size_type _Unused_capacity() const _NOEXCEPT
  991. ; 971 : { // micro-optimization for capacity() - size()
  992. ; 972 : return (this->_Myend - this->_Mylast);
  993.  
  994. mov edx, DWORD PTR [ecx+8]
  995. push esi
  996. mov esi, DWORD PTR [ecx+4]
  997. mov eax, edx
  998. sub eax, esi
  999. push edi
  1000.  
  1001. ; 1526 : if (_Unused_capacity() < _Count)
  1002.  
  1003. mov edi, DWORD PTR __Count$[ebp]
  1004.  
  1005. ; 968 : }
  1006. ; 969 :
  1007. ; 970 : size_type _Unused_capacity() const _NOEXCEPT
  1008. ; 971 : { // micro-optimization for capacity() - size()
  1009. ; 972 : return (this->_Myend - this->_Mylast);
  1010.  
  1011. sar eax, 3
  1012.  
  1013. ; 1526 : if (_Unused_capacity() < _Count)
  1014.  
  1015. cmp eax, edi
  1016. jae SHORT $LN2@Reserve
  1017.  
  1018. ; 973 : }
  1019. ; 974 :
  1020. ; 975 : size_type _Has_unused_capacity() const _NOEXCEPT
  1021. ; 976 : { // micro-optimization for capacity() != size()
  1022. ; 977 : return (this->_Myend != this->_Mylast);
  1023. ; 978 : }
  1024. ; 979 :
  1025. ; 980 : iterator begin() _NOEXCEPT
  1026. ; 981 : { // return iterator for beginning of mutable sequence
  1027. ; 982 : return (iterator(this->_Myfirst, this));
  1028. ; 983 : }
  1029. ; 984 :
  1030. ; 985 : const_iterator begin() const _NOEXCEPT
  1031. ; 986 : { // return iterator for beginning of nonmutable sequence
  1032. ; 987 : return (const_iterator(this->_Myfirst, this));
  1033. ; 988 : }
  1034. ; 989 :
  1035. ; 990 : iterator end() _NOEXCEPT
  1036. ; 991 : { // return iterator for end of mutable sequence
  1037. ; 992 : return (iterator(this->_Mylast, this));
  1038. ; 993 : }
  1039. ; 994 :
  1040. ; 995 : const_iterator end() const _NOEXCEPT
  1041. ; 996 : { // return iterator for end of nonmutable sequence
  1042. ; 997 : return (const_iterator(this->_Mylast, this));
  1043. ; 998 : }
  1044. ; 999 :
  1045. ; 1000 : iterator _Make_iter(const_iterator _Where) const
  1046. ; 1001 : { // make iterator from const_iterator
  1047. ; 1002 : return (iterator(_Where._Ptr, this));
  1048. ; 1003 : }
  1049. ; 1004 :
  1050. ; 1005 : reverse_iterator rbegin() _NOEXCEPT
  1051. ; 1006 : { // return iterator for beginning of reversed mutable sequence
  1052. ; 1007 : return (reverse_iterator(end()));
  1053. ; 1008 : }
  1054. ; 1009 :
  1055. ; 1010 : const_reverse_iterator rbegin() const _NOEXCEPT
  1056. ; 1011 : { // return iterator for beginning of reversed nonmutable sequence
  1057. ; 1012 : return (const_reverse_iterator(end()));
  1058. ; 1013 : }
  1059. ; 1014 :
  1060. ; 1015 : reverse_iterator rend() _NOEXCEPT
  1061. ; 1016 : { // return iterator for end of reversed mutable sequence
  1062. ; 1017 : return (reverse_iterator(begin()));
  1063. ; 1018 : }
  1064. ; 1019 :
  1065. ; 1020 : const_reverse_iterator rend() const _NOEXCEPT
  1066. ; 1021 : { // return iterator for end of reversed nonmutable sequence
  1067. ; 1022 : return (const_reverse_iterator(begin()));
  1068. ; 1023 : }
  1069. ; 1024 :
  1070. ; 1025 : #if _HAS_CPP0X
  1071. ; 1026 : const_iterator cbegin() const _NOEXCEPT
  1072. ; 1027 : { // return iterator for beginning of nonmutable sequence
  1073. ; 1028 : return (((const _Myt *)this)->begin());
  1074. ; 1029 : }
  1075. ; 1030 :
  1076. ; 1031 : const_iterator cend() const _NOEXCEPT
  1077. ; 1032 : { // return iterator for end of nonmutable sequence
  1078. ; 1033 : return (((const _Myt *)this)->end());
  1079. ; 1034 : }
  1080. ; 1035 :
  1081. ; 1036 : const_reverse_iterator crbegin() const _NOEXCEPT
  1082. ; 1037 : { // return iterator for beginning of reversed nonmutable sequence
  1083. ; 1038 : return (((const _Myt *)this)->rbegin());
  1084. ; 1039 : }
  1085. ; 1040 :
  1086. ; 1041 : const_reverse_iterator crend() const _NOEXCEPT
  1087. ; 1042 : { // return iterator for end of reversed nonmutable sequence
  1088. ; 1043 : return (((const _Myt *)this)->rend());
  1089. ; 1044 : }
  1090. ; 1045 :
  1091. ; 1046 : void shrink_to_fit()
  1092. ; 1047 : { // reduce capacity
  1093. ; 1048 : if (_Has_unused_capacity())
  1094. ; 1049 : { // worth shrinking, do it
  1095. ; 1050 : if (empty())
  1096. ; 1051 : _Tidy();
  1097. ; 1052 : else
  1098. ; 1053 : _Reallocate(size());
  1099. ; 1054 : }
  1100. ; 1055 : }
  1101. ; 1056 : #endif /* _HAS_CPP0X */
  1102. ; 1057 :
  1103. ; 1058 : void resize(size_type _Newsize)
  1104. ; 1059 : { // determine new length, padding as needed
  1105. ; 1060 : if (_Newsize < size())
  1106. ; 1061 : erase(begin() + _Newsize, end());
  1107. ; 1062 : else if (size() < _Newsize)
  1108. ; 1063 : { // pad as needed
  1109. ; 1064 : _Alty _Alval(this->_Getal());
  1110. ; 1065 : _Reserve(_Newsize - size());
  1111. ; 1066 : _TRY_BEGIN
  1112. ; 1067 : _Uninitialized_default_fill_n(this->_Mylast, _Newsize - size(),
  1113. ; 1068 : _Alval);
  1114. ; 1069 : _CATCH_ALL
  1115. ; 1070 : _Tidy();
  1116. ; 1071 : _RERAISE;
  1117. ; 1072 : _CATCH_END
  1118. ; 1073 : this->_Mylast += _Newsize - size();
  1119. ; 1074 : }
  1120. ; 1075 : }
  1121. ; 1076 :
  1122. ; 1077 : void resize(size_type _Newsize, const value_type& _Val)
  1123. ; 1078 : { // determine new length, padding with _Val elements as needed
  1124. ; 1079 : if (_Newsize < size())
  1125. ; 1080 : erase(begin() + _Newsize, end());
  1126. ; 1081 : else if (size() < _Newsize)
  1127. ; 1082 : _Insert_n(end(), _Newsize - size(), _Val);
  1128. ; 1083 : }
  1129. ; 1084 :
  1130. ; 1085 : size_type size() const _NOEXCEPT
  1131. ; 1086 : { // return length of sequence
  1132. ; 1087 : return (this->_Mylast - this->_Myfirst);
  1133.  
  1134. sub esi, DWORD PTR [ecx]
  1135. push ebx
  1136.  
  1137. ; 1527 : { // need more room, try to get it
  1138. ; 1528 : if (max_size() - size() < _Count)
  1139.  
  1140. mov ebx, 536870911 ; 1fffffffH
  1141.  
  1142. ; 973 : }
  1143. ; 974 :
  1144. ; 975 : size_type _Has_unused_capacity() const _NOEXCEPT
  1145. ; 976 : { // micro-optimization for capacity() != size()
  1146. ; 977 : return (this->_Myend != this->_Mylast);
  1147. ; 978 : }
  1148. ; 979 :
  1149. ; 980 : iterator begin() _NOEXCEPT
  1150. ; 981 : { // return iterator for beginning of mutable sequence
  1151. ; 982 : return (iterator(this->_Myfirst, this));
  1152. ; 983 : }
  1153. ; 984 :
  1154. ; 985 : const_iterator begin() const _NOEXCEPT
  1155. ; 986 : { // return iterator for beginning of nonmutable sequence
  1156. ; 987 : return (const_iterator(this->_Myfirst, this));
  1157. ; 988 : }
  1158. ; 989 :
  1159. ; 990 : iterator end() _NOEXCEPT
  1160. ; 991 : { // return iterator for end of mutable sequence
  1161. ; 992 : return (iterator(this->_Mylast, this));
  1162. ; 993 : }
  1163. ; 994 :
  1164. ; 995 : const_iterator end() const _NOEXCEPT
  1165. ; 996 : { // return iterator for end of nonmutable sequence
  1166. ; 997 : return (const_iterator(this->_Mylast, this));
  1167. ; 998 : }
  1168. ; 999 :
  1169. ; 1000 : iterator _Make_iter(const_iterator _Where) const
  1170. ; 1001 : { // make iterator from const_iterator
  1171. ; 1002 : return (iterator(_Where._Ptr, this));
  1172. ; 1003 : }
  1173. ; 1004 :
  1174. ; 1005 : reverse_iterator rbegin() _NOEXCEPT
  1175. ; 1006 : { // return iterator for beginning of reversed mutable sequence
  1176. ; 1007 : return (reverse_iterator(end()));
  1177. ; 1008 : }
  1178. ; 1009 :
  1179. ; 1010 : const_reverse_iterator rbegin() const _NOEXCEPT
  1180. ; 1011 : { // return iterator for beginning of reversed nonmutable sequence
  1181. ; 1012 : return (const_reverse_iterator(end()));
  1182. ; 1013 : }
  1183. ; 1014 :
  1184. ; 1015 : reverse_iterator rend() _NOEXCEPT
  1185. ; 1016 : { // return iterator for end of reversed mutable sequence
  1186. ; 1017 : return (reverse_iterator(begin()));
  1187. ; 1018 : }
  1188. ; 1019 :
  1189. ; 1020 : const_reverse_iterator rend() const _NOEXCEPT
  1190. ; 1021 : { // return iterator for end of reversed nonmutable sequence
  1191. ; 1022 : return (const_reverse_iterator(begin()));
  1192. ; 1023 : }
  1193. ; 1024 :
  1194. ; 1025 : #if _HAS_CPP0X
  1195. ; 1026 : const_iterator cbegin() const _NOEXCEPT
  1196. ; 1027 : { // return iterator for beginning of nonmutable sequence
  1197. ; 1028 : return (((const _Myt *)this)->begin());
  1198. ; 1029 : }
  1199. ; 1030 :
  1200. ; 1031 : const_iterator cend() const _NOEXCEPT
  1201. ; 1032 : { // return iterator for end of nonmutable sequence
  1202. ; 1033 : return (((const _Myt *)this)->end());
  1203. ; 1034 : }
  1204. ; 1035 :
  1205. ; 1036 : const_reverse_iterator crbegin() const _NOEXCEPT
  1206. ; 1037 : { // return iterator for beginning of reversed nonmutable sequence
  1207. ; 1038 : return (((const _Myt *)this)->rbegin());
  1208. ; 1039 : }
  1209. ; 1040 :
  1210. ; 1041 : const_reverse_iterator crend() const _NOEXCEPT
  1211. ; 1042 : { // return iterator for end of reversed nonmutable sequence
  1212. ; 1043 : return (((const _Myt *)this)->rend());
  1213. ; 1044 : }
  1214. ; 1045 :
  1215. ; 1046 : void shrink_to_fit()
  1216. ; 1047 : { // reduce capacity
  1217. ; 1048 : if (_Has_unused_capacity())
  1218. ; 1049 : { // worth shrinking, do it
  1219. ; 1050 : if (empty())
  1220. ; 1051 : _Tidy();
  1221. ; 1052 : else
  1222. ; 1053 : _Reallocate(size());
  1223. ; 1054 : }
  1224. ; 1055 : }
  1225. ; 1056 : #endif /* _HAS_CPP0X */
  1226. ; 1057 :
  1227. ; 1058 : void resize(size_type _Newsize)
  1228. ; 1059 : { // determine new length, padding as needed
  1229. ; 1060 : if (_Newsize < size())
  1230. ; 1061 : erase(begin() + _Newsize, end());
  1231. ; 1062 : else if (size() < _Newsize)
  1232. ; 1063 : { // pad as needed
  1233. ; 1064 : _Alty _Alval(this->_Getal());
  1234. ; 1065 : _Reserve(_Newsize - size());
  1235. ; 1066 : _TRY_BEGIN
  1236. ; 1067 : _Uninitialized_default_fill_n(this->_Mylast, _Newsize - size(),
  1237. ; 1068 : _Alval);
  1238. ; 1069 : _CATCH_ALL
  1239. ; 1070 : _Tidy();
  1240. ; 1071 : _RERAISE;
  1241. ; 1072 : _CATCH_END
  1242. ; 1073 : this->_Mylast += _Newsize - size();
  1243. ; 1074 : }
  1244. ; 1075 : }
  1245. ; 1076 :
  1246. ; 1077 : void resize(size_type _Newsize, const value_type& _Val)
  1247. ; 1078 : { // determine new length, padding with _Val elements as needed
  1248. ; 1079 : if (_Newsize < size())
  1249. ; 1080 : erase(begin() + _Newsize, end());
  1250. ; 1081 : else if (size() < _Newsize)
  1251. ; 1082 : _Insert_n(end(), _Newsize - size(), _Val);
  1252. ; 1083 : }
  1253. ; 1084 :
  1254. ; 1085 : size_type size() const _NOEXCEPT
  1255. ; 1086 : { // return length of sequence
  1256. ; 1087 : return (this->_Mylast - this->_Myfirst);
  1257.  
  1258. sar esi, 3
  1259.  
  1260. ; 1527 : { // need more room, try to get it
  1261. ; 1528 : if (max_size() - size() < _Count)
  1262.  
  1263. mov eax, ebx
  1264. sub eax, esi
  1265. cmp eax, edi
  1266. jae SHORT $LN1@Reserve
  1267.  
  1268. ; 1533 :
  1269. ; 1534 : void _Tidy()
  1270. ; 1535 : { // free all storage
  1271. ; 1536 : if (this->_Myfirst != pointer())
  1272. ; 1537 : { // something to free, destroy and deallocate it
  1273. ; 1538 : this->_Orphan_all();
  1274. ; 1539 : _Destroy(this->_Myfirst, this->_Mylast);
  1275. ; 1540 : this->_Getal().deallocate(this->_Myfirst,
  1276. ; 1541 : this->_Myend - this->_Myfirst);
  1277. ; 1542 : this->_Myfirst = pointer();
  1278. ; 1543 : this->_Mylast = pointer();
  1279. ; 1544 : this->_Myend = pointer();
  1280. ; 1545 : }
  1281. ; 1546 : }
  1282. ; 1547 :
  1283. ; 1548 : template<class _Iter>
  1284. ; 1549 : pointer _Ucopy(_Iter _First, _Iter _Last, pointer _Ptr)
  1285. ; 1550 : { // copy initializing [_First, _Last), using allocator
  1286. ; 1551 : _Alty _Alval(this->_Getal());
  1287. ; 1552 : return (_Uninitialized_copy(_First, _Last,
  1288. ; 1553 : _Ptr, _Alval));
  1289. ; 1554 : }
  1290. ; 1555 :
  1291. ; 1556 : template<class _Iter>
  1292. ; 1557 : pointer _Umove(_Iter _First, _Iter _Last, pointer _Ptr)
  1293. ; 1558 : { // move initializing [_First, _Last), using allocator
  1294. ; 1559 : _Alty _Alval(this->_Getal());
  1295. ; 1560 : return (_Uninitialized_move(_First, _Last,
  1296. ; 1561 : _Ptr, _Alval));
  1297. ; 1562 : }
  1298. ; 1563 :
  1299. ; 1564 : iterator _Insert_n(const_iterator _Where,
  1300. ; 1565 : size_type _Count, const value_type& _Val)
  1301. ; 1566 : { // insert _Count * _Val at _Where
  1302. ; 1567 : #if _ITERATOR_DEBUG_LEVEL == 2
  1303. ; 1568 : if (_VICONT(_Where) != this
  1304. ; 1569 : || _VIPTR(_Where) < this->_Myfirst
  1305. ; 1570 : || this->_Mylast < _VIPTR(_Where))
  1306. ; 1571 : _DEBUG_ERROR("vector insert iterator outside range");
  1307. ; 1572 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  1308. ; 1573 :
  1309. ; 1574 : size_type _Off = _VIPTR(_Where) - this->_Myfirst;
  1310. ; 1575 : if (_Count == 0)
  1311. ; 1576 : ;
  1312. ; 1577 : else if (_Unused_capacity() < _Count)
  1313. ; 1578 : { // not enough room, reallocate
  1314. ; 1579 : if (max_size() - size() < _Count)
  1315. ; 1580 : _Xlen(); // result too long
  1316. ; 1581 :
  1317. ; 1582 : size_type _Capacity = _Grow_to(size() + _Count);
  1318. ; 1583 : pointer _Newvec = this->_Getal().allocate(_Capacity);
  1319. ; 1584 : size_type _Whereoff = _VIPTR(_Where) - this->_Myfirst;
  1320. ; 1585 : int _Ncopied = 0;
  1321. ; 1586 :
  1322. ; 1587 : _TRY_BEGIN
  1323. ; 1588 : _Ufill(_Newvec + _Whereoff, _Count,
  1324. ; 1589 : _STD addressof(_Val)); // add new stuff
  1325. ; 1590 : ++_Ncopied;
  1326. ; 1591 : _Umove(this->_Myfirst, _VIPTR(_Where),
  1327. ; 1592 : _Newvec); // copy prefix
  1328. ; 1593 : ++_Ncopied;
  1329. ; 1594 : _Umove(_VIPTR(_Where), this->_Mylast,
  1330. ; 1595 : _Newvec + (_Whereoff + _Count)); // copy suffix
  1331. ; 1596 : _CATCH_ALL
  1332. ; 1597 : if (1 < _Ncopied)
  1333. ; 1598 : _Destroy(_Newvec, _Newvec + _Whereoff);
  1334. ; 1599 : if (0 < _Ncopied)
  1335. ; 1600 : _Destroy(_Newvec + _Whereoff, _Newvec + _Whereoff + _Count);
  1336. ; 1601 : this->_Getal().deallocate(_Newvec, _Capacity);
  1337. ; 1602 : _RERAISE;
  1338. ; 1603 : _CATCH_END
  1339. ; 1604 :
  1340. ; 1605 : _Count += size();
  1341. ; 1606 : if (this->_Myfirst != pointer())
  1342. ; 1607 : { // destroy and deallocate old array
  1343. ; 1608 : _Destroy(this->_Myfirst, this->_Mylast);
  1344. ; 1609 : this->_Getal().deallocate(this->_Myfirst,
  1345. ; 1610 : this->_Myend - this->_Myfirst);
  1346. ; 1611 : }
  1347. ; 1612 :
  1348. ; 1613 : this->_Orphan_all();
  1349. ; 1614 : this->_Myend = _Newvec + _Capacity;
  1350. ; 1615 : this->_Mylast = _Newvec + _Count;
  1351. ; 1616 : this->_Myfirst = _Newvec;
  1352. ; 1617 : }
  1353. ; 1618 : else if ((size_type)(this->_Mylast - _VIPTR(_Where))
  1354. ; 1619 : < _Count)
  1355. ; 1620 : { // new stuff spills off end
  1356. ; 1621 : value_type _Tmp = _Val; // in case _Val is in sequence
  1357. ; 1622 :
  1358. ; 1623 : _Umove(_VIPTR(_Where), this->_Mylast,
  1359. ; 1624 : _VIPTR(_Where) + _Count); // copy suffix
  1360. ; 1625 :
  1361. ; 1626 : _TRY_BEGIN
  1362. ; 1627 : _Ufill(this->_Mylast,
  1363. ; 1628 : _Count - (this->_Mylast - _VIPTR(_Where)),
  1364. ; 1629 : _STD addressof(_Tmp)); // insert new stuff off end
  1365. ; 1630 : _CATCH_ALL
  1366. ; 1631 : _Destroy(_VIPTR(_Where) + _Count,
  1367. ; 1632 : this->_Mylast + _Count);
  1368. ; 1633 : _RERAISE;
  1369. ; 1634 : _CATCH_END
  1370. ; 1635 :
  1371. ; 1636 : this->_Mylast += _Count;
  1372. ; 1637 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
  1373. ; 1638 : _STD fill(_VIPTR(_Where), this->_Mylast - _Count,
  1374. ; 1639 : _Tmp); // insert up to old end
  1375. ; 1640 : }
  1376. ; 1641 : else
  1377. ; 1642 : { // new stuff can all be assigned
  1378. ; 1643 : value_type _Tmp = _Val; // in case _Val is in sequence
  1379. ; 1644 :
  1380. ; 1645 : pointer _Oldend = this->_Mylast;
  1381. ; 1646 : this->_Mylast = _Umove(_Oldend - _Count, _Oldend,
  1382. ; 1647 : this->_Mylast); // copy suffix
  1383. ; 1648 :
  1384. ; 1649 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
  1385. ; 1650 : _Copy_backward(_VIPTR(_Where), _Oldend - _Count,
  1386. ; 1651 : _Oldend); // copy hole
  1387. ; 1652 : _STD fill(_VIPTR(_Where),
  1388. ; 1653 : _VIPTR(_Where) + _Count, _Tmp); // insert into hole
  1389. ; 1654 : }
  1390. ; 1655 : return (begin() + _Off);
  1391. ; 1656 : }
  1392. ; 1657 :
  1393. ; 1658 : pointer _Ufill(pointer _Ptr, size_type _Count, const value_type *_Pval)
  1394. ; 1659 : { // copy initializing _Count * _Val, using allocator
  1395. ; 1660 : _Alty _Alval(this->_Getal());
  1396. ; 1661 : _Uninitialized_fill_n(_Ptr, _Count, _Pval, _Alval);
  1397. ; 1662 : return (_Ptr + _Count);
  1398. ; 1663 : }
  1399. ; 1664 :
  1400. ; 1665 : __declspec(noreturn) void _Xlen() const
  1401. ; 1666 : { // report a length_error
  1402. ; 1667 : _Xlength_error("vector<T> too long");
  1403.  
  1404. push OFFSET ??_C@_0BD@OLBABOEK@vector?$DMT?$DO?5too?5long?$AA@
  1405. call DWORD PTR __imp_?_Xlength_error@std@@YAXPBD@Z
  1406. $LN44@Reserve:
  1407. $LN1@Reserve:
  1408.  
  1409. ; 967 : return (this->_Myend - this->_Myfirst);
  1410.  
  1411. sub edx, DWORD PTR [ecx]
  1412.  
  1413. ; 1529 : _Xlen();
  1414. ; 1530 : _Reallocate(_Grow_to(size() + _Count));
  1415.  
  1416. add esi, edi
  1417.  
  1418. ; 967 : return (this->_Myend - this->_Myfirst);
  1419.  
  1420. sar edx, 3
  1421.  
  1422. ; 1088 : }
  1423. ; 1089 :
  1424. ; 1090 : size_type max_size() const _NOEXCEPT
  1425. ; 1091 : { // return maximum possible length of sequence
  1426. ; 1092 : return (this->_Getal().max_size());
  1427. ; 1093 : }
  1428. ; 1094 :
  1429. ; 1095 : bool empty() const _NOEXCEPT
  1430. ; 1096 : { // test if sequence is empty
  1431. ; 1097 : return (this->_Myfirst == this->_Mylast);
  1432. ; 1098 : }
  1433. ; 1099 :
  1434. ; 1100 : _Alloc get_allocator() const _NOEXCEPT
  1435. ; 1101 : { // return allocator object for values
  1436. ; 1102 : return (this->_Getal());
  1437. ; 1103 : }
  1438. ; 1104 :
  1439. ; 1105 : const_reference at(size_type _Pos) const
  1440. ; 1106 : { // subscript nonmutable sequence with checking
  1441. ; 1107 : if (size() <= _Pos)
  1442. ; 1108 : _Xran();
  1443. ; 1109 : return (*(this->_Myfirst + _Pos));
  1444. ; 1110 : }
  1445. ; 1111 :
  1446. ; 1112 : reference at(size_type _Pos)
  1447. ; 1113 : { // subscript mutable sequence with checking
  1448. ; 1114 : if (size() <= _Pos)
  1449. ; 1115 : _Xran();
  1450. ; 1116 : return (*(this->_Myfirst + _Pos));
  1451. ; 1117 : }
  1452. ; 1118 :
  1453. ; 1119 : const_reference operator[](size_type _Pos) const
  1454. ; 1120 : { // subscript nonmutable sequence
  1455. ; 1121 : #if _ITERATOR_DEBUG_LEVEL == 2
  1456. ; 1122 : if (size() <= _Pos)
  1457. ; 1123 : { // report error
  1458. ; 1124 : _DEBUG_ERROR("vector subscript out of range");
  1459. ; 1125 : _SCL_SECURE_OUT_OF_RANGE;
  1460. ; 1126 : }
  1461. ; 1127 :
  1462. ; 1128 : #elif _ITERATOR_DEBUG_LEVEL == 1
  1463. ; 1129 : _SCL_SECURE_VALIDATE_RANGE(_Pos < size());
  1464. ; 1130 : #endif /* _ITERATOR_DEBUG_LEVEL */
  1465. ; 1131 :
  1466. ; 1132 : return (*(this->_Myfirst + _Pos));
  1467. ; 1133 : }
  1468. ; 1134 :
  1469. ; 1135 : reference operator[](size_type _Pos)
  1470. ; 1136 : { // subscript mutable sequence
  1471. ; 1137 : #if _ITERATOR_DEBUG_LEVEL == 2
  1472. ; 1138 : if (size() <= _Pos)
  1473. ; 1139 : { // report error
  1474. ; 1140 : _DEBUG_ERROR("vector subscript out of range");
  1475. ; 1141 : _SCL_SECURE_OUT_OF_RANGE;
  1476. ; 1142 : }
  1477. ; 1143 :
  1478. ; 1144 : #elif _ITERATOR_DEBUG_LEVEL == 1
  1479. ; 1145 : _SCL_SECURE_VALIDATE_RANGE(_Pos < size());
  1480. ; 1146 : #endif /* _ITERATOR_DEBUG_LEVEL */
  1481. ; 1147 :
  1482. ; 1148 : return (*(this->_Myfirst + _Pos));
  1483. ; 1149 : }
  1484. ; 1150 :
  1485. ; 1151 : #if _HAS_CPP0X
  1486. ; 1152 : pointer data() _NOEXCEPT
  1487. ; 1153 : { // return address of first element
  1488. ; 1154 : return (this->_Myfirst);
  1489. ; 1155 : }
  1490. ; 1156 :
  1491. ; 1157 : const_pointer data() const _NOEXCEPT
  1492. ; 1158 : { // return address of first element
  1493. ; 1159 : return (this->_Myfirst);
  1494. ; 1160 : }
  1495. ; 1161 : #endif /* _HAS_CPP0X */
  1496. ; 1162 :
  1497. ; 1163 : reference front()
  1498. ; 1164 : { // return first element of mutable sequence
  1499. ; 1165 : return (*begin());
  1500. ; 1166 : }
  1501. ; 1167 :
  1502. ; 1168 : const_reference front() const
  1503. ; 1169 : { // return first element of nonmutable sequence
  1504. ; 1170 : return (*begin());
  1505. ; 1171 : }
  1506. ; 1172 :
  1507. ; 1173 : reference back()
  1508. ; 1174 : { // return last element of mutable sequence
  1509. ; 1175 : return (*(end() - 1));
  1510. ; 1176 : }
  1511. ; 1177 :
  1512. ; 1178 : const_reference back() const
  1513. ; 1179 : { // return last element of nonmutable sequence
  1514. ; 1180 : return (*(end() - 1));
  1515. ; 1181 : }
  1516. ; 1182 :
  1517. ; 1183 : void push_back(const value_type& _Val)
  1518. ; 1184 : { // insert element at end
  1519. ; 1185 : if (_Inside(_STD addressof(_Val)))
  1520. ; 1186 : { // push back an element
  1521. ; 1187 : size_type _Idx = _STD addressof(_Val) - this->_Myfirst;
  1522. ; 1188 : if (this->_Mylast == this->_Myend)
  1523. ; 1189 : _Reserve(1);
  1524. ; 1190 : _Orphan_range(this->_Mylast, this->_Mylast);
  1525. ; 1191 : this->_Getal().construct(this->_Mylast,
  1526. ; 1192 : this->_Myfirst[_Idx]);
  1527. ; 1193 : ++this->_Mylast;
  1528. ; 1194 : }
  1529. ; 1195 : else
  1530. ; 1196 : { // push back a non-element
  1531. ; 1197 : if (this->_Mylast == this->_Myend)
  1532. ; 1198 : _Reserve(1);
  1533. ; 1199 : _Orphan_range(this->_Mylast, this->_Mylast);
  1534. ; 1200 : this->_Getal().construct(this->_Mylast,
  1535. ; 1201 : _Val);
  1536. ; 1202 : ++this->_Mylast;
  1537. ; 1203 : }
  1538. ; 1204 : }
  1539. ; 1205 :
  1540. ; 1206 : #if _ITERATOR_DEBUG_LEVEL == 2
  1541. ; 1207 : void pop_back()
  1542. ; 1208 : { // erase element at end
  1543. ; 1209 : if (empty())
  1544. ; 1210 : _DEBUG_ERROR("vector empty before pop");
  1545. ; 1211 : else
  1546. ; 1212 : { // erase last element
  1547. ; 1213 : _Orphan_range(this->_Mylast - 1, this->_Mylast);
  1548. ; 1214 : this->_Getal().destroy(this->_Mylast - 1);
  1549. ; 1215 : --this->_Mylast;
  1550. ; 1216 : }
  1551. ; 1217 : }
  1552. ; 1218 :
  1553. ; 1219 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
  1554. ; 1220 : void pop_back()
  1555. ; 1221 : { // erase element at end
  1556. ; 1222 : if (!empty())
  1557. ; 1223 : { // erase last element
  1558. ; 1224 : this->_Getal().destroy(this->_Mylast - 1);
  1559. ; 1225 : --this->_Mylast;
  1560. ; 1226 : }
  1561. ; 1227 : }
  1562. ; 1228 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  1563. ; 1229 :
  1564. ; 1230 : template<class _Iter>
  1565. ; 1231 : typename enable_if<_Is_iterator<_Iter>::value,
  1566. ; 1232 : void>::type
  1567. ; 1233 : assign(_Iter _First, _Iter _Last)
  1568. ; 1234 : { // assign [_First, _Last), input iterators
  1569. ; 1235 : erase(begin(), end());
  1570. ; 1236 : insert(begin(), _First, _Last);
  1571. ; 1237 : }
  1572. ; 1238 :
  1573. ; 1239 : void assign(size_type _Count, const value_type& _Val)
  1574. ; 1240 : { // assign _Count * _Val
  1575. ; 1241 : _Assign_n(_Count, _Val);
  1576. ; 1242 : }
  1577. ; 1243 :
  1578. ; 1244 : iterator insert(const_iterator _Where, const _Ty& _Val)
  1579. ; 1245 : { // insert _Val at _Where
  1580. ; 1246 : return (_Insert_n(_Where, (size_type)1, _Val));
  1581. ; 1247 : }
  1582. ; 1248 :
  1583. ; 1249 : iterator insert(const_iterator _Where, size_type _Count,
  1584. ; 1250 : const _Ty& _Val)
  1585. ; 1251 : { // insert _Count * _Val at _Where
  1586. ; 1252 : return (_Insert_n(_Where, _Count, _Val));
  1587. ; 1253 : }
  1588. ; 1254 :
  1589. ; 1255 : template<class _Iter>
  1590. ; 1256 : typename enable_if<_Is_iterator<_Iter>::value,
  1591. ; 1257 : iterator>::type
  1592. ; 1258 : insert(const_iterator _Where, _Iter _First, _Iter _Last)
  1593. ; 1259 : { // insert [_First, _Last) at _Where
  1594. ; 1260 : size_type _Off = _VIPTR(_Where) - this->_Myfirst;
  1595. ; 1261 : _Insert(_Where, _First, _Last, _Iter_cat(_First));
  1596. ; 1262 : return (begin() + _Off);
  1597. ; 1263 : }
  1598. ; 1264 :
  1599. ; 1265 : template<class _Iter>
  1600. ; 1266 : void _Insert(const_iterator _Where, _Iter _First, _Iter _Last,
  1601. ; 1267 : input_iterator_tag)
  1602. ; 1268 : { // insert [_First, _Last) at _Where, input iterators
  1603. ; 1269 : size_type _Off = _VIPTR(_Where) - this->_Myfirst;
  1604. ; 1270 :
  1605. ; 1271 : #if _ITERATOR_DEBUG_LEVEL == 2
  1606. ; 1272 : if (size() < _Off)
  1607. ; 1273 : _DEBUG_ERROR("vector insert iterator outside range");
  1608. ; 1274 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  1609. ; 1275 :
  1610. ; 1276 : if (_First != _Last)
  1611. ; 1277 : { // worth doing, gather at end and rotate into place
  1612. ; 1278 : size_type _Oldsize = size();
  1613. ; 1279 :
  1614. ; 1280 : _TRY_BEGIN
  1615. ; 1281 : for (; _First != _Last; ++_First)
  1616. ; 1282 : push_back(*_First); // append
  1617. ; 1283 :
  1618. ; 1284 : _CATCH_ALL
  1619. ; 1285 : erase(begin() + _Oldsize, end());
  1620. ; 1286 : _RERAISE;
  1621. ; 1287 : _CATCH_END
  1622. ; 1288 :
  1623. ; 1289 : _STD rotate(begin() + _Off, begin() + _Oldsize, end());
  1624. ; 1290 : }
  1625. ; 1291 : }
  1626. ; 1292 :
  1627. ; 1293 : template<class _Iter>
  1628. ; 1294 : void _Insert(const_iterator _Where, _Iter _First, _Iter _Last,
  1629. ; 1295 : forward_iterator_tag)
  1630. ; 1296 : { // insert [_First, _Last) at _Where, forward iterators
  1631. ; 1297 : #if _ITERATOR_DEBUG_LEVEL == 2
  1632. ; 1298 : if (_VICONT(_Where) != this
  1633. ; 1299 : || _VIPTR(_Where) < this->_Myfirst
  1634. ; 1300 : || this->_Mylast < _VIPTR(_Where))
  1635. ; 1301 : _DEBUG_ERROR("vector insert iterator outside range");
  1636. ; 1302 : _DEBUG_RANGE(_First, _Last);
  1637. ; 1303 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  1638. ; 1304 :
  1639. ; 1305 : size_type _Count = 0;
  1640. ; 1306 : _Distance(_First, _Last, _Count);
  1641. ; 1307 :
  1642. ; 1308 : if (_Count == 0)
  1643. ; 1309 : ;
  1644. ; 1310 : else if (_Unused_capacity() < _Count)
  1645. ; 1311 : { // not enough room, reallocate
  1646. ; 1312 : if (max_size() - size() < _Count)
  1647. ; 1313 : _Xlen(); // result too long
  1648. ; 1314 :
  1649. ; 1315 : size_type _Capacity = _Grow_to(size() + _Count);
  1650. ; 1316 : pointer _Newvec = this->_Getal().allocate(_Capacity);
  1651. ; 1317 : pointer _Ptr = _Newvec;
  1652. ; 1318 :
  1653. ; 1319 : _TRY_BEGIN
  1654. ; 1320 : _Ptr = _Umove(this->_Myfirst, _VIPTR(_Where),
  1655. ; 1321 : _Newvec); // copy prefix
  1656. ; 1322 : _Ptr = _Ucopy(_First, _Last, _Ptr); // add new stuff
  1657. ; 1323 : _Umove(_VIPTR(_Where), this->_Mylast,
  1658. ; 1324 : _Ptr); // copy suffix
  1659. ; 1325 : _CATCH_ALL
  1660. ; 1326 : _Destroy(_Newvec, _Ptr);
  1661. ; 1327 : this->_Getal().deallocate(_Newvec, _Capacity);
  1662. ; 1328 : _RERAISE;
  1663. ; 1329 : _CATCH_END
  1664. ; 1330 :
  1665. ; 1331 : _Count += size();
  1666. ; 1332 : if (this->_Myfirst != pointer())
  1667. ; 1333 : { // destroy and deallocate old array
  1668. ; 1334 : _Destroy(this->_Myfirst, this->_Mylast);
  1669. ; 1335 : this->_Getal().deallocate(this->_Myfirst,
  1670. ; 1336 : this->_Myend - this->_Myfirst);
  1671. ; 1337 : }
  1672. ; 1338 :
  1673. ; 1339 : this->_Orphan_all();
  1674. ; 1340 : this->_Myend = _Newvec + _Capacity;
  1675. ; 1341 : this->_Mylast = _Newvec + _Count;
  1676. ; 1342 : this->_Myfirst = _Newvec;
  1677. ; 1343 : }
  1678. ; 1344 : else
  1679. ; 1345 : { // new stuff fits, append and rotate into place
  1680. ; 1346 : _Ucopy(_First, _Last, this->_Mylast);
  1681. ; 1347 : _STD rotate(_VIPTR(_Where), this->_Mylast,
  1682. ; 1348 : this->_Mylast + _Count);
  1683. ; 1349 : this->_Mylast += _Count;
  1684. ; 1350 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
  1685. ; 1351 : }
  1686. ; 1352 : }
  1687. ; 1353 :
  1688. ; 1354 : #if _ITERATOR_DEBUG_LEVEL == 2
  1689. ; 1355 : iterator erase(const_iterator _Where)
  1690. ; 1356 : { // erase element at where
  1691. ; 1357 : if (_VICONT(_Where) != this
  1692. ; 1358 : || _VIPTR(_Where) < this->_Myfirst
  1693. ; 1359 : || this->_Mylast <= _VIPTR(_Where))
  1694. ; 1360 : _DEBUG_ERROR("vector erase iterator outside range");
  1695. ; 1361 : _Move(_VIPTR(_Where) + 1, this->_Mylast, _VIPTR(_Where));
  1696. ; 1362 : _Destroy(this->_Mylast - 1, this->_Mylast);
  1697. ; 1363 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
  1698. ; 1364 : --this->_Mylast;
  1699. ; 1365 : return (_Make_iter(_Where));
  1700. ; 1366 : }
  1701. ; 1367 :
  1702. ; 1368 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
  1703. ; 1369 : iterator erase(const_iterator _Where)
  1704. ; 1370 : { // erase element at where
  1705. ; 1371 : _Move(_VIPTR(_Where) + 1, this->_Mylast,
  1706. ; 1372 : _VIPTR(_Where));
  1707. ; 1373 : _Destroy(this->_Mylast - 1, this->_Mylast);
  1708. ; 1374 : --this->_Mylast;
  1709. ; 1375 : return (_Make_iter(_Where));
  1710. ; 1376 : }
  1711. ; 1377 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  1712. ; 1378 :
  1713. ; 1379 : iterator erase(const_iterator _First_arg,
  1714. ; 1380 : const_iterator _Last_arg)
  1715. ; 1381 : { // erase [_First, _Last)
  1716. ; 1382 : if (_First_arg == begin() && _Last_arg == end())
  1717. ; 1383 : clear();
  1718. ; 1384 : else if (_First_arg != _Last_arg)
  1719. ; 1385 : { // clear partial
  1720. ; 1386 : iterator _First = _Make_iter(_First_arg);
  1721. ; 1387 : iterator _Last = _Make_iter(_Last_arg);
  1722. ; 1388 :
  1723. ; 1389 : if (_First != _Last)
  1724. ; 1390 : { // worth doing, copy down over hole
  1725. ; 1391 : #if _ITERATOR_DEBUG_LEVEL == 2
  1726. ; 1392 : if (_Last < _First || _VICONT(_First) != this
  1727. ; 1393 : || _VIPTR(_First) < this->_Myfirst
  1728. ; 1394 : || this->_Mylast < _VIPTR(_Last))
  1729. ; 1395 : _DEBUG_ERROR("vector erase iterator outside range");
  1730. ; 1396 : pointer _Ptr = _Move(_VIPTR(_Last), this->_Mylast,
  1731. ; 1397 : _VIPTR(_First));
  1732. ; 1398 : _Orphan_range(_VIPTR(_First), this->_Mylast);
  1733. ; 1399 :
  1734. ; 1400 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
  1735. ; 1401 : pointer _Ptr = _Move(_VIPTR(_Last), this->_Mylast,
  1736. ; 1402 : _VIPTR(_First));
  1737. ; 1403 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  1738. ; 1404 :
  1739. ; 1405 : _Destroy(_Ptr, this->_Mylast);
  1740. ; 1406 : this->_Mylast = _Ptr;
  1741. ; 1407 : }
  1742. ; 1408 : }
  1743. ; 1409 : return (_Make_iter(_First_arg));
  1744. ; 1410 : }
  1745. ; 1411 :
  1746. ; 1412 : void clear() _NOEXCEPT
  1747. ; 1413 : { // erase all
  1748. ; 1414 : this->_Orphan_all();
  1749. ; 1415 : _Destroy(this->_Myfirst, this->_Mylast);
  1750. ; 1416 : this->_Mylast = this->_Myfirst;
  1751. ; 1417 : }
  1752. ; 1418 :
  1753. ; 1419 : void swap(_Myt& _Right)
  1754. ; 1420 : { // exchange contents with _Right
  1755. ; 1421 : if (this == &_Right)
  1756. ; 1422 : ; // same object, do nothing
  1757. ; 1423 : else if (this->_Getal() == _Right._Getal())
  1758. ; 1424 : { // same allocator, swap control information
  1759. ; 1425 : this->_Swap_all(_Right);
  1760. ; 1426 : _Swap_adl(this->_Myfirst, _Right._Myfirst);
  1761. ; 1427 : _Swap_adl(this->_Mylast, _Right._Mylast);
  1762. ; 1428 : _Swap_adl(this->_Myend, _Right._Myend);
  1763. ; 1429 : }
  1764. ; 1430 :
  1765. ; 1431 : #if _HAS_CPP0X
  1766. ; 1432 : else if (_Alty::propagate_on_container_swap::value)
  1767. ; 1433 : { // swap allocators and control information
  1768. ; 1434 : this->_Swap_alloc(_Right);
  1769. ; 1435 : _Swap_adl(this->_Myfirst, _Right._Myfirst);
  1770. ; 1436 : _Swap_adl(this->_Mylast, _Right._Mylast);
  1771. ; 1437 : _Swap_adl(this->_Myend, _Right._Myend);
  1772. ; 1438 : }
  1773. ; 1439 : #endif /* _HAS_CPP0X */
  1774. ; 1440 :
  1775. ; 1441 : else
  1776. ; 1442 : { // different allocator, do multiple moves
  1777. ; 1443 : _Myt _Ts = _Move(*this);
  1778. ; 1444 :
  1779. ; 1445 : *this = _Move(_Right);
  1780. ; 1446 : _Right = _Move(_Ts);
  1781. ; 1447 : }
  1782. ; 1448 : }
  1783. ; 1449 :
  1784. ; 1450 : protected:
  1785. ; 1451 : void _Assign_n(size_type _Count, const value_type& _Val)
  1786. ; 1452 : { // assign _Count * _Val
  1787. ; 1453 : value_type _Tmp = _Val; // in case _Val is in sequence
  1788. ; 1454 : erase(begin(), end());
  1789. ; 1455 : insert(begin(), _Count, _Tmp);
  1790. ; 1456 : }
  1791. ; 1457 :
  1792. ; 1458 : bool _Buy(size_type _Capacity)
  1793. ; 1459 : { // allocate array with _Capacity elements
  1794. ; 1460 : this->_Myfirst = pointer();
  1795. ; 1461 : this->_Mylast = pointer();
  1796. ; 1462 : this->_Myend = pointer();
  1797. ; 1463 :
  1798. ; 1464 : if (_Capacity == 0)
  1799. ; 1465 : return (false);
  1800. ; 1466 : else if (max_size() < _Capacity)
  1801. ; 1467 : _Xlen(); // result too long
  1802. ; 1468 : else
  1803. ; 1469 : { // nonempty array, allocate storage
  1804. ; 1470 : this->_Myfirst = this->_Getal().allocate(_Capacity);
  1805. ; 1471 : this->_Mylast = this->_Myfirst;
  1806. ; 1472 : this->_Myend = this->_Myfirst + _Capacity;
  1807. ; 1473 : }
  1808. ; 1474 : return (true);
  1809. ; 1475 : }
  1810. ; 1476 :
  1811. ; 1477 : void _Destroy(pointer _First, pointer _Last)
  1812. ; 1478 : { // destroy [_First, _Last) using allocator
  1813. ; 1479 : _Alty _Alval(this->_Getal());
  1814. ; 1480 : _Destroy_range(_First, _Last, _Alval);
  1815. ; 1481 : }
  1816. ; 1482 :
  1817. ; 1483 : size_type _Grow_to(size_type _Count) const
  1818. ; 1484 : { // grow by 50% or at least to _Count
  1819. ; 1485 : size_type _Capacity = capacity();
  1820. ; 1486 :
  1821. ; 1487 : _Capacity = max_size() - _Capacity / 2 < _Capacity
  1822. ; 1488 : ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
  1823.  
  1824. mov eax, edx
  1825. shr eax, 1
  1826. sub ebx, eax
  1827. cmp ebx, edx
  1828. pop ebx
  1829. jae SHORT $LN27@Reserve
  1830. xor edx, edx
  1831.  
  1832. ; 1489 : if (_Capacity < _Count)
  1833.  
  1834. cmp edx, esi
  1835. pop edi
  1836. cmovb edx, esi
  1837. pop esi
  1838.  
  1839. ; 1529 : _Xlen();
  1840. ; 1530 : _Reallocate(_Grow_to(size() + _Count));
  1841.  
  1842. mov DWORD PTR __Count$[ebp], edx
  1843.  
  1844. ; 1531 : }
  1845. ; 1532 : }
  1846.  
  1847. pop ebp
  1848.  
  1849. ; 1529 : _Xlen();
  1850. ; 1530 : _Reallocate(_Grow_to(size() + _Count));
  1851.  
  1852. jmp ?_Reallocate@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z ; std::vector<double,std::allocator<double> >::_Reallocate
  1853. $LN27@Reserve:
  1854.  
  1855. ; 1088 : }
  1856. ; 1089 :
  1857. ; 1090 : size_type max_size() const _NOEXCEPT
  1858. ; 1091 : { // return maximum possible length of sequence
  1859. ; 1092 : return (this->_Getal().max_size());
  1860. ; 1093 : }
  1861. ; 1094 :
  1862. ; 1095 : bool empty() const _NOEXCEPT
  1863. ; 1096 : { // test if sequence is empty
  1864. ; 1097 : return (this->_Myfirst == this->_Mylast);
  1865. ; 1098 : }
  1866. ; 1099 :
  1867. ; 1100 : _Alloc get_allocator() const _NOEXCEPT
  1868. ; 1101 : { // return allocator object for values
  1869. ; 1102 : return (this->_Getal());
  1870. ; 1103 : }
  1871. ; 1104 :
  1872. ; 1105 : const_reference at(size_type _Pos) const
  1873. ; 1106 : { // subscript nonmutable sequence with checking
  1874. ; 1107 : if (size() <= _Pos)
  1875. ; 1108 : _Xran();
  1876. ; 1109 : return (*(this->_Myfirst + _Pos));
  1877. ; 1110 : }
  1878. ; 1111 :
  1879. ; 1112 : reference at(size_type _Pos)
  1880. ; 1113 : { // subscript mutable sequence with checking
  1881. ; 1114 : if (size() <= _Pos)
  1882. ; 1115 : _Xran();
  1883. ; 1116 : return (*(this->_Myfirst + _Pos));
  1884. ; 1117 : }
  1885. ; 1118 :
  1886. ; 1119 : const_reference operator[](size_type _Pos) const
  1887. ; 1120 : { // subscript nonmutable sequence
  1888. ; 1121 : #if _ITERATOR_DEBUG_LEVEL == 2
  1889. ; 1122 : if (size() <= _Pos)
  1890. ; 1123 : { // report error
  1891. ; 1124 : _DEBUG_ERROR("vector subscript out of range");
  1892. ; 1125 : _SCL_SECURE_OUT_OF_RANGE;
  1893. ; 1126 : }
  1894. ; 1127 :
  1895. ; 1128 : #elif _ITERATOR_DEBUG_LEVEL == 1
  1896. ; 1129 : _SCL_SECURE_VALIDATE_RANGE(_Pos < size());
  1897. ; 1130 : #endif /* _ITERATOR_DEBUG_LEVEL */
  1898. ; 1131 :
  1899. ; 1132 : return (*(this->_Myfirst + _Pos));
  1900. ; 1133 : }
  1901. ; 1134 :
  1902. ; 1135 : reference operator[](size_type _Pos)
  1903. ; 1136 : { // subscript mutable sequence
  1904. ; 1137 : #if _ITERATOR_DEBUG_LEVEL == 2
  1905. ; 1138 : if (size() <= _Pos)
  1906. ; 1139 : { // report error
  1907. ; 1140 : _DEBUG_ERROR("vector subscript out of range");
  1908. ; 1141 : _SCL_SECURE_OUT_OF_RANGE;
  1909. ; 1142 : }
  1910. ; 1143 :
  1911. ; 1144 : #elif _ITERATOR_DEBUG_LEVEL == 1
  1912. ; 1145 : _SCL_SECURE_VALIDATE_RANGE(_Pos < size());
  1913. ; 1146 : #endif /* _ITERATOR_DEBUG_LEVEL */
  1914. ; 1147 :
  1915. ; 1148 : return (*(this->_Myfirst + _Pos));
  1916. ; 1149 : }
  1917. ; 1150 :
  1918. ; 1151 : #if _HAS_CPP0X
  1919. ; 1152 : pointer data() _NOEXCEPT
  1920. ; 1153 : { // return address of first element
  1921. ; 1154 : return (this->_Myfirst);
  1922. ; 1155 : }
  1923. ; 1156 :
  1924. ; 1157 : const_pointer data() const _NOEXCEPT
  1925. ; 1158 : { // return address of first element
  1926. ; 1159 : return (this->_Myfirst);
  1927. ; 1160 : }
  1928. ; 1161 : #endif /* _HAS_CPP0X */
  1929. ; 1162 :
  1930. ; 1163 : reference front()
  1931. ; 1164 : { // return first element of mutable sequence
  1932. ; 1165 : return (*begin());
  1933. ; 1166 : }
  1934. ; 1167 :
  1935. ; 1168 : const_reference front() const
  1936. ; 1169 : { // return first element of nonmutable sequence
  1937. ; 1170 : return (*begin());
  1938. ; 1171 : }
  1939. ; 1172 :
  1940. ; 1173 : reference back()
  1941. ; 1174 : { // return last element of mutable sequence
  1942. ; 1175 : return (*(end() - 1));
  1943. ; 1176 : }
  1944. ; 1177 :
  1945. ; 1178 : const_reference back() const
  1946. ; 1179 : { // return last element of nonmutable sequence
  1947. ; 1180 : return (*(end() - 1));
  1948. ; 1181 : }
  1949. ; 1182 :
  1950. ; 1183 : void push_back(const value_type& _Val)
  1951. ; 1184 : { // insert element at end
  1952. ; 1185 : if (_Inside(_STD addressof(_Val)))
  1953. ; 1186 : { // push back an element
  1954. ; 1187 : size_type _Idx = _STD addressof(_Val) - this->_Myfirst;
  1955. ; 1188 : if (this->_Mylast == this->_Myend)
  1956. ; 1189 : _Reserve(1);
  1957. ; 1190 : _Orphan_range(this->_Mylast, this->_Mylast);
  1958. ; 1191 : this->_Getal().construct(this->_Mylast,
  1959. ; 1192 : this->_Myfirst[_Idx]);
  1960. ; 1193 : ++this->_Mylast;
  1961. ; 1194 : }
  1962. ; 1195 : else
  1963. ; 1196 : { // push back a non-element
  1964. ; 1197 : if (this->_Mylast == this->_Myend)
  1965. ; 1198 : _Reserve(1);
  1966. ; 1199 : _Orphan_range(this->_Mylast, this->_Mylast);
  1967. ; 1200 : this->_Getal().construct(this->_Mylast,
  1968. ; 1201 : _Val);
  1969. ; 1202 : ++this->_Mylast;
  1970. ; 1203 : }
  1971. ; 1204 : }
  1972. ; 1205 :
  1973. ; 1206 : #if _ITERATOR_DEBUG_LEVEL == 2
  1974. ; 1207 : void pop_back()
  1975. ; 1208 : { // erase element at end
  1976. ; 1209 : if (empty())
  1977. ; 1210 : _DEBUG_ERROR("vector empty before pop");
  1978. ; 1211 : else
  1979. ; 1212 : { // erase last element
  1980. ; 1213 : _Orphan_range(this->_Mylast - 1, this->_Mylast);
  1981. ; 1214 : this->_Getal().destroy(this->_Mylast - 1);
  1982. ; 1215 : --this->_Mylast;
  1983. ; 1216 : }
  1984. ; 1217 : }
  1985. ; 1218 :
  1986. ; 1219 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
  1987. ; 1220 : void pop_back()
  1988. ; 1221 : { // erase element at end
  1989. ; 1222 : if (!empty())
  1990. ; 1223 : { // erase last element
  1991. ; 1224 : this->_Getal().destroy(this->_Mylast - 1);
  1992. ; 1225 : --this->_Mylast;
  1993. ; 1226 : }
  1994. ; 1227 : }
  1995. ; 1228 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  1996. ; 1229 :
  1997. ; 1230 : template<class _Iter>
  1998. ; 1231 : typename enable_if<_Is_iterator<_Iter>::value,
  1999. ; 1232 : void>::type
  2000. ; 1233 : assign(_Iter _First, _Iter _Last)
  2001. ; 1234 : { // assign [_First, _Last), input iterators
  2002. ; 1235 : erase(begin(), end());
  2003. ; 1236 : insert(begin(), _First, _Last);
  2004. ; 1237 : }
  2005. ; 1238 :
  2006. ; 1239 : void assign(size_type _Count, const value_type& _Val)
  2007. ; 1240 : { // assign _Count * _Val
  2008. ; 1241 : _Assign_n(_Count, _Val);
  2009. ; 1242 : }
  2010. ; 1243 :
  2011. ; 1244 : iterator insert(const_iterator _Where, const _Ty& _Val)
  2012. ; 1245 : { // insert _Val at _Where
  2013. ; 1246 : return (_Insert_n(_Where, (size_type)1, _Val));
  2014. ; 1247 : }
  2015. ; 1248 :
  2016. ; 1249 : iterator insert(const_iterator _Where, size_type _Count,
  2017. ; 1250 : const _Ty& _Val)
  2018. ; 1251 : { // insert _Count * _Val at _Where
  2019. ; 1252 : return (_Insert_n(_Where, _Count, _Val));
  2020. ; 1253 : }
  2021. ; 1254 :
  2022. ; 1255 : template<class _Iter>
  2023. ; 1256 : typename enable_if<_Is_iterator<_Iter>::value,
  2024. ; 1257 : iterator>::type
  2025. ; 1258 : insert(const_iterator _Where, _Iter _First, _Iter _Last)
  2026. ; 1259 : { // insert [_First, _Last) at _Where
  2027. ; 1260 : size_type _Off = _VIPTR(_Where) - this->_Myfirst;
  2028. ; 1261 : _Insert(_Where, _First, _Last, _Iter_cat(_First));
  2029. ; 1262 : return (begin() + _Off);
  2030. ; 1263 : }
  2031. ; 1264 :
  2032. ; 1265 : template<class _Iter>
  2033. ; 1266 : void _Insert(const_iterator _Where, _Iter _First, _Iter _Last,
  2034. ; 1267 : input_iterator_tag)
  2035. ; 1268 : { // insert [_First, _Last) at _Where, input iterators
  2036. ; 1269 : size_type _Off = _VIPTR(_Where) - this->_Myfirst;
  2037. ; 1270 :
  2038. ; 1271 : #if _ITERATOR_DEBUG_LEVEL == 2
  2039. ; 1272 : if (size() < _Off)
  2040. ; 1273 : _DEBUG_ERROR("vector insert iterator outside range");
  2041. ; 1274 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  2042. ; 1275 :
  2043. ; 1276 : if (_First != _Last)
  2044. ; 1277 : { // worth doing, gather at end and rotate into place
  2045. ; 1278 : size_type _Oldsize = size();
  2046. ; 1279 :
  2047. ; 1280 : _TRY_BEGIN
  2048. ; 1281 : for (; _First != _Last; ++_First)
  2049. ; 1282 : push_back(*_First); // append
  2050. ; 1283 :
  2051. ; 1284 : _CATCH_ALL
  2052. ; 1285 : erase(begin() + _Oldsize, end());
  2053. ; 1286 : _RERAISE;
  2054. ; 1287 : _CATCH_END
  2055. ; 1288 :
  2056. ; 1289 : _STD rotate(begin() + _Off, begin() + _Oldsize, end());
  2057. ; 1290 : }
  2058. ; 1291 : }
  2059. ; 1292 :
  2060. ; 1293 : template<class _Iter>
  2061. ; 1294 : void _Insert(const_iterator _Where, _Iter _First, _Iter _Last,
  2062. ; 1295 : forward_iterator_tag)
  2063. ; 1296 : { // insert [_First, _Last) at _Where, forward iterators
  2064. ; 1297 : #if _ITERATOR_DEBUG_LEVEL == 2
  2065. ; 1298 : if (_VICONT(_Where) != this
  2066. ; 1299 : || _VIPTR(_Where) < this->_Myfirst
  2067. ; 1300 : || this->_Mylast < _VIPTR(_Where))
  2068. ; 1301 : _DEBUG_ERROR("vector insert iterator outside range");
  2069. ; 1302 : _DEBUG_RANGE(_First, _Last);
  2070. ; 1303 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  2071. ; 1304 :
  2072. ; 1305 : size_type _Count = 0;
  2073. ; 1306 : _Distance(_First, _Last, _Count);
  2074. ; 1307 :
  2075. ; 1308 : if (_Count == 0)
  2076. ; 1309 : ;
  2077. ; 1310 : else if (_Unused_capacity() < _Count)
  2078. ; 1311 : { // not enough room, reallocate
  2079. ; 1312 : if (max_size() - size() < _Count)
  2080. ; 1313 : _Xlen(); // result too long
  2081. ; 1314 :
  2082. ; 1315 : size_type _Capacity = _Grow_to(size() + _Count);
  2083. ; 1316 : pointer _Newvec = this->_Getal().allocate(_Capacity);
  2084. ; 1317 : pointer _Ptr = _Newvec;
  2085. ; 1318 :
  2086. ; 1319 : _TRY_BEGIN
  2087. ; 1320 : _Ptr = _Umove(this->_Myfirst, _VIPTR(_Where),
  2088. ; 1321 : _Newvec); // copy prefix
  2089. ; 1322 : _Ptr = _Ucopy(_First, _Last, _Ptr); // add new stuff
  2090. ; 1323 : _Umove(_VIPTR(_Where), this->_Mylast,
  2091. ; 1324 : _Ptr); // copy suffix
  2092. ; 1325 : _CATCH_ALL
  2093. ; 1326 : _Destroy(_Newvec, _Ptr);
  2094. ; 1327 : this->_Getal().deallocate(_Newvec, _Capacity);
  2095. ; 1328 : _RERAISE;
  2096. ; 1329 : _CATCH_END
  2097. ; 1330 :
  2098. ; 1331 : _Count += size();
  2099. ; 1332 : if (this->_Myfirst != pointer())
  2100. ; 1333 : { // destroy and deallocate old array
  2101. ; 1334 : _Destroy(this->_Myfirst, this->_Mylast);
  2102. ; 1335 : this->_Getal().deallocate(this->_Myfirst,
  2103. ; 1336 : this->_Myend - this->_Myfirst);
  2104. ; 1337 : }
  2105. ; 1338 :
  2106. ; 1339 : this->_Orphan_all();
  2107. ; 1340 : this->_Myend = _Newvec + _Capacity;
  2108. ; 1341 : this->_Mylast = _Newvec + _Count;
  2109. ; 1342 : this->_Myfirst = _Newvec;
  2110. ; 1343 : }
  2111. ; 1344 : else
  2112. ; 1345 : { // new stuff fits, append and rotate into place
  2113. ; 1346 : _Ucopy(_First, _Last, this->_Mylast);
  2114. ; 1347 : _STD rotate(_VIPTR(_Where), this->_Mylast,
  2115. ; 1348 : this->_Mylast + _Count);
  2116. ; 1349 : this->_Mylast += _Count;
  2117. ; 1350 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
  2118. ; 1351 : }
  2119. ; 1352 : }
  2120. ; 1353 :
  2121. ; 1354 : #if _ITERATOR_DEBUG_LEVEL == 2
  2122. ; 1355 : iterator erase(const_iterator _Where)
  2123. ; 1356 : { // erase element at where
  2124. ; 1357 : if (_VICONT(_Where) != this
  2125. ; 1358 : || _VIPTR(_Where) < this->_Myfirst
  2126. ; 1359 : || this->_Mylast <= _VIPTR(_Where))
  2127. ; 1360 : _DEBUG_ERROR("vector erase iterator outside range");
  2128. ; 1361 : _Move(_VIPTR(_Where) + 1, this->_Mylast, _VIPTR(_Where));
  2129. ; 1362 : _Destroy(this->_Mylast - 1, this->_Mylast);
  2130. ; 1363 : _Orphan_range(_VIPTR(_Where), this->_Mylast);
  2131. ; 1364 : --this->_Mylast;
  2132. ; 1365 : return (_Make_iter(_Where));
  2133. ; 1366 : }
  2134. ; 1367 :
  2135. ; 1368 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
  2136. ; 1369 : iterator erase(const_iterator _Where)
  2137. ; 1370 : { // erase element at where
  2138. ; 1371 : _Move(_VIPTR(_Where) + 1, this->_Mylast,
  2139. ; 1372 : _VIPTR(_Where));
  2140. ; 1373 : _Destroy(this->_Mylast - 1, this->_Mylast);
  2141. ; 1374 : --this->_Mylast;
  2142. ; 1375 : return (_Make_iter(_Where));
  2143. ; 1376 : }
  2144. ; 1377 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  2145. ; 1378 :
  2146. ; 1379 : iterator erase(const_iterator _First_arg,
  2147. ; 1380 : const_iterator _Last_arg)
  2148. ; 1381 : { // erase [_First, _Last)
  2149. ; 1382 : if (_First_arg == begin() && _Last_arg == end())
  2150. ; 1383 : clear();
  2151. ; 1384 : else if (_First_arg != _Last_arg)
  2152. ; 1385 : { // clear partial
  2153. ; 1386 : iterator _First = _Make_iter(_First_arg);
  2154. ; 1387 : iterator _Last = _Make_iter(_Last_arg);
  2155. ; 1388 :
  2156. ; 1389 : if (_First != _Last)
  2157. ; 1390 : { // worth doing, copy down over hole
  2158. ; 1391 : #if _ITERATOR_DEBUG_LEVEL == 2
  2159. ; 1392 : if (_Last < _First || _VICONT(_First) != this
  2160. ; 1393 : || _VIPTR(_First) < this->_Myfirst
  2161. ; 1394 : || this->_Mylast < _VIPTR(_Last))
  2162. ; 1395 : _DEBUG_ERROR("vector erase iterator outside range");
  2163. ; 1396 : pointer _Ptr = _Move(_VIPTR(_Last), this->_Mylast,
  2164. ; 1397 : _VIPTR(_First));
  2165. ; 1398 : _Orphan_range(_VIPTR(_First), this->_Mylast);
  2166. ; 1399 :
  2167. ; 1400 : #else /* _ITERATOR_DEBUG_LEVEL == 2 */
  2168. ; 1401 : pointer _Ptr = _Move(_VIPTR(_Last), this->_Mylast,
  2169. ; 1402 : _VIPTR(_First));
  2170. ; 1403 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  2171. ; 1404 :
  2172. ; 1405 : _Destroy(_Ptr, this->_Mylast);
  2173. ; 1406 : this->_Mylast = _Ptr;
  2174. ; 1407 : }
  2175. ; 1408 : }
  2176. ; 1409 : return (_Make_iter(_First_arg));
  2177. ; 1410 : }
  2178. ; 1411 :
  2179. ; 1412 : void clear() _NOEXCEPT
  2180. ; 1413 : { // erase all
  2181. ; 1414 : this->_Orphan_all();
  2182. ; 1415 : _Destroy(this->_Myfirst, this->_Mylast);
  2183. ; 1416 : this->_Mylast = this->_Myfirst;
  2184. ; 1417 : }
  2185. ; 1418 :
  2186. ; 1419 : void swap(_Myt& _Right)
  2187. ; 1420 : { // exchange contents with _Right
  2188. ; 1421 : if (this == &_Right)
  2189. ; 1422 : ; // same object, do nothing
  2190. ; 1423 : else if (this->_Getal() == _Right._Getal())
  2191. ; 1424 : { // same allocator, swap control information
  2192. ; 1425 : this->_Swap_all(_Right);
  2193. ; 1426 : _Swap_adl(this->_Myfirst, _Right._Myfirst);
  2194. ; 1427 : _Swap_adl(this->_Mylast, _Right._Mylast);
  2195. ; 1428 : _Swap_adl(this->_Myend, _Right._Myend);
  2196. ; 1429 : }
  2197. ; 1430 :
  2198. ; 1431 : #if _HAS_CPP0X
  2199. ; 1432 : else if (_Alty::propagate_on_container_swap::value)
  2200. ; 1433 : { // swap allocators and control information
  2201. ; 1434 : this->_Swap_alloc(_Right);
  2202. ; 1435 : _Swap_adl(this->_Myfirst, _Right._Myfirst);
  2203. ; 1436 : _Swap_adl(this->_Mylast, _Right._Mylast);
  2204. ; 1437 : _Swap_adl(this->_Myend, _Right._Myend);
  2205. ; 1438 : }
  2206. ; 1439 : #endif /* _HAS_CPP0X */
  2207. ; 1440 :
  2208. ; 1441 : else
  2209. ; 1442 : { // different allocator, do multiple moves
  2210. ; 1443 : _Myt _Ts = _Move(*this);
  2211. ; 1444 :
  2212. ; 1445 : *this = _Move(_Right);
  2213. ; 1446 : _Right = _Move(_Ts);
  2214. ; 1447 : }
  2215. ; 1448 : }
  2216. ; 1449 :
  2217. ; 1450 : protected:
  2218. ; 1451 : void _Assign_n(size_type _Count, const value_type& _Val)
  2219. ; 1452 : { // assign _Count * _Val
  2220. ; 1453 : value_type _Tmp = _Val; // in case _Val is in sequence
  2221. ; 1454 : erase(begin(), end());
  2222. ; 1455 : insert(begin(), _Count, _Tmp);
  2223. ; 1456 : }
  2224. ; 1457 :
  2225. ; 1458 : bool _Buy(size_type _Capacity)
  2226. ; 1459 : { // allocate array with _Capacity elements
  2227. ; 1460 : this->_Myfirst = pointer();
  2228. ; 1461 : this->_Mylast = pointer();
  2229. ; 1462 : this->_Myend = pointer();
  2230. ; 1463 :
  2231. ; 1464 : if (_Capacity == 0)
  2232. ; 1465 : return (false);
  2233. ; 1466 : else if (max_size() < _Capacity)
  2234. ; 1467 : _Xlen(); // result too long
  2235. ; 1468 : else
  2236. ; 1469 : { // nonempty array, allocate storage
  2237. ; 1470 : this->_Myfirst = this->_Getal().allocate(_Capacity);
  2238. ; 1471 : this->_Mylast = this->_Myfirst;
  2239. ; 1472 : this->_Myend = this->_Myfirst + _Capacity;
  2240. ; 1473 : }
  2241. ; 1474 : return (true);
  2242. ; 1475 : }
  2243. ; 1476 :
  2244. ; 1477 : void _Destroy(pointer _First, pointer _Last)
  2245. ; 1478 : { // destroy [_First, _Last) using allocator
  2246. ; 1479 : _Alty _Alval(this->_Getal());
  2247. ; 1480 : _Destroy_range(_First, _Last, _Alval);
  2248. ; 1481 : }
  2249. ; 1482 :
  2250. ; 1483 : size_type _Grow_to(size_type _Count) const
  2251. ; 1484 : { // grow by 50% or at least to _Count
  2252. ; 1485 : size_type _Capacity = capacity();
  2253. ; 1486 :
  2254. ; 1487 : _Capacity = max_size() - _Capacity / 2 < _Capacity
  2255. ; 1488 : ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
  2256.  
  2257. add edx, eax
  2258.  
  2259. ; 1489 : if (_Capacity < _Count)
  2260.  
  2261. cmp edx, esi
  2262. pop edi
  2263. cmovb edx, esi
  2264. pop esi
  2265.  
  2266. ; 1529 : _Xlen();
  2267. ; 1530 : _Reallocate(_Grow_to(size() + _Count));
  2268.  
  2269. mov DWORD PTR __Count$[ebp], edx
  2270.  
  2271. ; 1531 : }
  2272. ; 1532 : }
  2273.  
  2274. pop ebp
  2275.  
  2276. ; 1529 : _Xlen();
  2277. ; 1530 : _Reallocate(_Grow_to(size() + _Count));
  2278.  
  2279. jmp ?_Reallocate@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z ; std::vector<double,std::allocator<double> >::_Reallocate
  2280. $LN2@Reserve:
  2281. pop edi
  2282. pop esi
  2283.  
  2284. ; 1531 : }
  2285. ; 1532 : }
  2286.  
  2287. pop ebp
  2288. ret 4
  2289. $LN43@Reserve:
  2290. ?_Reserve@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z ENDP ; std::vector<double,std::allocator<double> >::_Reserve
  2291. _TEXT ENDS
  2292. ; Function compile flags: /Ogtp
  2293. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  2294. ; 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
  2295. _TEXT SEGMENT
  2296. ___$ReturnUdt$ = 8 ; size = 4
  2297. ?_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
  2298. ; _this$dead$ = ecx
  2299.  
  2300. ; 646 : { // get reference to allocator
  2301.  
  2302. push ebp
  2303. mov ebp, esp
  2304.  
  2305. ; 647 : return (_Alty());
  2306.  
  2307. mov eax, DWORD PTR ___$ReturnUdt$[ebp]
  2308.  
  2309. ; 648 : }
  2310.  
  2311. pop ebp
  2312. ret 4
  2313. ?_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
  2314. _TEXT ENDS
  2315. ; Function compile flags: /Ogtp
  2316. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  2317. ; COMDAT ?deallocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEXPANI@Z
  2318. _TEXT SEGMENT
  2319. __Ptr$ = 8 ; size = 4
  2320. __Count$dead$ = 12 ; size = 4
  2321. ?deallocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEXPANI@Z PROC ; std::_Wrap_alloc<std::allocator<double> >::deallocate, COMDAT
  2322. ; _this$dead$ = ecx
  2323.  
  2324. ; 886 : { // deallocate object at _Ptr, ignore size
  2325.  
  2326. push ebp
  2327. mov ebp, esp
  2328.  
  2329. ; 586 : ::operator delete(_Ptr);
  2330.  
  2331. push DWORD PTR __Ptr$[ebp]
  2332. call DWORD PTR __imp_??3@YAXPAX@Z
  2333. add esp, 4
  2334.  
  2335. ; 887 : _Mybase::deallocate(_Ptr, _Count);
  2336. ; 888 : }
  2337.  
  2338. pop ebp
  2339. ret 8
  2340. ?deallocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEXPANI@Z ENDP ; std::_Wrap_alloc<std::allocator<double> >::deallocate
  2341. _TEXT ENDS
  2342. ; Function compile flags: /Ogtp
  2343. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  2344. ; COMDAT ??0?$_Vector_val@U?$_Simple_types@N@std@@@std@@QAE@XZ
  2345. _TEXT SEGMENT
  2346. ??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
  2347. ; _this$ = ecx
  2348.  
  2349. ; 485 : { // initialize values
  2350. ; 486 : _Myfirst = pointer();
  2351.  
  2352. mov DWORD PTR [ecx], 0
  2353.  
  2354. ; 487 : _Mylast = pointer();
  2355.  
  2356. mov DWORD PTR [ecx+4], 0
  2357.  
  2358. ; 488 : _Myend = pointer();
  2359.  
  2360. mov DWORD PTR [ecx+8], 0
  2361.  
  2362. ; 489 : }
  2363.  
  2364. mov eax, ecx
  2365. ret 0
  2366. ??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> >
  2367. _TEXT ENDS
  2368. ; Function compile flags: /Ogtp
  2369. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  2370. ; COMDAT ??H?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE?AV01@H@Z
  2371. _TEXT SEGMENT
  2372. ___$ReturnUdt$ = 8 ; size = 4
  2373. __Off$ = 12 ; size = 4
  2374. ??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
  2375. ; _this$ = ecx
  2376.  
  2377. ; 365 : { // return this + integer
  2378.  
  2379. push ebp
  2380. mov ebp, esp
  2381.  
  2382. ; 170 : _Ptr += _Off;
  2383.  
  2384. mov eax, DWORD PTR __Off$[ebp]
  2385. mov ecx, DWORD PTR [ecx]
  2386. lea ecx, DWORD PTR [ecx+eax*8]
  2387.  
  2388. ; 366 : _Myiter _Tmp = *this;
  2389. ; 367 : return (_Tmp += _Off);
  2390.  
  2391. mov eax, DWORD PTR ___$ReturnUdt$[ebp]
  2392. mov DWORD PTR [eax], ecx
  2393.  
  2394. ; 368 : }
  2395.  
  2396. pop ebp
  2397. ret 8
  2398. ??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+
  2399. _TEXT ENDS
  2400. ; Function compile flags: /Ogtp
  2401. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2402. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  2403. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2404. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  2405. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2406. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  2407. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2408. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  2409. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2410. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  2411. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2412. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  2413. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2414. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  2415. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2416. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  2417. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2418. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  2419. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  2420. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2421. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  2422. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  2423. ; COMDAT ?assign@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@ABV12@II@Z
  2424. _TEXT SEGMENT
  2425. __Right$ = 8 ; size = 4
  2426. __Roff$ = 12 ; size = 4
  2427. __Count$ = 16 ; size = 4
  2428. ?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
  2429. ; _this$ = ecx
  2430.  
  2431. ; 1104 : { // assign _Right [_Roff, _Roff + _Count)
  2432.  
  2433. push ebp
  2434. mov ebp, esp
  2435. push ebx
  2436.  
  2437. ; 1105 : if (_Right.size() < _Roff)
  2438.  
  2439. mov ebx, DWORD PTR __Right$[ebp]
  2440. push esi
  2441. push edi
  2442. mov edi, DWORD PTR [ebx+16]
  2443. mov esi, ecx
  2444. mov ecx, DWORD PTR __Roff$[ebp]
  2445. cmp edi, ecx
  2446. jae SHORT $LN5@assign
  2447.  
  2448. ; 2219 : }
  2449. ; 2220 :
  2450. ; 2221 : bool _Grow(size_type _Newsize,
  2451. ; 2222 : bool _Trim = false)
  2452. ; 2223 : { // ensure buffer is big enough, trim to size if _Trim is true
  2453. ; 2224 : if (max_size() < _Newsize)
  2454. ; 2225 : _Xlen(); // result too long
  2455. ; 2226 : if (this->_Myres < _Newsize)
  2456. ; 2227 : _Copy(_Newsize, this->_Mysize); // reallocate to grow
  2457. ; 2228 : else if (_Trim && _Newsize < this->_BUF_SIZE)
  2458. ; 2229 : _Tidy(true, // copy and deallocate if trimming to small string
  2459. ; 2230 : _Newsize < this->_Mysize ? _Newsize : this->_Mysize);
  2460. ; 2231 : else if (_Newsize == 0)
  2461. ; 2232 : _Eos(0); // new size is zero, just null terminate
  2462. ; 2233 : return (0 < _Newsize); // return true only if more work to do
  2463. ; 2234 : }
  2464. ; 2235 :
  2465. ; 2236 : bool _Inside(const _Elem *_Ptr)
  2466. ; 2237 : { // test if _Ptr points inside string
  2467. ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
  2468. ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
  2469. ; 2240 : return (false); // don't ask
  2470. ; 2241 : else
  2471. ; 2242 : return (true);
  2472. ; 2243 : }
  2473. ; 2244 :
  2474. ; 2245 : static size_type _Pdif(const_iterator _P2,
  2475. ; 2246 : const_iterator _P1)
  2476. ; 2247 : { // compute safe iterator difference
  2477. ; 2248 : return (_STRING_ITER_BASE(_P2) == 0 ? 0 : _P2 - _P1);
  2478. ; 2249 : }
  2479. ; 2250 :
  2480. ; 2251 : void _Tidy(bool _Built = false,
  2481. ; 2252 : size_type _Newsize = 0)
  2482. ; 2253 : { // initialize buffer, deallocating any storage
  2483. ; 2254 : if (!_Built)
  2484. ; 2255 : ;
  2485. ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
  2486. ; 2257 : { // copy any leftovers to small buffer and deallocate
  2487. ; 2258 : pointer _Ptr = this->_Bx._Ptr;
  2488. ; 2259 : this->_Getal().destroy(&this->_Bx._Ptr);
  2489. ; 2260 : if (0 < _Newsize)
  2490. ; 2261 : _Traits::copy(this->_Bx._Buf,
  2491. ; 2262 : _STD addressof(*_Ptr), _Newsize);
  2492. ; 2263 : this->_Getal().deallocate(_Ptr, this->_Myres + 1);
  2493. ; 2264 : }
  2494. ; 2265 : this->_Myres = this->_BUF_SIZE - 1;
  2495. ; 2266 : _Eos(_Newsize);
  2496. ; 2267 : }
  2497. ; 2268 :
  2498. ; 2269 : __declspec(noreturn) void _Xlen() const
  2499. ; 2270 : { // report a length_error
  2500. ; 2271 : _Xlength_error("string too long");
  2501. ; 2272 : }
  2502. ; 2273 :
  2503. ; 2274 : __declspec(noreturn) void _Xran() const
  2504. ; 2275 : { // report an out_of_range error
  2505. ; 2276 : _Xout_of_range("invalid string position");
  2506.  
  2507. push OFFSET ??_C@_0BI@CFPLBAOH@invalid?5string?5position?$AA@
  2508. call DWORD PTR __imp_?_Xout_of_range@std@@YAXPBD@Z
  2509. $LN59@assign:
  2510. $LN5@assign:
  2511.  
  2512. ; 1106 : _Xran(); // _Roff off end
  2513. ; 1107 : size_type _Num = _Right.size() - _Roff;
  2514.  
  2515. sub edi, ecx
  2516.  
  2517. ; 1108 : if (_Count < _Num)
  2518.  
  2519. cmp DWORD PTR __Count$[ebp], edi
  2520. cmovb edi, DWORD PTR __Count$[ebp]
  2521.  
  2522. ; 1109 : _Num = _Count; // trim _Num to size
  2523. ; 1110 :
  2524. ; 1111 : if (this == &_Right)
  2525.  
  2526. cmp esi, ebx
  2527. jne SHORT $LN3@assign
  2528.  
  2529. ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
  2530.  
  2531. lea eax, DWORD PTR [edi+ecx]
  2532.  
  2533. ; 1121 :
  2534. ; 1122 : _Myt& assign(const _Elem *_Ptr, size_type _Count)
  2535. ; 1123 : { // assign [_Ptr, _Ptr + _Count)
  2536. ; 1124 : #if _ITERATOR_DEBUG_LEVEL == 2
  2537. ; 1125 : if (_Count != 0)
  2538. ; 1126 : _DEBUG_POINTER(_Ptr);
  2539. ; 1127 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  2540. ; 1128 :
  2541. ; 1129 : if (_Inside(_Ptr))
  2542. ; 1130 : return (assign(*this,
  2543. ; 1131 : _Ptr - this->_Myptr(), _Count)); // substring
  2544. ; 1132 :
  2545. ; 1133 : if (_Grow(_Count))
  2546. ; 1134 : { // make room and assign new stuff
  2547. ; 1135 : _Traits::copy(this->_Myptr(), _Ptr, _Count);
  2548. ; 1136 : _Eos(_Count);
  2549. ; 1137 : }
  2550. ; 1138 : return (*this);
  2551. ; 1139 : }
  2552. ; 1140 :
  2553. ; 1141 : _Myt& assign(const _Elem *_Ptr)
  2554. ; 1142 : { // assign [_Ptr, <null>)
  2555. ; 1143 : _DEBUG_POINTER(_Ptr);
  2556. ; 1144 : return (assign(_Ptr, _Traits::length(_Ptr)));
  2557. ; 1145 : }
  2558. ; 1146 :
  2559. ; 1147 : _Myt& assign(size_type _Count, _Elem _Ch)
  2560. ; 1148 : { // assign _Count * _Ch
  2561. ; 1149 : if (_Count == npos)
  2562. ; 1150 : _Xlen(); // result too long
  2563. ; 1151 :
  2564. ; 1152 : if (_Grow(_Count))
  2565. ; 1153 : { // make room and assign new stuff
  2566. ; 1154 : _Chassign(0, _Count, _Ch);
  2567. ; 1155 : _Eos(_Count);
  2568. ; 1156 : }
  2569. ; 1157 : return (*this);
  2570. ; 1158 : }
  2571. ; 1159 :
  2572. ; 1160 : template<class _Iter>
  2573. ; 1161 : typename enable_if<_Is_iterator<_Iter>::value,
  2574. ; 1162 : _Myt&>::type
  2575. ; 1163 : assign(_Iter _First, _Iter _Last)
  2576. ; 1164 : { // assign [First, _Last), input iterators
  2577. ; 1165 : return (replace(begin(), end(), _First, _Last));
  2578. ; 1166 : }
  2579. ; 1167 :
  2580. ; 1168 : _Myt& assign(const_pointer _First, const_pointer _Last)
  2581. ; 1169 : { // assign [First, _Last), const pointers
  2582. ; 1170 : return (replace(begin(), end(), _First, _Last));
  2583. ; 1171 : }
  2584. ; 1172 :
  2585. ; 1173 : _Myt& assign(const_iterator _First, const_iterator _Last)
  2586. ; 1174 : { // assign [First, _Last), const_iterators
  2587. ; 1175 : return (replace(begin(), end(), _First, _Last));
  2588. ; 1176 : }
  2589. ; 1177 :
  2590. ; 1178 : _Myt& insert(size_type _Off, const _Myt& _Right)
  2591. ; 1179 : { // insert _Right at _Off
  2592. ; 1180 : return (insert(_Off, _Right, 0, npos));
  2593. ; 1181 : }
  2594. ; 1182 :
  2595. ; 1183 : _Myt& insert(size_type _Off,
  2596. ; 1184 : const _Myt& _Right, size_type _Roff, size_type _Count)
  2597. ; 1185 : { // insert _Right [_Roff, _Roff + _Count) at _Off
  2598. ; 1186 : if (this->_Mysize < _Off || _Right.size() < _Roff)
  2599. ; 1187 : _Xran(); // _Off or _Roff off end
  2600. ; 1188 : size_type _Num = _Right.size() - _Roff;
  2601. ; 1189 : if (_Num < _Count)
  2602. ; 1190 : _Count = _Num; // trim _Count to size
  2603. ; 1191 : if (npos - this->_Mysize <= _Count)
  2604. ; 1192 : _Xlen(); // result too long
  2605. ; 1193 :
  2606. ; 1194 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  2607. ; 1195 : { // make room and insert new stuff
  2608. ; 1196 : _Traits::move(this->_Myptr() + _Off + _Count,
  2609. ; 1197 : this->_Myptr() + _Off,
  2610. ; 1198 : this->_Mysize - _Off); // empty out hole
  2611. ; 1199 : if (this == &_Right)
  2612. ; 1200 : _Traits::move(this->_Myptr() + _Off,
  2613. ; 1201 : this->_Myptr() + (_Off < _Roff ? _Roff + _Count : _Roff),
  2614. ; 1202 : _Count); // substring
  2615. ; 1203 : else
  2616. ; 1204 : _Traits::copy(this->_Myptr() + _Off,
  2617. ; 1205 : _Right._Myptr() + _Roff, _Count); // fill hole
  2618. ; 1206 : _Eos(_Num);
  2619. ; 1207 : }
  2620. ; 1208 : return (*this);
  2621. ; 1209 : }
  2622. ; 1210 :
  2623. ; 1211 : _Myt& insert(size_type _Off,
  2624. ; 1212 : const _Elem *_Ptr, size_type _Count)
  2625. ; 1213 : { // insert [_Ptr, _Ptr + _Count) at _Off
  2626. ; 1214 : #if _ITERATOR_DEBUG_LEVEL == 2
  2627. ; 1215 : if (_Count != 0)
  2628. ; 1216 : _DEBUG_POINTER(_Ptr);
  2629. ; 1217 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  2630. ; 1218 :
  2631. ; 1219 : if (_Inside(_Ptr))
  2632. ; 1220 : return (insert(_Off, *this,
  2633. ; 1221 : _Ptr - this->_Myptr(), _Count)); // substring
  2634. ; 1222 : if (this->_Mysize < _Off)
  2635. ; 1223 : _Xran(); // _Off off end
  2636. ; 1224 : if (npos - this->_Mysize <= _Count)
  2637. ; 1225 : _Xlen(); // result too long
  2638. ; 1226 : size_type _Num;
  2639. ; 1227 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  2640. ; 1228 : { // make room and insert new stuff
  2641. ; 1229 : _Traits::move(this->_Myptr() + _Off + _Count,
  2642. ; 1230 : this->_Myptr() + _Off,
  2643. ; 1231 : this->_Mysize - _Off); // empty out hole
  2644. ; 1232 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
  2645. ; 1233 : _Eos(_Num);
  2646. ; 1234 : }
  2647. ; 1235 : return (*this);
  2648. ; 1236 : }
  2649. ; 1237 :
  2650. ; 1238 : _Myt& insert(size_type _Off, const _Elem *_Ptr)
  2651. ; 1239 : { // insert [_Ptr, <null>) at _Off
  2652. ; 1240 : _DEBUG_POINTER(_Ptr);
  2653. ; 1241 : return (insert(_Off, _Ptr, _Traits::length(_Ptr)));
  2654. ; 1242 : }
  2655. ; 1243 :
  2656. ; 1244 : _Myt& insert(size_type _Off,
  2657. ; 1245 : size_type _Count, _Elem _Ch)
  2658. ; 1246 : { // insert _Count * _Ch at _Off
  2659. ; 1247 : if (this->_Mysize < _Off)
  2660. ; 1248 : _Xran(); // _Off off end
  2661. ; 1249 : if (npos - this->_Mysize <= _Count)
  2662. ; 1250 : _Xlen(); // result too long
  2663. ; 1251 : size_type _Num;
  2664. ; 1252 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  2665. ; 1253 : { // make room and insert new stuff
  2666. ; 1254 : _Traits::move(this->_Myptr() + _Off + _Count,
  2667. ; 1255 : this->_Myptr() + _Off,
  2668. ; 1256 : this->_Mysize - _Off); // empty out hole
  2669. ; 1257 : _Chassign(_Off, _Count, _Ch); // fill hole
  2670. ; 1258 : _Eos(_Num);
  2671. ; 1259 : }
  2672. ; 1260 : return (*this);
  2673. ; 1261 : }
  2674. ; 1262 :
  2675. ; 1263 : iterator insert(const_iterator _Where)
  2676. ; 1264 : { // insert <null> at _Where
  2677. ; 1265 : return (insert(_Where, _Elem()));
  2678. ; 1266 : }
  2679. ; 1267 :
  2680. ; 1268 : iterator insert(const_iterator _Where, _Elem _Ch)
  2681. ; 1269 : { // insert _Ch at _Where
  2682. ; 1270 : size_type _Off = _Pdif(_Where, begin());
  2683. ; 1271 : insert(_Off, 1, _Ch);
  2684. ; 1272 : return (begin() + _Off);
  2685. ; 1273 : }
  2686. ; 1274 :
  2687. ; 1275 : iterator insert(const_iterator _Where, size_type _Count, _Elem _Ch)
  2688. ; 1276 : { // insert _Count * _Elem at _Where
  2689. ; 1277 : size_type _Off = _Pdif(_Where, begin());
  2690. ; 1278 : insert(_Off, _Count, _Ch);
  2691. ; 1279 : return (begin() + _Off);
  2692. ; 1280 : }
  2693. ; 1281 :
  2694. ; 1282 : template<class _Iter>
  2695. ; 1283 : typename enable_if<_Is_iterator<_Iter>::value,
  2696. ; 1284 : iterator>::type
  2697. ; 1285 : insert(const_iterator _Where, _Iter _First, _Iter _Last)
  2698. ; 1286 : { // insert [_First, _Last) at _Where, input iterators
  2699. ; 1287 : size_type _Off = _Pdif(_Where, begin());
  2700. ; 1288 : replace(_Where, _Where, _First, _Last);
  2701. ; 1289 : return (begin() + _Off);
  2702. ; 1290 : }
  2703. ; 1291 :
  2704. ; 1292 : iterator insert(const_iterator _Where,
  2705. ; 1293 : const_pointer _First, const_pointer _Last)
  2706. ; 1294 : { // insert [_First, _Last) at _Where, const pointers
  2707. ; 1295 : size_type _Off = _Pdif(_Where, begin());
  2708. ; 1296 : replace(_Where, _Where, _First, _Last);
  2709. ; 1297 : return (begin() + _Off);
  2710. ; 1298 : }
  2711. ; 1299 :
  2712. ; 1300 : iterator insert(const_iterator _Where,
  2713. ; 1301 : const_iterator _First, const_iterator _Last)
  2714. ; 1302 : { // insert [_First, _Last) at _Where, const_iterators
  2715. ; 1303 : size_type _Off = _Pdif(_Where, begin());
  2716. ; 1304 : replace(_Where, _Where, _First, _Last);
  2717. ; 1305 : return (begin() + _Off);
  2718. ; 1306 : }
  2719. ; 1307 :
  2720. ; 1308 : _Myt& erase(size_type _Off = 0)
  2721. ; 1309 : { // erase elements [_Off, ...)
  2722. ; 1310 : if (this->_Mysize < _Off)
  2723.  
  2724. cmp DWORD PTR [esi+16], eax
  2725. jae SHORT $LN15@assign
  2726.  
  2727. ; 2219 : }
  2728. ; 2220 :
  2729. ; 2221 : bool _Grow(size_type _Newsize,
  2730. ; 2222 : bool _Trim = false)
  2731. ; 2223 : { // ensure buffer is big enough, trim to size if _Trim is true
  2732. ; 2224 : if (max_size() < _Newsize)
  2733. ; 2225 : _Xlen(); // result too long
  2734. ; 2226 : if (this->_Myres < _Newsize)
  2735. ; 2227 : _Copy(_Newsize, this->_Mysize); // reallocate to grow
  2736. ; 2228 : else if (_Trim && _Newsize < this->_BUF_SIZE)
  2737. ; 2229 : _Tidy(true, // copy and deallocate if trimming to small string
  2738. ; 2230 : _Newsize < this->_Mysize ? _Newsize : this->_Mysize);
  2739. ; 2231 : else if (_Newsize == 0)
  2740. ; 2232 : _Eos(0); // new size is zero, just null terminate
  2741. ; 2233 : return (0 < _Newsize); // return true only if more work to do
  2742. ; 2234 : }
  2743. ; 2235 :
  2744. ; 2236 : bool _Inside(const _Elem *_Ptr)
  2745. ; 2237 : { // test if _Ptr points inside string
  2746. ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
  2747. ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
  2748. ; 2240 : return (false); // don't ask
  2749. ; 2241 : else
  2750. ; 2242 : return (true);
  2751. ; 2243 : }
  2752. ; 2244 :
  2753. ; 2245 : static size_type _Pdif(const_iterator _P2,
  2754. ; 2246 : const_iterator _P1)
  2755. ; 2247 : { // compute safe iterator difference
  2756. ; 2248 : return (_STRING_ITER_BASE(_P2) == 0 ? 0 : _P2 - _P1);
  2757. ; 2249 : }
  2758. ; 2250 :
  2759. ; 2251 : void _Tidy(bool _Built = false,
  2760. ; 2252 : size_type _Newsize = 0)
  2761. ; 2253 : { // initialize buffer, deallocating any storage
  2762. ; 2254 : if (!_Built)
  2763. ; 2255 : ;
  2764. ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
  2765. ; 2257 : { // copy any leftovers to small buffer and deallocate
  2766. ; 2258 : pointer _Ptr = this->_Bx._Ptr;
  2767. ; 2259 : this->_Getal().destroy(&this->_Bx._Ptr);
  2768. ; 2260 : if (0 < _Newsize)
  2769. ; 2261 : _Traits::copy(this->_Bx._Buf,
  2770. ; 2262 : _STD addressof(*_Ptr), _Newsize);
  2771. ; 2263 : this->_Getal().deallocate(_Ptr, this->_Myres + 1);
  2772. ; 2264 : }
  2773. ; 2265 : this->_Myres = this->_BUF_SIZE - 1;
  2774. ; 2266 : _Eos(_Newsize);
  2775. ; 2267 : }
  2776. ; 2268 :
  2777. ; 2269 : __declspec(noreturn) void _Xlen() const
  2778. ; 2270 : { // report a length_error
  2779. ; 2271 : _Xlength_error("string too long");
  2780. ; 2272 : }
  2781. ; 2273 :
  2782. ; 2274 : __declspec(noreturn) void _Xran() const
  2783. ; 2275 : { // report an out_of_range error
  2784. ; 2276 : _Xout_of_range("invalid string position");
  2785.  
  2786. push OFFSET ??_C@_0BI@CFPLBAOH@invalid?5string?5position?$AA@
  2787. call DWORD PTR __imp_?_Xout_of_range@std@@YAXPBD@Z
  2788. $LN60@assign:
  2789. $LN15@assign:
  2790.  
  2791. ; 517 : : this->_Bx._Buf);
  2792.  
  2793. cmp DWORD PTR [esi+20], 16 ; 00000010H
  2794.  
  2795. ; 1311 : _Xran(); // _Off off end
  2796. ; 1312 : _Eos(_Off);
  2797. ; 1313 : return (*this);
  2798. ; 1314 : }
  2799. ; 1315 :
  2800. ; 1316 : _Myt& erase(size_type _Off, size_type _Count)
  2801. ; 1317 : { // erase elements [_Off, _Off + _Count)
  2802. ; 1318 : if (this->_Mysize < _Off)
  2803. ; 1319 : _Xran(); // _Off off end
  2804. ; 1320 : if (this->_Mysize - _Off <= _Count)
  2805. ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
  2806. ; 1322 : else if (0 < _Count)
  2807. ; 1323 : { // move elements down
  2808. ; 1324 : value_type *_Ptr = this->_Myptr() + _Off;
  2809. ; 1325 : size_type _Newsize = this->_Mysize - _Count;
  2810. ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
  2811. ; 1327 : _Eos(_Newsize);
  2812. ; 1328 : }
  2813. ; 1329 : return (*this);
  2814. ; 1330 : }
  2815. ; 1331 :
  2816. ; 1332 : iterator erase(const_iterator _Where)
  2817. ; 1333 : { // erase element at _Where
  2818. ; 1334 : size_type _Count = _Pdif(_Where, begin());
  2819. ; 1335 : erase(_Count, 1);
  2820. ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  2821. ; 1337 : }
  2822. ; 1338 :
  2823. ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
  2824. ; 1340 : { // erase substring [_First, _Last)
  2825. ; 1341 : _DEBUG_RANGE(_First, _Last);
  2826. ; 1342 : size_type _Count = _Pdif(_First, begin());
  2827. ; 1343 : erase(_Count, _Pdif(_Last, _First));
  2828. ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  2829. ; 1345 : }
  2830. ; 1346 :
  2831. ; 1347 : void clear() _NOEXCEPT
  2832. ; 1348 : { // erase all
  2833. ; 1349 : _Eos(0);
  2834. ; 1350 : }
  2835. ; 1351 :
  2836. ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
  2837. ; 1353 : { // replace [_Off, _Off + _N0) with _Right
  2838. ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
  2839. ; 1355 : }
  2840. ; 1356 :
  2841. ; 1357 : _Myt& replace(size_type _Off,
  2842. ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
  2843. ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  2844. ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
  2845. ; 1361 : _Xran(); // _Off or _Roff off end
  2846. ; 1362 : if (this->_Mysize - _Off < _N0)
  2847. ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  2848. ; 1364 : size_type _Num = _Right.size() - _Roff;
  2849. ; 1365 : if (_Num < _Count)
  2850. ; 1366 : _Count = _Num; // trim _Count to size
  2851. ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
  2852. ; 1368 : _Xlen(); // result too long
  2853. ; 1369 :
  2854. ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
  2855. ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
  2856. ; 1372 : if (this->_Mysize < _Newsize)
  2857. ; 1373 : _Grow(_Newsize);
  2858. ; 1374 :
  2859. ; 1375 : if (this != &_Right)
  2860. ; 1376 : { // no overlap, just move down and copy in new stuff
  2861. ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
  2862. ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
  2863. ; 1379 : _Traits::copy(this->_Myptr() + _Off,
  2864. ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
  2865. ; 1381 : }
  2866. ; 1382 : else if (_Count <= _N0)
  2867. ; 1383 : { // hole doesn't get larger, just copy in substring
  2868. ; 1384 : _Traits::move(this->_Myptr() + _Off,
  2869. ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
  2870. ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
  2871. ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  2872. ; 1388 : }
  2873. ; 1389 : else if (_Roff <= _Off)
  2874. ; 1390 : { // hole gets larger, substring begins before hole
  2875. ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
  2876. ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  2877. ; 1393 : _Traits::move(this->_Myptr() + _Off,
  2878. ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
  2879. ; 1395 : }
  2880. ; 1396 : else if (_Off + _N0 <= _Roff)
  2881. ; 1397 : { // hole gets larger, substring begins after hole
  2882. ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
  2883. ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  2884. ; 1400 : _Traits::move(this->_Myptr() + _Off,
  2885. ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
  2886. ; 1402 : _Count); // fill hole
  2887. ; 1403 : }
  2888. ; 1404 : else
  2889. ; 1405 : { // hole gets larger, substring begins in hole
  2890. ; 1406 : _Traits::move(this->_Myptr() + _Off,
  2891. ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
  2892. ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
  2893. ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  2894. ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
  2895. ; 1411 : this->_Myptr() + _Roff + _Count,
  2896. ; 1412 : _Count - _N0); // fill rest of new hole
  2897. ; 1413 : }
  2898. ; 1414 :
  2899. ; 1415 : _Eos(_Newsize);
  2900. ; 1416 : return (*this);
  2901. ; 1417 : }
  2902. ; 1418 :
  2903. ; 1419 : _Myt& replace(size_type _Off,
  2904. ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
  2905. ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  2906. ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
  2907. ; 1423 : if (_Count != 0)
  2908. ; 1424 : _DEBUG_POINTER(_Ptr);
  2909. ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  2910. ; 1426 :
  2911. ; 1427 : if (_Inside(_Ptr))
  2912. ; 1428 : return (replace(_Off, _N0, *this,
  2913. ; 1429 : _Ptr - this->_Myptr(),
  2914. ; 1430 : _Count)); // substring, replace carefully
  2915. ; 1431 : if (this->_Mysize < _Off)
  2916. ; 1432 : _Xran(); // _Off off end
  2917. ; 1433 : if (this->_Mysize - _Off < _N0)
  2918. ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  2919. ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
  2920. ; 1436 : _Xlen(); // result too long
  2921. ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
  2922. ; 1438 :
  2923. ; 1439 : if (_Count < _N0)
  2924. ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
  2925. ; 1441 : this->_Myptr() + _Off + _N0,
  2926. ; 1442 : _Nm); // smaller hole, move tail up
  2927. ; 1443 : size_type _Num;
  2928. ; 1444 : if ((0 < _Count || 0 < _N0)
  2929. ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  2930. ; 1446 : { // make room and rearrange
  2931. ; 1447 : if (_N0 < _Count)
  2932. ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
  2933. ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  2934. ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
  2935. ; 1451 : _Eos(_Num);
  2936. ; 1452 : }
  2937. ; 1453 : return (*this);
  2938. ; 1454 : }
  2939. ; 1455 :
  2940. ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
  2941. ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
  2942. ; 1458 : _DEBUG_POINTER(_Ptr);
  2943. ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  2944. ; 1460 : }
  2945. ; 1461 :
  2946. ; 1462 : _Myt& replace(size_type _Off,
  2947. ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
  2948. ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
  2949. ; 1465 : if (this->_Mysize < _Off)
  2950. ; 1466 : _Xran(); // _Off off end
  2951. ; 1467 : if (this->_Mysize - _Off < _N0)
  2952. ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  2953. ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
  2954. ; 1470 : _Xlen(); // result too long
  2955. ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
  2956. ; 1472 :
  2957. ; 1473 : if (_Count < _N0)
  2958. ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
  2959. ; 1475 : this->_Myptr() + _Off + _N0,
  2960. ; 1476 : _Nm); // smaller hole, move tail up
  2961. ; 1477 : size_type _Num;
  2962. ; 1478 : if ((0 < _Count || 0 < _N0)
  2963. ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  2964. ; 1480 : { // make room and rearrange
  2965. ; 1481 : if (_N0 < _Count)
  2966. ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
  2967. ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  2968. ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
  2969. ; 1485 : _Eos(_Num);
  2970. ; 1486 : }
  2971. ; 1487 : return (*this);
  2972. ; 1488 : }
  2973. ; 1489 :
  2974. ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
  2975. ; 1491 : const _Myt& _Right)
  2976. ; 1492 : { // replace [_First, _Last) with _Right
  2977. ; 1493 : return (replace(
  2978. ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
  2979. ; 1495 : }
  2980. ; 1496 :
  2981. ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
  2982. ; 1498 : const _Elem *_Ptr, size_type _Count)
  2983. ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
  2984. ; 1500 : return (replace(
  2985. ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
  2986. ; 1502 : }
  2987. ; 1503 :
  2988. ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
  2989. ; 1505 : const _Elem *_Ptr)
  2990. ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
  2991. ; 1507 : return (replace(
  2992. ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
  2993. ; 1509 : }
  2994. ; 1510 :
  2995. ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
  2996. ; 1512 : size_type _Count, _Elem _Ch)
  2997. ; 1513 : { // replace [_First, _Last) with _Count * _Ch
  2998. ; 1514 : return (replace(
  2999. ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
  3000. ; 1516 : }
  3001. ; 1517 :
  3002. ; 1518 : template<class _Iter>
  3003. ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
  3004. ; 1520 : _Myt&>::type
  3005. ; 1521 : replace(const_iterator _First, const_iterator _Last,
  3006. ; 1522 : _Iter _First2, _Iter _Last2)
  3007. ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
  3008. ; 1524 : _Myt _Right(_First2, _Last2);
  3009. ; 1525 : replace(_First, _Last, _Right);
  3010. ; 1526 : return (*this);
  3011. ; 1527 : }
  3012. ; 1528 :
  3013. ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
  3014. ; 1530 : const_pointer _First2, const_pointer _Last2)
  3015. ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  3016. ; 1532 : if (_First2 == _Last2)
  3017. ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  3018. ; 1534 : else
  3019. ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  3020. ; 1536 : &*_First2, _Last2 - _First2);
  3021. ; 1537 : return (*this);
  3022. ; 1538 : }
  3023. ; 1539 :
  3024. ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
  3025. ; 1541 : pointer _First2, pointer _Last2)
  3026. ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  3027. ; 1543 : if (_First2 == _Last2)
  3028. ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  3029. ; 1545 : else
  3030. ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  3031. ; 1547 : &*_First2, _Last2 - _First2);
  3032. ; 1548 : return (*this);
  3033. ; 1549 : }
  3034. ; 1550 :
  3035. ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
  3036. ; 1552 : const_iterator _First2, const_iterator _Last2)
  3037. ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  3038. ; 1554 : if (_First2 == _Last2)
  3039. ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  3040. ; 1556 : else
  3041. ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  3042. ; 1558 : &*_First2, _Last2 - _First2);
  3043. ; 1559 : return (*this);
  3044. ; 1560 : }
  3045. ; 1561 :
  3046. ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
  3047. ; 1563 : iterator _First2, iterator _Last2)
  3048. ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  3049. ; 1565 : if (_First2 == _Last2)
  3050. ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  3051. ; 1567 : else
  3052. ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  3053. ; 1569 : &*_First2, _Last2 - _First2);
  3054. ; 1570 : return (*this);
  3055. ; 1571 : }
  3056. ; 1572 :
  3057. ; 1573 : iterator begin() _NOEXCEPT
  3058. ; 1574 : { // return iterator for beginning of mutable sequence
  3059. ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
  3060. ; 1576 : }
  3061. ; 1577 :
  3062. ; 1578 : const_iterator begin() const _NOEXCEPT
  3063. ; 1579 : { // return iterator for beginning of nonmutable sequence
  3064. ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
  3065. ; 1581 : }
  3066. ; 1582 :
  3067. ; 1583 : iterator end() _NOEXCEPT
  3068. ; 1584 : { // return iterator for end of mutable sequence
  3069. ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
  3070. ; 1586 : }
  3071. ; 1587 :
  3072. ; 1588 : const_iterator end() const _NOEXCEPT
  3073. ; 1589 : { // return iterator for end of nonmutable sequence
  3074. ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
  3075. ; 1591 : }
  3076. ; 1592 :
  3077. ; 1593 : reverse_iterator rbegin() _NOEXCEPT
  3078. ; 1594 : { // return iterator for beginning of reversed mutable sequence
  3079. ; 1595 : return (reverse_iterator(end()));
  3080. ; 1596 : }
  3081. ; 1597 :
  3082. ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
  3083. ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
  3084. ; 1600 : return (const_reverse_iterator(end()));
  3085. ; 1601 : }
  3086. ; 1602 :
  3087. ; 1603 : reverse_iterator rend() _NOEXCEPT
  3088. ; 1604 : { // return iterator for end of reversed mutable sequence
  3089. ; 1605 : return (reverse_iterator(begin()));
  3090. ; 1606 : }
  3091. ; 1607 :
  3092. ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
  3093. ; 1609 : { // return iterator for end of reversed nonmutable sequence
  3094. ; 1610 : return (const_reverse_iterator(begin()));
  3095. ; 1611 : }
  3096. ; 1612 :
  3097. ; 1613 : #if _HAS_CPP0X
  3098. ; 1614 : const_iterator cbegin() const _NOEXCEPT
  3099. ; 1615 : { // return iterator for beginning of nonmutable sequence
  3100. ; 1616 : return (((const _Myt *)this)->begin());
  3101. ; 1617 : }
  3102. ; 1618 :
  3103. ; 1619 : const_iterator cend() const _NOEXCEPT
  3104. ; 1620 : { // return iterator for end of nonmutable sequence
  3105. ; 1621 : return (((const _Myt *)this)->end());
  3106. ; 1622 : }
  3107. ; 1623 :
  3108. ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
  3109. ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
  3110. ; 1626 : return (((const _Myt *)this)->rbegin());
  3111. ; 1627 : }
  3112. ; 1628 :
  3113. ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
  3114. ; 1630 : { // return iterator for end of reversed nonmutable sequence
  3115. ; 1631 : return (((const _Myt *)this)->rend());
  3116. ; 1632 : }
  3117. ; 1633 :
  3118. ; 1634 : void shrink_to_fit()
  3119. ; 1635 : { // reduce capacity
  3120. ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
  3121. ; 1637 : { // worth shrinking, do it
  3122. ; 1638 : _Myt _Tmp(*this);
  3123. ; 1639 : swap(_Tmp);
  3124. ; 1640 : }
  3125. ; 1641 : }
  3126. ; 1642 : #endif /* _HAS_CPP0X */
  3127. ; 1643 :
  3128. ; 1644 : reference at(size_type _Off)
  3129. ; 1645 : { // subscript mutable sequence with checking
  3130. ; 1646 : if (this->_Mysize <= _Off)
  3131. ; 1647 : _Xran(); // _Off off end
  3132. ; 1648 : return (this->_Myptr()[_Off]);
  3133. ; 1649 : }
  3134. ; 1650 :
  3135. ; 1651 : const_reference at(size_type _Off) const
  3136. ; 1652 : { // subscript nonmutable sequence with checking
  3137. ; 1653 : if (this->_Mysize <= _Off)
  3138. ; 1654 : _Xran(); // _Off off end
  3139. ; 1655 : return (this->_Myptr()[_Off]);
  3140. ; 1656 : }
  3141. ; 1657 :
  3142. ; 1658 : reference operator[](size_type _Off)
  3143. ; 1659 : { // subscript mutable sequence
  3144. ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
  3145. ; 1661 : if (this->_Mysize < _Off) // sic
  3146. ; 1662 : _DEBUG_ERROR("string subscript out of range");
  3147. ; 1663 :
  3148. ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
  3149. ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  3150. ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3151. ; 1667 :
  3152. ; 1668 : return (this->_Myptr()[_Off]);
  3153. ; 1669 : }
  3154. ; 1670 :
  3155. ; 1671 : const_reference operator[](size_type _Off) const
  3156. ; 1672 : { // subscript nonmutable sequence
  3157. ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
  3158. ; 1674 : if (this->_Mysize < _Off) // sic
  3159. ; 1675 : _DEBUG_ERROR("string subscript out of range");
  3160. ; 1676 :
  3161. ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
  3162. ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  3163. ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3164. ; 1680 :
  3165. ; 1681 : return (this->_Myptr()[_Off]);
  3166. ; 1682 : }
  3167. ; 1683 :
  3168. ; 1684 : void push_back(_Elem _Ch)
  3169. ; 1685 : { // insert element at end
  3170. ; 1686 : insert(end(), _Ch);
  3171. ; 1687 : }
  3172. ; 1688 :
  3173. ; 1689 : #if _HAS_CPP0X
  3174. ; 1690 : void pop_back()
  3175. ; 1691 : { // erase element at end
  3176. ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
  3177. ; 1693 : }
  3178. ; 1694 :
  3179. ; 1695 : reference front()
  3180. ; 1696 : { // return first element of mutable sequence
  3181. ; 1697 : return (*begin());
  3182. ; 1698 : }
  3183. ; 1699 :
  3184. ; 1700 : const_reference front() const
  3185. ; 1701 : { // return first element of nonmutable sequence
  3186. ; 1702 : return (*begin());
  3187. ; 1703 : }
  3188. ; 1704 :
  3189. ; 1705 : reference back()
  3190. ; 1706 : { // return last element of mutable sequence
  3191. ; 1707 : return (*(end() - 1));
  3192. ; 1708 : }
  3193. ; 1709 :
  3194. ; 1710 : const_reference back() const
  3195. ; 1711 : { // return last element of nonmutable sequence
  3196. ; 1712 : return (*(end() - 1));
  3197. ; 1713 : }
  3198. ; 1714 : #endif /* _HAS_CPP0X */
  3199. ; 1715 :
  3200. ; 1716 : const _Elem *c_str() const _NOEXCEPT
  3201. ; 1717 : { // return pointer to null-terminated nonmutable array
  3202. ; 1718 : return (this->_Myptr());
  3203. ; 1719 : }
  3204. ; 1720 :
  3205. ; 1721 : const _Elem *data() const _NOEXCEPT
  3206. ; 1722 : { // return pointer to nonmutable array
  3207. ; 1723 : return (c_str());
  3208. ; 1724 : }
  3209. ; 1725 :
  3210. ; 1726 : size_type length() const _NOEXCEPT
  3211. ; 1727 : { // return length of sequence
  3212. ; 1728 : return (this->_Mysize);
  3213. ; 1729 : }
  3214. ; 1730 :
  3215. ; 1731 : size_type size() const _NOEXCEPT
  3216. ; 1732 : { // return length of sequence
  3217. ; 1733 : return (this->_Mysize);
  3218. ; 1734 : }
  3219. ; 1735 :
  3220. ; 1736 : size_type max_size() const _NOEXCEPT
  3221. ; 1737 : { // return maximum possible length of sequence
  3222. ; 1738 : size_type _Num = this->_Getal().max_size();
  3223. ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
  3224. ; 1740 : }
  3225. ; 1741 :
  3226. ; 1742 : void resize(size_type _Newsize)
  3227. ; 1743 : { // determine new length, padding with null elements as needed
  3228. ; 1744 : resize(_Newsize, _Elem());
  3229. ; 1745 : }
  3230. ; 1746 :
  3231. ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
  3232. ; 1748 : { // determine new length, padding with _Ch elements as needed
  3233. ; 1749 : if (_Newsize <= this->_Mysize)
  3234. ; 1750 : _Eos(_Newsize);
  3235. ; 1751 : else
  3236. ; 1752 : append(_Newsize - this->_Mysize, _Ch);
  3237. ; 1753 : }
  3238. ; 1754 :
  3239. ; 1755 : size_type capacity() const _NOEXCEPT
  3240. ; 1756 : { // return current length of allocated storage
  3241. ; 1757 : return (this->_Myres);
  3242. ; 1758 : }
  3243. ; 1759 :
  3244. ; 1760 : void reserve(size_type _Newcap = 0)
  3245. ; 1761 : { // determine new minimum length of allocated storage
  3246. ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
  3247. ; 1763 : { // change reservation
  3248. ; 1764 : size_type _Size = this->_Mysize;
  3249. ; 1765 : if (_Grow(_Newcap, true))
  3250. ; 1766 : _Eos(_Size);
  3251. ; 1767 : }
  3252. ; 1768 : }
  3253. ; 1769 :
  3254. ; 1770 : bool empty() const _NOEXCEPT
  3255. ; 1771 : { // test if sequence is empty
  3256. ; 1772 : return (this->_Mysize == 0);
  3257. ; 1773 : }
  3258. ; 1774 :
  3259. ; 1775 : _SCL_INSECURE_DEPRECATE
  3260. ; 1776 :
  3261. ; 1777 : size_type copy(_Elem *_Ptr,
  3262. ; 1778 : size_type _Count, size_type _Off = 0) const
  3263. ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
  3264. ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
  3265. ; 1781 : if (_Count != 0)
  3266. ; 1782 : _DEBUG_POINTER(_Ptr);
  3267. ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3268. ; 1784 :
  3269. ; 1785 : if (this->_Mysize < _Off)
  3270. ; 1786 : _Xran(); // _Off off end
  3271. ; 1787 : if (this->_Mysize - _Off < _Count)
  3272. ; 1788 : _Count = this->_Mysize - _Off;
  3273. ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
  3274. ; 1790 : return (_Count);
  3275. ; 1791 : }
  3276. ; 1792 :
  3277. ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
  3278. ; 1794 : size_type _Count, size_type _Off = 0) const
  3279. ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
  3280. ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
  3281. ; 1797 : if (_Count != 0)
  3282. ; 1798 : _DEBUG_POINTER(_Dest);
  3283. ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3284. ; 1800 :
  3285. ; 1801 : if (this->_Mysize < _Off)
  3286. ; 1802 : _Xran(); // _Off off end
  3287. ; 1803 : if (this->_Mysize - _Off < _Count)
  3288. ; 1804 : _Count = this->_Mysize - _Off;
  3289. ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
  3290. ; 1806 : return (_Count);
  3291. ; 1807 : }
  3292. ; 1808 :
  3293. ; 1809 : void _Swap_bx(_Myt& _Right)
  3294. ; 1810 : { // exchange _Bx with _Right._Bx
  3295. ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
  3296. ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
  3297. ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
  3298. ; 1814 : else
  3299. ; 1815 : { // swap large with small
  3300. ; 1816 : pointer _Ptr = this->_Bx._Ptr;
  3301. ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
  3302. ; 1818 : _Traits::copy(this->_Bx._Buf,
  3303. ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
  3304. ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
  3305. ; 1821 : }
  3306. ; 1822 : else
  3307. ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
  3308. ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
  3309. ; 1825 : else
  3310. ; 1826 : { // swap small with large
  3311. ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
  3312. ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
  3313. ; 1829 : _Traits::copy(_Right._Bx._Buf,
  3314. ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
  3315. ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  3316. ; 1832 : }
  3317. ; 1833 : }
  3318. ; 1834 :
  3319. ; 1835 : void swap(_Myt& _Right)
  3320. ; 1836 : { // exchange contents with _Right
  3321. ; 1837 : if (this == &_Right)
  3322. ; 1838 : ; // same object, do nothing
  3323. ; 1839 : else if (this->_Getal() == _Right._Getal())
  3324. ; 1840 : { // same allocator, swap control information
  3325. ; 1841 : this->_Swap_all(_Right);
  3326. ; 1842 : _Swap_bx(_Right);
  3327. ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
  3328. ; 1844 : _STD swap(this->_Myres, _Right._Myres);
  3329. ; 1845 : }
  3330. ; 1846 :
  3331. ; 1847 : #if _HAS_CPP0X
  3332. ; 1848 : else if (_Alty::propagate_on_container_swap::value)
  3333. ; 1849 : { // swap allocators and control information
  3334. ; 1850 : this->_Swap_alloc(_Right);
  3335. ; 1851 : _Swap_bx(_Right);
  3336. ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
  3337. ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
  3338. ; 1854 : _STD swap(this->_Myres, _Right._Myres);
  3339. ; 1855 : }
  3340. ; 1856 : #endif /* _HAS_CPP0X */
  3341. ; 1857 :
  3342. ; 1858 : else
  3343. ; 1859 : { // different allocator, do multiple assigns
  3344. ; 1860 : _Myt _Tmp = *this;
  3345. ; 1861 :
  3346. ; 1862 : *this = _Right;
  3347. ; 1863 : _Right = _Tmp;
  3348. ; 1864 : }
  3349. ; 1865 : }
  3350. ; 1866 :
  3351. ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
  3352. ; 1868 : { // look for _Right beginning at or after _Off
  3353. ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
  3354. ; 1870 : }
  3355. ; 1871 :
  3356. ; 1872 : size_type find(const _Elem *_Ptr,
  3357. ; 1873 : size_type _Off, size_type _Count) const
  3358. ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
  3359. ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
  3360. ; 1876 : if (_Count != 0)
  3361. ; 1877 : _DEBUG_POINTER(_Ptr);
  3362. ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3363. ; 1879 :
  3364. ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
  3365. ; 1881 : return (_Off); // null string always matches (if inside string)
  3366. ; 1882 :
  3367. ; 1883 : size_type _Nm;
  3368. ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
  3369. ; 1885 : { // room for match, look for it
  3370. ; 1886 : const _Elem *_Uptr, *_Vptr;
  3371. ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
  3372. ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
  3373. ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
  3374. ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
  3375. ; 1891 : return (_Uptr - this->_Myptr()); // found a match
  3376. ; 1892 : }
  3377. ; 1893 :
  3378. ; 1894 : return (npos); // no match
  3379. ; 1895 : }
  3380. ; 1896 :
  3381. ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
  3382. ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
  3383. ; 1899 : _DEBUG_POINTER(_Ptr);
  3384. ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
  3385. ; 1901 : }
  3386. ; 1902 :
  3387. ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
  3388. ; 1904 : { // look for _Ch at or after _Off
  3389. ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
  3390. ; 1906 : }
  3391. ; 1907 :
  3392. ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
  3393. ; 1909 : { // look for _Right beginning before _Off
  3394. ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
  3395. ; 1911 : }
  3396. ; 1912 :
  3397. ; 1913 : size_type rfind(const _Elem *_Ptr,
  3398. ; 1914 : size_type _Off, size_type _Count) const
  3399. ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
  3400. ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
  3401. ; 1917 : if (_Count != 0)
  3402. ; 1918 : _DEBUG_POINTER(_Ptr);
  3403. ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3404. ; 1920 :
  3405. ; 1921 : if (_Count == 0)
  3406. ; 1922 : return (_Off < this->_Mysize ? _Off
  3407. ; 1923 : : this->_Mysize); // null always matches
  3408. ; 1924 : if (_Count <= this->_Mysize)
  3409. ; 1925 : { // room for match, look for it
  3410. ; 1926 : const _Elem *_Uptr = this->_Myptr() +
  3411. ; 1927 : (_Off < this->_Mysize - _Count ? _Off
  3412. ; 1928 : : this->_Mysize - _Count);
  3413. ; 1929 : for (; ; --_Uptr)
  3414. ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
  3415. ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
  3416. ; 1932 : return (_Uptr - this->_Myptr()); // found a match
  3417. ; 1933 : else if (_Uptr == this->_Myptr())
  3418. ; 1934 : break; // at beginning, no more chance for match
  3419. ; 1935 : }
  3420. ; 1936 :
  3421. ; 1937 : return (npos); // no match
  3422. ; 1938 : }
  3423. ; 1939 :
  3424. ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
  3425. ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
  3426. ; 1942 : _DEBUG_POINTER(_Ptr);
  3427. ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
  3428. ; 1944 : }
  3429. ; 1945 :
  3430. ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
  3431. ; 1947 : { // look for _Ch before _Off
  3432. ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  3433. ; 1949 : }
  3434. ; 1950 :
  3435. ; 1951 : size_type find_first_of(const _Myt& _Right,
  3436. ; 1952 : size_type _Off = 0) const _NOEXCEPT
  3437. ; 1953 : { // look for one of _Right at or after _Off
  3438. ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
  3439. ; 1955 : }
  3440. ; 1956 :
  3441. ; 1957 : size_type find_first_of(const _Elem *_Ptr,
  3442. ; 1958 : size_type _Off, size_type _Count) const
  3443. ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
  3444. ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
  3445. ; 1961 : if (_Count != 0)
  3446. ; 1962 : _DEBUG_POINTER(_Ptr);
  3447. ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3448. ; 1964 :
  3449. ; 1965 : if (0 < _Count && _Off < this->_Mysize)
  3450. ; 1966 : { // room for match, look for it
  3451. ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  3452. ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  3453. ; 1969 : _Uptr < _Vptr; ++_Uptr)
  3454. ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  3455. ; 1971 : return (_Uptr - this->_Myptr()); // found a match
  3456. ; 1972 : }
  3457. ; 1973 :
  3458. ; 1974 : return (npos); // no match
  3459. ; 1975 : }
  3460. ; 1976 :
  3461. ; 1977 : size_type find_first_of(const _Elem *_Ptr,
  3462. ; 1978 : size_type _Off = 0) const
  3463. ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
  3464. ; 1980 : _DEBUG_POINTER(_Ptr);
  3465. ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
  3466. ; 1982 : }
  3467. ; 1983 :
  3468. ; 1984 : size_type find_first_of(_Elem _Ch,
  3469. ; 1985 : size_type _Off = 0) const
  3470. ; 1986 : { // look for _Ch at or after _Off
  3471. ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
  3472. ; 1988 : }
  3473. ; 1989 :
  3474. ; 1990 : size_type find_last_of(const _Myt& _Right,
  3475. ; 1991 : size_type _Off = npos) const _NOEXCEPT
  3476. ; 1992 : { // look for one of _Right before _Off
  3477. ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
  3478. ; 1994 : }
  3479. ; 1995 :
  3480. ; 1996 : size_type find_last_of(const _Elem *_Ptr,
  3481. ; 1997 : size_type _Off, size_type _Count) const
  3482. ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
  3483. ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
  3484. ; 2000 : if (_Count != 0)
  3485. ; 2001 : _DEBUG_POINTER(_Ptr);
  3486. ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3487. ; 2003 :
  3488. ; 2004 : if (0 < _Count && 0 < this->_Mysize)
  3489. ; 2005 : { // worth searching, do it
  3490. ; 2006 : const _Elem *_Uptr = this->_Myptr()
  3491. ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  3492. ; 2008 : for (; ; --_Uptr)
  3493. ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  3494. ; 2010 : return (_Uptr - this->_Myptr()); // found a match
  3495. ; 2011 : else if (_Uptr == this->_Myptr())
  3496. ; 2012 : break; // at beginning, no more chance for match
  3497. ; 2013 : }
  3498. ; 2014 :
  3499. ; 2015 : return (npos); // no match
  3500. ; 2016 : }
  3501. ; 2017 :
  3502. ; 2018 : size_type find_last_of(const _Elem *_Ptr,
  3503. ; 2019 : size_type _Off = npos) const
  3504. ; 2020 : { // look for one of [_Ptr, <null>) before _Off
  3505. ; 2021 : _DEBUG_POINTER(_Ptr);
  3506. ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
  3507. ; 2023 : }
  3508. ; 2024 :
  3509. ; 2025 : size_type find_last_of(_Elem _Ch,
  3510. ; 2026 : size_type _Off = npos) const
  3511. ; 2027 : { // look for _Ch before _Off
  3512. ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  3513. ; 2029 : }
  3514. ; 2030 :
  3515. ; 2031 : size_type find_first_not_of(const _Myt& _Right,
  3516. ; 2032 : size_type _Off = 0) const _NOEXCEPT
  3517. ; 2033 : { // look for none of _Right at or after _Off
  3518. ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
  3519. ; 2035 : _Right.size()));
  3520. ; 2036 : }
  3521. ; 2037 :
  3522. ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
  3523. ; 2039 : size_type _Off, size_type _Count) const
  3524. ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
  3525. ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
  3526. ; 2042 : if (_Count != 0)
  3527. ; 2043 : _DEBUG_POINTER(_Ptr);
  3528. ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3529. ; 2045 :
  3530. ; 2046 : if (_Off < this->_Mysize)
  3531. ; 2047 : { // room for match, look for it
  3532. ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  3533. ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  3534. ; 2050 : _Uptr < _Vptr; ++_Uptr)
  3535. ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  3536. ; 2052 : return (_Uptr - this->_Myptr());
  3537. ; 2053 : }
  3538. ; 2054 : return (npos);
  3539. ; 2055 : }
  3540. ; 2056 :
  3541. ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
  3542. ; 2058 : size_type _Off = 0) const
  3543. ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
  3544. ; 2060 : _DEBUG_POINTER(_Ptr);
  3545. ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  3546. ; 2062 : }
  3547. ; 2063 :
  3548. ; 2064 : size_type find_first_not_of(_Elem _Ch,
  3549. ; 2065 : size_type _Off = 0) const
  3550. ; 2066 : { // look for non _Ch at or after _Off
  3551. ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
  3552. ; 2068 : }
  3553. ; 2069 :
  3554. ; 2070 : size_type find_last_not_of(const _Myt& _Right,
  3555. ; 2071 : size_type _Off = npos) const _NOEXCEPT
  3556. ; 2072 : { // look for none of _Right before _Off
  3557. ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
  3558. ; 2074 : }
  3559. ; 2075 :
  3560. ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
  3561. ; 2077 : size_type _Off, size_type _Count) const
  3562. ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
  3563. ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
  3564. ; 2080 : if (_Count != 0)
  3565. ; 2081 : _DEBUG_POINTER(_Ptr);
  3566. ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3567. ; 2083 :
  3568. ; 2084 : if (0 < this->_Mysize)
  3569. ; 2085 : { // worth searching, do it
  3570. ; 2086 : const _Elem *_Uptr = this->_Myptr()
  3571. ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  3572. ; 2088 : for (; ; --_Uptr)
  3573. ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  3574. ; 2090 : return (_Uptr - this->_Myptr());
  3575. ; 2091 : else if (_Uptr == this->_Myptr())
  3576. ; 2092 : break;
  3577. ; 2093 : }
  3578. ; 2094 : return (npos);
  3579. ; 2095 : }
  3580. ; 2096 :
  3581. ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
  3582. ; 2098 : size_type _Off = npos) const
  3583. ; 2099 : { // look for none of [_Ptr, <null>) before _Off
  3584. ; 2100 : _DEBUG_POINTER(_Ptr);
  3585. ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  3586. ; 2102 : }
  3587. ; 2103 :
  3588. ; 2104 : size_type find_last_not_of(_Elem _Ch,
  3589. ; 2105 : size_type _Off = npos) const
  3590. ; 2106 : { // look for non _Ch before _Off
  3591. ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
  3592. ; 2108 : }
  3593. ; 2109 :
  3594. ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
  3595. ; 2111 : { // return [_Off, _Off + _Count) as new string
  3596. ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
  3597. ; 2113 : }
  3598. ; 2114 :
  3599. ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
  3600. ; 2116 : { // compare [0, _Mysize) with _Right
  3601. ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
  3602. ; 2118 : }
  3603. ; 2119 :
  3604. ; 2120 : int compare(size_type _Off, size_type _N0,
  3605. ; 2121 : const _Myt& _Right) const
  3606. ; 2122 : { // compare [_Off, _Off + _N0) with _Right
  3607. ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
  3608. ; 2124 : }
  3609. ; 2125 :
  3610. ; 2126 : int compare(size_type _Off,
  3611. ; 2127 : size_type _N0, const _Myt& _Right,
  3612. ; 2128 : size_type _Roff, size_type _Count) const
  3613. ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  3614. ; 2130 : if (_Right.size() < _Roff)
  3615. ; 2131 : _Xran(); // _Off off end
  3616. ; 2132 : if (_Right._Mysize - _Roff < _Count)
  3617. ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
  3618. ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
  3619. ; 2135 : }
  3620. ; 2136 :
  3621. ; 2137 : int compare(const _Elem *_Ptr) const
  3622. ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
  3623. ; 2139 : _DEBUG_POINTER(_Ptr);
  3624. ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
  3625. ; 2141 : }
  3626. ; 2142 :
  3627. ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
  3628. ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
  3629. ; 2145 : _DEBUG_POINTER(_Ptr);
  3630. ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  3631. ; 2147 : }
  3632. ; 2148 :
  3633. ; 2149 : int compare(size_type _Off,
  3634. ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
  3635. ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  3636. ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
  3637. ; 2153 : if (_Count != 0)
  3638. ; 2154 : _DEBUG_POINTER(_Ptr);
  3639. ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3640. ; 2156 :
  3641. ; 2157 : if (this->_Mysize < _Off)
  3642. ; 2158 : _Xran(); // _Off off end
  3643. ; 2159 : if (this->_Mysize - _Off < _N0)
  3644. ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  3645. ; 2161 :
  3646. ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
  3647. ; 2163 : _N0 < _Count ? _N0 : _Count);
  3648. ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
  3649. ; 2165 : : _N0 == _Count ? 0 : +1);
  3650. ; 2166 : }
  3651. ; 2167 :
  3652. ; 2168 : allocator_type get_allocator() const _NOEXCEPT
  3653. ; 2169 : { // return allocator object for values
  3654. ; 2170 : return (this->_Getal());
  3655. ; 2171 : }
  3656. ; 2172 :
  3657. ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
  3658. ; 2174 : { // assign _Count copies of _Ch beginning at _Off
  3659. ; 2175 : if (_Count == 1)
  3660. ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
  3661. ; 2177 : else
  3662. ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
  3663. ; 2179 : }
  3664. ; 2180 :
  3665. ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
  3666. ; 2182 : { // copy _Oldlen elements to newly allocated buffer
  3667. ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
  3668. ; 2184 : if (max_size() < _Newres)
  3669. ; 2185 : _Newres = _Newsize; // undo roundup if too big
  3670. ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
  3671. ; 2187 : ;
  3672. ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
  3673. ; 2189 : _Newres = this->_Myres
  3674. ; 2190 : + this->_Myres / 2; // grow exponentially if possible
  3675. ; 2191 : else
  3676. ; 2192 : _Newres = max_size(); // settle for max_size()
  3677. ; 2193 :
  3678. ; 2194 : _Elem *_Ptr;
  3679. ; 2195 : _TRY_BEGIN
  3680. ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
  3681. ; 2197 : _CATCH_ALL
  3682. ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
  3683. ; 2199 : _TRY_BEGIN
  3684. ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
  3685. ; 2201 : _CATCH_ALL
  3686. ; 2202 : _Tidy(true); // failed again, discard storage and reraise
  3687. ; 2203 : _RERAISE;
  3688. ; 2204 : _CATCH_END
  3689. ; 2205 : _CATCH_END
  3690. ; 2206 :
  3691. ; 2207 : if (0 < _Oldlen)
  3692. ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
  3693. ; 2209 : _Oldlen); // copy existing elements
  3694. ; 2210 : _Tidy(true);
  3695. ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  3696. ; 2212 : this->_Myres = _Newres;
  3697. ; 2213 : _Eos(_Oldlen);
  3698. ; 2214 : }
  3699. ; 2215 :
  3700. ; 2216 : void _Eos(size_type _Newsize)
  3701. ; 2217 : { // set new length and null terminator
  3702. ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
  3703.  
  3704. mov DWORD PTR [esi+16], eax
  3705.  
  3706. ; 517 : : this->_Bx._Buf);
  3707.  
  3708. jb SHORT $LN25@assign
  3709. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  3710.  
  3711. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  3712.  
  3713. mov edx, DWORD PTR [esi]
  3714. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  3715.  
  3716. ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
  3717.  
  3718. push ecx
  3719. push ecx
  3720. mov ecx, esi
  3721. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  3722.  
  3723. ; 564 : _Left = _Right;
  3724.  
  3725. mov BYTE PTR [eax+edx], 0
  3726. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  3727.  
  3728. ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
  3729.  
  3730. 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
  3731. pop edi
  3732.  
  3733. ; 1119 : return (*this);
  3734.  
  3735. mov eax, esi
  3736. pop esi
  3737. pop ebx
  3738.  
  3739. ; 1120 : }
  3740.  
  3741. pop ebp
  3742. ret 12 ; 0000000cH
  3743. $LN25@assign:
  3744.  
  3745. ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
  3746.  
  3747. push ecx
  3748.  
  3749. ; 517 : : this->_Bx._Buf);
  3750.  
  3751. mov edx, esi
  3752.  
  3753. ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
  3754.  
  3755. push ecx
  3756. mov ecx, esi
  3757. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  3758.  
  3759. ; 564 : _Left = _Right;
  3760.  
  3761. mov BYTE PTR [eax+edx], 0
  3762. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  3763.  
  3764. ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
  3765.  
  3766. 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
  3767. pop edi
  3768.  
  3769. ; 1119 : return (*this);
  3770.  
  3771. mov eax, esi
  3772. pop esi
  3773. pop ebx
  3774.  
  3775. ; 1120 : }
  3776.  
  3777. pop ebp
  3778. ret 12 ; 0000000cH
  3779. $LN3@assign:
  3780.  
  3781. ; 1113 : else if (_Grow(_Num))
  3782.  
  3783. push ecx
  3784. push edi
  3785. mov ecx, esi
  3786. 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
  3787. test al, al
  3788. je SHORT $LN55@assign
  3789.  
  3790. ; 518 : }
  3791. ; 519 :
  3792. ; 520 : const value_type *_Myptr() const
  3793. ; 521 : { // determine current pointer to buffer for nonmutable string
  3794. ; 522 : return (this->_BUF_SIZE <= this->_Myres
  3795. ; 523 : ? _STD addressof(*this->_Bx._Ptr)
  3796. ; 524 : : this->_Bx._Buf);
  3797.  
  3798. cmp DWORD PTR [ebx+20], 16 ; 00000010H
  3799. jb SHORT $LN33@assign
  3800. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  3801.  
  3802. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  3803.  
  3804. mov ebx, DWORD PTR [ebx]
  3805. $LN33@assign:
  3806. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  3807.  
  3808. ; 517 : : this->_Bx._Buf);
  3809.  
  3810. cmp DWORD PTR [esi+20], 16 ; 00000010H
  3811. jb SHORT $LN39@assign
  3812. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  3813.  
  3814. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  3815.  
  3816. mov ecx, DWORD PTR [esi]
  3817. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  3818.  
  3819. ; 517 : : this->_Bx._Buf);
  3820.  
  3821. jmp SHORT $LN40@assign
  3822. $LN39@assign:
  3823. mov ecx, esi
  3824. $LN40@assign:
  3825. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  3826.  
  3827. ; 530 : : (_Elem *)_CSTD memcpy(_First1, _First2, _Count));
  3828.  
  3829. test edi, edi
  3830. je SHORT $LN46@assign
  3831. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  3832.  
  3833. ; 1116 : _Right._Myptr() + _Roff, _Num);
  3834.  
  3835. mov eax, DWORD PTR __Roff$[ebp]
  3836. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  3837.  
  3838. ; 530 : : (_Elem *)_CSTD memcpy(_First1, _First2, _Count));
  3839.  
  3840. push edi
  3841. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  3842.  
  3843. ; 1116 : _Right._Myptr() + _Roff, _Num);
  3844.  
  3845. add eax, ebx
  3846. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  3847.  
  3848. ; 530 : : (_Elem *)_CSTD memcpy(_First1, _First2, _Count));
  3849.  
  3850. push eax
  3851. push ecx
  3852. call _memcpy
  3853. add esp, 12 ; 0000000cH
  3854. $LN46@assign:
  3855. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  3856.  
  3857. ; 517 : : this->_Bx._Buf);
  3858.  
  3859. cmp DWORD PTR [esi+20], 16 ; 00000010H
  3860.  
  3861. ; 1311 : _Xran(); // _Off off end
  3862. ; 1312 : _Eos(_Off);
  3863. ; 1313 : return (*this);
  3864. ; 1314 : }
  3865. ; 1315 :
  3866. ; 1316 : _Myt& erase(size_type _Off, size_type _Count)
  3867. ; 1317 : { // erase elements [_Off, _Off + _Count)
  3868. ; 1318 : if (this->_Mysize < _Off)
  3869. ; 1319 : _Xran(); // _Off off end
  3870. ; 1320 : if (this->_Mysize - _Off <= _Count)
  3871. ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
  3872. ; 1322 : else if (0 < _Count)
  3873. ; 1323 : { // move elements down
  3874. ; 1324 : value_type *_Ptr = this->_Myptr() + _Off;
  3875. ; 1325 : size_type _Newsize = this->_Mysize - _Count;
  3876. ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
  3877. ; 1327 : _Eos(_Newsize);
  3878. ; 1328 : }
  3879. ; 1329 : return (*this);
  3880. ; 1330 : }
  3881. ; 1331 :
  3882. ; 1332 : iterator erase(const_iterator _Where)
  3883. ; 1333 : { // erase element at _Where
  3884. ; 1334 : size_type _Count = _Pdif(_Where, begin());
  3885. ; 1335 : erase(_Count, 1);
  3886. ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  3887. ; 1337 : }
  3888. ; 1338 :
  3889. ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
  3890. ; 1340 : { // erase substring [_First, _Last)
  3891. ; 1341 : _DEBUG_RANGE(_First, _Last);
  3892. ; 1342 : size_type _Count = _Pdif(_First, begin());
  3893. ; 1343 : erase(_Count, _Pdif(_Last, _First));
  3894. ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  3895. ; 1345 : }
  3896. ; 1346 :
  3897. ; 1347 : void clear() _NOEXCEPT
  3898. ; 1348 : { // erase all
  3899. ; 1349 : _Eos(0);
  3900. ; 1350 : }
  3901. ; 1351 :
  3902. ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
  3903. ; 1353 : { // replace [_Off, _Off + _N0) with _Right
  3904. ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
  3905. ; 1355 : }
  3906. ; 1356 :
  3907. ; 1357 : _Myt& replace(size_type _Off,
  3908. ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
  3909. ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  3910. ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
  3911. ; 1361 : _Xran(); // _Off or _Roff off end
  3912. ; 1362 : if (this->_Mysize - _Off < _N0)
  3913. ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  3914. ; 1364 : size_type _Num = _Right.size() - _Roff;
  3915. ; 1365 : if (_Num < _Count)
  3916. ; 1366 : _Count = _Num; // trim _Count to size
  3917. ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
  3918. ; 1368 : _Xlen(); // result too long
  3919. ; 1369 :
  3920. ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
  3921. ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
  3922. ; 1372 : if (this->_Mysize < _Newsize)
  3923. ; 1373 : _Grow(_Newsize);
  3924. ; 1374 :
  3925. ; 1375 : if (this != &_Right)
  3926. ; 1376 : { // no overlap, just move down and copy in new stuff
  3927. ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
  3928. ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
  3929. ; 1379 : _Traits::copy(this->_Myptr() + _Off,
  3930. ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
  3931. ; 1381 : }
  3932. ; 1382 : else if (_Count <= _N0)
  3933. ; 1383 : { // hole doesn't get larger, just copy in substring
  3934. ; 1384 : _Traits::move(this->_Myptr() + _Off,
  3935. ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
  3936. ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
  3937. ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  3938. ; 1388 : }
  3939. ; 1389 : else if (_Roff <= _Off)
  3940. ; 1390 : { // hole gets larger, substring begins before hole
  3941. ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
  3942. ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  3943. ; 1393 : _Traits::move(this->_Myptr() + _Off,
  3944. ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
  3945. ; 1395 : }
  3946. ; 1396 : else if (_Off + _N0 <= _Roff)
  3947. ; 1397 : { // hole gets larger, substring begins after hole
  3948. ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
  3949. ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  3950. ; 1400 : _Traits::move(this->_Myptr() + _Off,
  3951. ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
  3952. ; 1402 : _Count); // fill hole
  3953. ; 1403 : }
  3954. ; 1404 : else
  3955. ; 1405 : { // hole gets larger, substring begins in hole
  3956. ; 1406 : _Traits::move(this->_Myptr() + _Off,
  3957. ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
  3958. ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
  3959. ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  3960. ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
  3961. ; 1411 : this->_Myptr() + _Roff + _Count,
  3962. ; 1412 : _Count - _N0); // fill rest of new hole
  3963. ; 1413 : }
  3964. ; 1414 :
  3965. ; 1415 : _Eos(_Newsize);
  3966. ; 1416 : return (*this);
  3967. ; 1417 : }
  3968. ; 1418 :
  3969. ; 1419 : _Myt& replace(size_type _Off,
  3970. ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
  3971. ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  3972. ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
  3973. ; 1423 : if (_Count != 0)
  3974. ; 1424 : _DEBUG_POINTER(_Ptr);
  3975. ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  3976. ; 1426 :
  3977. ; 1427 : if (_Inside(_Ptr))
  3978. ; 1428 : return (replace(_Off, _N0, *this,
  3979. ; 1429 : _Ptr - this->_Myptr(),
  3980. ; 1430 : _Count)); // substring, replace carefully
  3981. ; 1431 : if (this->_Mysize < _Off)
  3982. ; 1432 : _Xran(); // _Off off end
  3983. ; 1433 : if (this->_Mysize - _Off < _N0)
  3984. ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  3985. ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
  3986. ; 1436 : _Xlen(); // result too long
  3987. ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
  3988. ; 1438 :
  3989. ; 1439 : if (_Count < _N0)
  3990. ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
  3991. ; 1441 : this->_Myptr() + _Off + _N0,
  3992. ; 1442 : _Nm); // smaller hole, move tail up
  3993. ; 1443 : size_type _Num;
  3994. ; 1444 : if ((0 < _Count || 0 < _N0)
  3995. ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  3996. ; 1446 : { // make room and rearrange
  3997. ; 1447 : if (_N0 < _Count)
  3998. ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
  3999. ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  4000. ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
  4001. ; 1451 : _Eos(_Num);
  4002. ; 1452 : }
  4003. ; 1453 : return (*this);
  4004. ; 1454 : }
  4005. ; 1455 :
  4006. ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
  4007. ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
  4008. ; 1458 : _DEBUG_POINTER(_Ptr);
  4009. ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  4010. ; 1460 : }
  4011. ; 1461 :
  4012. ; 1462 : _Myt& replace(size_type _Off,
  4013. ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
  4014. ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
  4015. ; 1465 : if (this->_Mysize < _Off)
  4016. ; 1466 : _Xran(); // _Off off end
  4017. ; 1467 : if (this->_Mysize - _Off < _N0)
  4018. ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  4019. ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
  4020. ; 1470 : _Xlen(); // result too long
  4021. ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
  4022. ; 1472 :
  4023. ; 1473 : if (_Count < _N0)
  4024. ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
  4025. ; 1475 : this->_Myptr() + _Off + _N0,
  4026. ; 1476 : _Nm); // smaller hole, move tail up
  4027. ; 1477 : size_type _Num;
  4028. ; 1478 : if ((0 < _Count || 0 < _N0)
  4029. ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  4030. ; 1480 : { // make room and rearrange
  4031. ; 1481 : if (_N0 < _Count)
  4032. ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
  4033. ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  4034. ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
  4035. ; 1485 : _Eos(_Num);
  4036. ; 1486 : }
  4037. ; 1487 : return (*this);
  4038. ; 1488 : }
  4039. ; 1489 :
  4040. ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
  4041. ; 1491 : const _Myt& _Right)
  4042. ; 1492 : { // replace [_First, _Last) with _Right
  4043. ; 1493 : return (replace(
  4044. ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
  4045. ; 1495 : }
  4046. ; 1496 :
  4047. ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
  4048. ; 1498 : const _Elem *_Ptr, size_type _Count)
  4049. ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
  4050. ; 1500 : return (replace(
  4051. ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
  4052. ; 1502 : }
  4053. ; 1503 :
  4054. ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
  4055. ; 1505 : const _Elem *_Ptr)
  4056. ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
  4057. ; 1507 : return (replace(
  4058. ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
  4059. ; 1509 : }
  4060. ; 1510 :
  4061. ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
  4062. ; 1512 : size_type _Count, _Elem _Ch)
  4063. ; 1513 : { // replace [_First, _Last) with _Count * _Ch
  4064. ; 1514 : return (replace(
  4065. ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
  4066. ; 1516 : }
  4067. ; 1517 :
  4068. ; 1518 : template<class _Iter>
  4069. ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
  4070. ; 1520 : _Myt&>::type
  4071. ; 1521 : replace(const_iterator _First, const_iterator _Last,
  4072. ; 1522 : _Iter _First2, _Iter _Last2)
  4073. ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
  4074. ; 1524 : _Myt _Right(_First2, _Last2);
  4075. ; 1525 : replace(_First, _Last, _Right);
  4076. ; 1526 : return (*this);
  4077. ; 1527 : }
  4078. ; 1528 :
  4079. ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
  4080. ; 1530 : const_pointer _First2, const_pointer _Last2)
  4081. ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  4082. ; 1532 : if (_First2 == _Last2)
  4083. ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  4084. ; 1534 : else
  4085. ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  4086. ; 1536 : &*_First2, _Last2 - _First2);
  4087. ; 1537 : return (*this);
  4088. ; 1538 : }
  4089. ; 1539 :
  4090. ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
  4091. ; 1541 : pointer _First2, pointer _Last2)
  4092. ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  4093. ; 1543 : if (_First2 == _Last2)
  4094. ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  4095. ; 1545 : else
  4096. ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  4097. ; 1547 : &*_First2, _Last2 - _First2);
  4098. ; 1548 : return (*this);
  4099. ; 1549 : }
  4100. ; 1550 :
  4101. ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
  4102. ; 1552 : const_iterator _First2, const_iterator _Last2)
  4103. ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  4104. ; 1554 : if (_First2 == _Last2)
  4105. ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  4106. ; 1556 : else
  4107. ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  4108. ; 1558 : &*_First2, _Last2 - _First2);
  4109. ; 1559 : return (*this);
  4110. ; 1560 : }
  4111. ; 1561 :
  4112. ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
  4113. ; 1563 : iterator _First2, iterator _Last2)
  4114. ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  4115. ; 1565 : if (_First2 == _Last2)
  4116. ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  4117. ; 1567 : else
  4118. ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  4119. ; 1569 : &*_First2, _Last2 - _First2);
  4120. ; 1570 : return (*this);
  4121. ; 1571 : }
  4122. ; 1572 :
  4123. ; 1573 : iterator begin() _NOEXCEPT
  4124. ; 1574 : { // return iterator for beginning of mutable sequence
  4125. ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
  4126. ; 1576 : }
  4127. ; 1577 :
  4128. ; 1578 : const_iterator begin() const _NOEXCEPT
  4129. ; 1579 : { // return iterator for beginning of nonmutable sequence
  4130. ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
  4131. ; 1581 : }
  4132. ; 1582 :
  4133. ; 1583 : iterator end() _NOEXCEPT
  4134. ; 1584 : { // return iterator for end of mutable sequence
  4135. ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
  4136. ; 1586 : }
  4137. ; 1587 :
  4138. ; 1588 : const_iterator end() const _NOEXCEPT
  4139. ; 1589 : { // return iterator for end of nonmutable sequence
  4140. ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
  4141. ; 1591 : }
  4142. ; 1592 :
  4143. ; 1593 : reverse_iterator rbegin() _NOEXCEPT
  4144. ; 1594 : { // return iterator for beginning of reversed mutable sequence
  4145. ; 1595 : return (reverse_iterator(end()));
  4146. ; 1596 : }
  4147. ; 1597 :
  4148. ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
  4149. ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
  4150. ; 1600 : return (const_reverse_iterator(end()));
  4151. ; 1601 : }
  4152. ; 1602 :
  4153. ; 1603 : reverse_iterator rend() _NOEXCEPT
  4154. ; 1604 : { // return iterator for end of reversed mutable sequence
  4155. ; 1605 : return (reverse_iterator(begin()));
  4156. ; 1606 : }
  4157. ; 1607 :
  4158. ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
  4159. ; 1609 : { // return iterator for end of reversed nonmutable sequence
  4160. ; 1610 : return (const_reverse_iterator(begin()));
  4161. ; 1611 : }
  4162. ; 1612 :
  4163. ; 1613 : #if _HAS_CPP0X
  4164. ; 1614 : const_iterator cbegin() const _NOEXCEPT
  4165. ; 1615 : { // return iterator for beginning of nonmutable sequence
  4166. ; 1616 : return (((const _Myt *)this)->begin());
  4167. ; 1617 : }
  4168. ; 1618 :
  4169. ; 1619 : const_iterator cend() const _NOEXCEPT
  4170. ; 1620 : { // return iterator for end of nonmutable sequence
  4171. ; 1621 : return (((const _Myt *)this)->end());
  4172. ; 1622 : }
  4173. ; 1623 :
  4174. ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
  4175. ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
  4176. ; 1626 : return (((const _Myt *)this)->rbegin());
  4177. ; 1627 : }
  4178. ; 1628 :
  4179. ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
  4180. ; 1630 : { // return iterator for end of reversed nonmutable sequence
  4181. ; 1631 : return (((const _Myt *)this)->rend());
  4182. ; 1632 : }
  4183. ; 1633 :
  4184. ; 1634 : void shrink_to_fit()
  4185. ; 1635 : { // reduce capacity
  4186. ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
  4187. ; 1637 : { // worth shrinking, do it
  4188. ; 1638 : _Myt _Tmp(*this);
  4189. ; 1639 : swap(_Tmp);
  4190. ; 1640 : }
  4191. ; 1641 : }
  4192. ; 1642 : #endif /* _HAS_CPP0X */
  4193. ; 1643 :
  4194. ; 1644 : reference at(size_type _Off)
  4195. ; 1645 : { // subscript mutable sequence with checking
  4196. ; 1646 : if (this->_Mysize <= _Off)
  4197. ; 1647 : _Xran(); // _Off off end
  4198. ; 1648 : return (this->_Myptr()[_Off]);
  4199. ; 1649 : }
  4200. ; 1650 :
  4201. ; 1651 : const_reference at(size_type _Off) const
  4202. ; 1652 : { // subscript nonmutable sequence with checking
  4203. ; 1653 : if (this->_Mysize <= _Off)
  4204. ; 1654 : _Xran(); // _Off off end
  4205. ; 1655 : return (this->_Myptr()[_Off]);
  4206. ; 1656 : }
  4207. ; 1657 :
  4208. ; 1658 : reference operator[](size_type _Off)
  4209. ; 1659 : { // subscript mutable sequence
  4210. ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
  4211. ; 1661 : if (this->_Mysize < _Off) // sic
  4212. ; 1662 : _DEBUG_ERROR("string subscript out of range");
  4213. ; 1663 :
  4214. ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
  4215. ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  4216. ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4217. ; 1667 :
  4218. ; 1668 : return (this->_Myptr()[_Off]);
  4219. ; 1669 : }
  4220. ; 1670 :
  4221. ; 1671 : const_reference operator[](size_type _Off) const
  4222. ; 1672 : { // subscript nonmutable sequence
  4223. ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
  4224. ; 1674 : if (this->_Mysize < _Off) // sic
  4225. ; 1675 : _DEBUG_ERROR("string subscript out of range");
  4226. ; 1676 :
  4227. ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
  4228. ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  4229. ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4230. ; 1680 :
  4231. ; 1681 : return (this->_Myptr()[_Off]);
  4232. ; 1682 : }
  4233. ; 1683 :
  4234. ; 1684 : void push_back(_Elem _Ch)
  4235. ; 1685 : { // insert element at end
  4236. ; 1686 : insert(end(), _Ch);
  4237. ; 1687 : }
  4238. ; 1688 :
  4239. ; 1689 : #if _HAS_CPP0X
  4240. ; 1690 : void pop_back()
  4241. ; 1691 : { // erase element at end
  4242. ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
  4243. ; 1693 : }
  4244. ; 1694 :
  4245. ; 1695 : reference front()
  4246. ; 1696 : { // return first element of mutable sequence
  4247. ; 1697 : return (*begin());
  4248. ; 1698 : }
  4249. ; 1699 :
  4250. ; 1700 : const_reference front() const
  4251. ; 1701 : { // return first element of nonmutable sequence
  4252. ; 1702 : return (*begin());
  4253. ; 1703 : }
  4254. ; 1704 :
  4255. ; 1705 : reference back()
  4256. ; 1706 : { // return last element of mutable sequence
  4257. ; 1707 : return (*(end() - 1));
  4258. ; 1708 : }
  4259. ; 1709 :
  4260. ; 1710 : const_reference back() const
  4261. ; 1711 : { // return last element of nonmutable sequence
  4262. ; 1712 : return (*(end() - 1));
  4263. ; 1713 : }
  4264. ; 1714 : #endif /* _HAS_CPP0X */
  4265. ; 1715 :
  4266. ; 1716 : const _Elem *c_str() const _NOEXCEPT
  4267. ; 1717 : { // return pointer to null-terminated nonmutable array
  4268. ; 1718 : return (this->_Myptr());
  4269. ; 1719 : }
  4270. ; 1720 :
  4271. ; 1721 : const _Elem *data() const _NOEXCEPT
  4272. ; 1722 : { // return pointer to nonmutable array
  4273. ; 1723 : return (c_str());
  4274. ; 1724 : }
  4275. ; 1725 :
  4276. ; 1726 : size_type length() const _NOEXCEPT
  4277. ; 1727 : { // return length of sequence
  4278. ; 1728 : return (this->_Mysize);
  4279. ; 1729 : }
  4280. ; 1730 :
  4281. ; 1731 : size_type size() const _NOEXCEPT
  4282. ; 1732 : { // return length of sequence
  4283. ; 1733 : return (this->_Mysize);
  4284. ; 1734 : }
  4285. ; 1735 :
  4286. ; 1736 : size_type max_size() const _NOEXCEPT
  4287. ; 1737 : { // return maximum possible length of sequence
  4288. ; 1738 : size_type _Num = this->_Getal().max_size();
  4289. ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
  4290. ; 1740 : }
  4291. ; 1741 :
  4292. ; 1742 : void resize(size_type _Newsize)
  4293. ; 1743 : { // determine new length, padding with null elements as needed
  4294. ; 1744 : resize(_Newsize, _Elem());
  4295. ; 1745 : }
  4296. ; 1746 :
  4297. ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
  4298. ; 1748 : { // determine new length, padding with _Ch elements as needed
  4299. ; 1749 : if (_Newsize <= this->_Mysize)
  4300. ; 1750 : _Eos(_Newsize);
  4301. ; 1751 : else
  4302. ; 1752 : append(_Newsize - this->_Mysize, _Ch);
  4303. ; 1753 : }
  4304. ; 1754 :
  4305. ; 1755 : size_type capacity() const _NOEXCEPT
  4306. ; 1756 : { // return current length of allocated storage
  4307. ; 1757 : return (this->_Myres);
  4308. ; 1758 : }
  4309. ; 1759 :
  4310. ; 1760 : void reserve(size_type _Newcap = 0)
  4311. ; 1761 : { // determine new minimum length of allocated storage
  4312. ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
  4313. ; 1763 : { // change reservation
  4314. ; 1764 : size_type _Size = this->_Mysize;
  4315. ; 1765 : if (_Grow(_Newcap, true))
  4316. ; 1766 : _Eos(_Size);
  4317. ; 1767 : }
  4318. ; 1768 : }
  4319. ; 1769 :
  4320. ; 1770 : bool empty() const _NOEXCEPT
  4321. ; 1771 : { // test if sequence is empty
  4322. ; 1772 : return (this->_Mysize == 0);
  4323. ; 1773 : }
  4324. ; 1774 :
  4325. ; 1775 : _SCL_INSECURE_DEPRECATE
  4326. ; 1776 :
  4327. ; 1777 : size_type copy(_Elem *_Ptr,
  4328. ; 1778 : size_type _Count, size_type _Off = 0) const
  4329. ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
  4330. ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
  4331. ; 1781 : if (_Count != 0)
  4332. ; 1782 : _DEBUG_POINTER(_Ptr);
  4333. ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4334. ; 1784 :
  4335. ; 1785 : if (this->_Mysize < _Off)
  4336. ; 1786 : _Xran(); // _Off off end
  4337. ; 1787 : if (this->_Mysize - _Off < _Count)
  4338. ; 1788 : _Count = this->_Mysize - _Off;
  4339. ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
  4340. ; 1790 : return (_Count);
  4341. ; 1791 : }
  4342. ; 1792 :
  4343. ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
  4344. ; 1794 : size_type _Count, size_type _Off = 0) const
  4345. ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
  4346. ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
  4347. ; 1797 : if (_Count != 0)
  4348. ; 1798 : _DEBUG_POINTER(_Dest);
  4349. ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4350. ; 1800 :
  4351. ; 1801 : if (this->_Mysize < _Off)
  4352. ; 1802 : _Xran(); // _Off off end
  4353. ; 1803 : if (this->_Mysize - _Off < _Count)
  4354. ; 1804 : _Count = this->_Mysize - _Off;
  4355. ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
  4356. ; 1806 : return (_Count);
  4357. ; 1807 : }
  4358. ; 1808 :
  4359. ; 1809 : void _Swap_bx(_Myt& _Right)
  4360. ; 1810 : { // exchange _Bx with _Right._Bx
  4361. ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
  4362. ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
  4363. ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
  4364. ; 1814 : else
  4365. ; 1815 : { // swap large with small
  4366. ; 1816 : pointer _Ptr = this->_Bx._Ptr;
  4367. ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
  4368. ; 1818 : _Traits::copy(this->_Bx._Buf,
  4369. ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
  4370. ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
  4371. ; 1821 : }
  4372. ; 1822 : else
  4373. ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
  4374. ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
  4375. ; 1825 : else
  4376. ; 1826 : { // swap small with large
  4377. ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
  4378. ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
  4379. ; 1829 : _Traits::copy(_Right._Bx._Buf,
  4380. ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
  4381. ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  4382. ; 1832 : }
  4383. ; 1833 : }
  4384. ; 1834 :
  4385. ; 1835 : void swap(_Myt& _Right)
  4386. ; 1836 : { // exchange contents with _Right
  4387. ; 1837 : if (this == &_Right)
  4388. ; 1838 : ; // same object, do nothing
  4389. ; 1839 : else if (this->_Getal() == _Right._Getal())
  4390. ; 1840 : { // same allocator, swap control information
  4391. ; 1841 : this->_Swap_all(_Right);
  4392. ; 1842 : _Swap_bx(_Right);
  4393. ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
  4394. ; 1844 : _STD swap(this->_Myres, _Right._Myres);
  4395. ; 1845 : }
  4396. ; 1846 :
  4397. ; 1847 : #if _HAS_CPP0X
  4398. ; 1848 : else if (_Alty::propagate_on_container_swap::value)
  4399. ; 1849 : { // swap allocators and control information
  4400. ; 1850 : this->_Swap_alloc(_Right);
  4401. ; 1851 : _Swap_bx(_Right);
  4402. ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
  4403. ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
  4404. ; 1854 : _STD swap(this->_Myres, _Right._Myres);
  4405. ; 1855 : }
  4406. ; 1856 : #endif /* _HAS_CPP0X */
  4407. ; 1857 :
  4408. ; 1858 : else
  4409. ; 1859 : { // different allocator, do multiple assigns
  4410. ; 1860 : _Myt _Tmp = *this;
  4411. ; 1861 :
  4412. ; 1862 : *this = _Right;
  4413. ; 1863 : _Right = _Tmp;
  4414. ; 1864 : }
  4415. ; 1865 : }
  4416. ; 1866 :
  4417. ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
  4418. ; 1868 : { // look for _Right beginning at or after _Off
  4419. ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
  4420. ; 1870 : }
  4421. ; 1871 :
  4422. ; 1872 : size_type find(const _Elem *_Ptr,
  4423. ; 1873 : size_type _Off, size_type _Count) const
  4424. ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
  4425. ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
  4426. ; 1876 : if (_Count != 0)
  4427. ; 1877 : _DEBUG_POINTER(_Ptr);
  4428. ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4429. ; 1879 :
  4430. ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
  4431. ; 1881 : return (_Off); // null string always matches (if inside string)
  4432. ; 1882 :
  4433. ; 1883 : size_type _Nm;
  4434. ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
  4435. ; 1885 : { // room for match, look for it
  4436. ; 1886 : const _Elem *_Uptr, *_Vptr;
  4437. ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
  4438. ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
  4439. ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
  4440. ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
  4441. ; 1891 : return (_Uptr - this->_Myptr()); // found a match
  4442. ; 1892 : }
  4443. ; 1893 :
  4444. ; 1894 : return (npos); // no match
  4445. ; 1895 : }
  4446. ; 1896 :
  4447. ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
  4448. ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
  4449. ; 1899 : _DEBUG_POINTER(_Ptr);
  4450. ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
  4451. ; 1901 : }
  4452. ; 1902 :
  4453. ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
  4454. ; 1904 : { // look for _Ch at or after _Off
  4455. ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
  4456. ; 1906 : }
  4457. ; 1907 :
  4458. ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
  4459. ; 1909 : { // look for _Right beginning before _Off
  4460. ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
  4461. ; 1911 : }
  4462. ; 1912 :
  4463. ; 1913 : size_type rfind(const _Elem *_Ptr,
  4464. ; 1914 : size_type _Off, size_type _Count) const
  4465. ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
  4466. ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
  4467. ; 1917 : if (_Count != 0)
  4468. ; 1918 : _DEBUG_POINTER(_Ptr);
  4469. ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4470. ; 1920 :
  4471. ; 1921 : if (_Count == 0)
  4472. ; 1922 : return (_Off < this->_Mysize ? _Off
  4473. ; 1923 : : this->_Mysize); // null always matches
  4474. ; 1924 : if (_Count <= this->_Mysize)
  4475. ; 1925 : { // room for match, look for it
  4476. ; 1926 : const _Elem *_Uptr = this->_Myptr() +
  4477. ; 1927 : (_Off < this->_Mysize - _Count ? _Off
  4478. ; 1928 : : this->_Mysize - _Count);
  4479. ; 1929 : for (; ; --_Uptr)
  4480. ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
  4481. ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
  4482. ; 1932 : return (_Uptr - this->_Myptr()); // found a match
  4483. ; 1933 : else if (_Uptr == this->_Myptr())
  4484. ; 1934 : break; // at beginning, no more chance for match
  4485. ; 1935 : }
  4486. ; 1936 :
  4487. ; 1937 : return (npos); // no match
  4488. ; 1938 : }
  4489. ; 1939 :
  4490. ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
  4491. ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
  4492. ; 1942 : _DEBUG_POINTER(_Ptr);
  4493. ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
  4494. ; 1944 : }
  4495. ; 1945 :
  4496. ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
  4497. ; 1947 : { // look for _Ch before _Off
  4498. ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  4499. ; 1949 : }
  4500. ; 1950 :
  4501. ; 1951 : size_type find_first_of(const _Myt& _Right,
  4502. ; 1952 : size_type _Off = 0) const _NOEXCEPT
  4503. ; 1953 : { // look for one of _Right at or after _Off
  4504. ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
  4505. ; 1955 : }
  4506. ; 1956 :
  4507. ; 1957 : size_type find_first_of(const _Elem *_Ptr,
  4508. ; 1958 : size_type _Off, size_type _Count) const
  4509. ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
  4510. ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
  4511. ; 1961 : if (_Count != 0)
  4512. ; 1962 : _DEBUG_POINTER(_Ptr);
  4513. ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4514. ; 1964 :
  4515. ; 1965 : if (0 < _Count && _Off < this->_Mysize)
  4516. ; 1966 : { // room for match, look for it
  4517. ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  4518. ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  4519. ; 1969 : _Uptr < _Vptr; ++_Uptr)
  4520. ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  4521. ; 1971 : return (_Uptr - this->_Myptr()); // found a match
  4522. ; 1972 : }
  4523. ; 1973 :
  4524. ; 1974 : return (npos); // no match
  4525. ; 1975 : }
  4526. ; 1976 :
  4527. ; 1977 : size_type find_first_of(const _Elem *_Ptr,
  4528. ; 1978 : size_type _Off = 0) const
  4529. ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
  4530. ; 1980 : _DEBUG_POINTER(_Ptr);
  4531. ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
  4532. ; 1982 : }
  4533. ; 1983 :
  4534. ; 1984 : size_type find_first_of(_Elem _Ch,
  4535. ; 1985 : size_type _Off = 0) const
  4536. ; 1986 : { // look for _Ch at or after _Off
  4537. ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
  4538. ; 1988 : }
  4539. ; 1989 :
  4540. ; 1990 : size_type find_last_of(const _Myt& _Right,
  4541. ; 1991 : size_type _Off = npos) const _NOEXCEPT
  4542. ; 1992 : { // look for one of _Right before _Off
  4543. ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
  4544. ; 1994 : }
  4545. ; 1995 :
  4546. ; 1996 : size_type find_last_of(const _Elem *_Ptr,
  4547. ; 1997 : size_type _Off, size_type _Count) const
  4548. ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
  4549. ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
  4550. ; 2000 : if (_Count != 0)
  4551. ; 2001 : _DEBUG_POINTER(_Ptr);
  4552. ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4553. ; 2003 :
  4554. ; 2004 : if (0 < _Count && 0 < this->_Mysize)
  4555. ; 2005 : { // worth searching, do it
  4556. ; 2006 : const _Elem *_Uptr = this->_Myptr()
  4557. ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  4558. ; 2008 : for (; ; --_Uptr)
  4559. ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  4560. ; 2010 : return (_Uptr - this->_Myptr()); // found a match
  4561. ; 2011 : else if (_Uptr == this->_Myptr())
  4562. ; 2012 : break; // at beginning, no more chance for match
  4563. ; 2013 : }
  4564. ; 2014 :
  4565. ; 2015 : return (npos); // no match
  4566. ; 2016 : }
  4567. ; 2017 :
  4568. ; 2018 : size_type find_last_of(const _Elem *_Ptr,
  4569. ; 2019 : size_type _Off = npos) const
  4570. ; 2020 : { // look for one of [_Ptr, <null>) before _Off
  4571. ; 2021 : _DEBUG_POINTER(_Ptr);
  4572. ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
  4573. ; 2023 : }
  4574. ; 2024 :
  4575. ; 2025 : size_type find_last_of(_Elem _Ch,
  4576. ; 2026 : size_type _Off = npos) const
  4577. ; 2027 : { // look for _Ch before _Off
  4578. ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  4579. ; 2029 : }
  4580. ; 2030 :
  4581. ; 2031 : size_type find_first_not_of(const _Myt& _Right,
  4582. ; 2032 : size_type _Off = 0) const _NOEXCEPT
  4583. ; 2033 : { // look for none of _Right at or after _Off
  4584. ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
  4585. ; 2035 : _Right.size()));
  4586. ; 2036 : }
  4587. ; 2037 :
  4588. ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
  4589. ; 2039 : size_type _Off, size_type _Count) const
  4590. ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
  4591. ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
  4592. ; 2042 : if (_Count != 0)
  4593. ; 2043 : _DEBUG_POINTER(_Ptr);
  4594. ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4595. ; 2045 :
  4596. ; 2046 : if (_Off < this->_Mysize)
  4597. ; 2047 : { // room for match, look for it
  4598. ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  4599. ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  4600. ; 2050 : _Uptr < _Vptr; ++_Uptr)
  4601. ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  4602. ; 2052 : return (_Uptr - this->_Myptr());
  4603. ; 2053 : }
  4604. ; 2054 : return (npos);
  4605. ; 2055 : }
  4606. ; 2056 :
  4607. ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
  4608. ; 2058 : size_type _Off = 0) const
  4609. ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
  4610. ; 2060 : _DEBUG_POINTER(_Ptr);
  4611. ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  4612. ; 2062 : }
  4613. ; 2063 :
  4614. ; 2064 : size_type find_first_not_of(_Elem _Ch,
  4615. ; 2065 : size_type _Off = 0) const
  4616. ; 2066 : { // look for non _Ch at or after _Off
  4617. ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
  4618. ; 2068 : }
  4619. ; 2069 :
  4620. ; 2070 : size_type find_last_not_of(const _Myt& _Right,
  4621. ; 2071 : size_type _Off = npos) const _NOEXCEPT
  4622. ; 2072 : { // look for none of _Right before _Off
  4623. ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
  4624. ; 2074 : }
  4625. ; 2075 :
  4626. ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
  4627. ; 2077 : size_type _Off, size_type _Count) const
  4628. ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
  4629. ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
  4630. ; 2080 : if (_Count != 0)
  4631. ; 2081 : _DEBUG_POINTER(_Ptr);
  4632. ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4633. ; 2083 :
  4634. ; 2084 : if (0 < this->_Mysize)
  4635. ; 2085 : { // worth searching, do it
  4636. ; 2086 : const _Elem *_Uptr = this->_Myptr()
  4637. ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  4638. ; 2088 : for (; ; --_Uptr)
  4639. ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  4640. ; 2090 : return (_Uptr - this->_Myptr());
  4641. ; 2091 : else if (_Uptr == this->_Myptr())
  4642. ; 2092 : break;
  4643. ; 2093 : }
  4644. ; 2094 : return (npos);
  4645. ; 2095 : }
  4646. ; 2096 :
  4647. ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
  4648. ; 2098 : size_type _Off = npos) const
  4649. ; 2099 : { // look for none of [_Ptr, <null>) before _Off
  4650. ; 2100 : _DEBUG_POINTER(_Ptr);
  4651. ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  4652. ; 2102 : }
  4653. ; 2103 :
  4654. ; 2104 : size_type find_last_not_of(_Elem _Ch,
  4655. ; 2105 : size_type _Off = npos) const
  4656. ; 2106 : { // look for non _Ch before _Off
  4657. ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
  4658. ; 2108 : }
  4659. ; 2109 :
  4660. ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
  4661. ; 2111 : { // return [_Off, _Off + _Count) as new string
  4662. ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
  4663. ; 2113 : }
  4664. ; 2114 :
  4665. ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
  4666. ; 2116 : { // compare [0, _Mysize) with _Right
  4667. ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
  4668. ; 2118 : }
  4669. ; 2119 :
  4670. ; 2120 : int compare(size_type _Off, size_type _N0,
  4671. ; 2121 : const _Myt& _Right) const
  4672. ; 2122 : { // compare [_Off, _Off + _N0) with _Right
  4673. ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
  4674. ; 2124 : }
  4675. ; 2125 :
  4676. ; 2126 : int compare(size_type _Off,
  4677. ; 2127 : size_type _N0, const _Myt& _Right,
  4678. ; 2128 : size_type _Roff, size_type _Count) const
  4679. ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  4680. ; 2130 : if (_Right.size() < _Roff)
  4681. ; 2131 : _Xran(); // _Off off end
  4682. ; 2132 : if (_Right._Mysize - _Roff < _Count)
  4683. ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
  4684. ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
  4685. ; 2135 : }
  4686. ; 2136 :
  4687. ; 2137 : int compare(const _Elem *_Ptr) const
  4688. ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
  4689. ; 2139 : _DEBUG_POINTER(_Ptr);
  4690. ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
  4691. ; 2141 : }
  4692. ; 2142 :
  4693. ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
  4694. ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
  4695. ; 2145 : _DEBUG_POINTER(_Ptr);
  4696. ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  4697. ; 2147 : }
  4698. ; 2148 :
  4699. ; 2149 : int compare(size_type _Off,
  4700. ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
  4701. ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  4702. ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
  4703. ; 2153 : if (_Count != 0)
  4704. ; 2154 : _DEBUG_POINTER(_Ptr);
  4705. ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  4706. ; 2156 :
  4707. ; 2157 : if (this->_Mysize < _Off)
  4708. ; 2158 : _Xran(); // _Off off end
  4709. ; 2159 : if (this->_Mysize - _Off < _N0)
  4710. ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  4711. ; 2161 :
  4712. ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
  4713. ; 2163 : _N0 < _Count ? _N0 : _Count);
  4714. ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
  4715. ; 2165 : : _N0 == _Count ? 0 : +1);
  4716. ; 2166 : }
  4717. ; 2167 :
  4718. ; 2168 : allocator_type get_allocator() const _NOEXCEPT
  4719. ; 2169 : { // return allocator object for values
  4720. ; 2170 : return (this->_Getal());
  4721. ; 2171 : }
  4722. ; 2172 :
  4723. ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
  4724. ; 2174 : { // assign _Count copies of _Ch beginning at _Off
  4725. ; 2175 : if (_Count == 1)
  4726. ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
  4727. ; 2177 : else
  4728. ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
  4729. ; 2179 : }
  4730. ; 2180 :
  4731. ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
  4732. ; 2182 : { // copy _Oldlen elements to newly allocated buffer
  4733. ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
  4734. ; 2184 : if (max_size() < _Newres)
  4735. ; 2185 : _Newres = _Newsize; // undo roundup if too big
  4736. ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
  4737. ; 2187 : ;
  4738. ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
  4739. ; 2189 : _Newres = this->_Myres
  4740. ; 2190 : + this->_Myres / 2; // grow exponentially if possible
  4741. ; 2191 : else
  4742. ; 2192 : _Newres = max_size(); // settle for max_size()
  4743. ; 2193 :
  4744. ; 2194 : _Elem *_Ptr;
  4745. ; 2195 : _TRY_BEGIN
  4746. ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
  4747. ; 2197 : _CATCH_ALL
  4748. ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
  4749. ; 2199 : _TRY_BEGIN
  4750. ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
  4751. ; 2201 : _CATCH_ALL
  4752. ; 2202 : _Tidy(true); // failed again, discard storage and reraise
  4753. ; 2203 : _RERAISE;
  4754. ; 2204 : _CATCH_END
  4755. ; 2205 : _CATCH_END
  4756. ; 2206 :
  4757. ; 2207 : if (0 < _Oldlen)
  4758. ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
  4759. ; 2209 : _Oldlen); // copy existing elements
  4760. ; 2210 : _Tidy(true);
  4761. ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  4762. ; 2212 : this->_Myres = _Newres;
  4763. ; 2213 : _Eos(_Oldlen);
  4764. ; 2214 : }
  4765. ; 2215 :
  4766. ; 2216 : void _Eos(size_type _Newsize)
  4767. ; 2217 : { // set new length and null terminator
  4768. ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
  4769.  
  4770. mov DWORD PTR [esi+16], edi
  4771.  
  4772. ; 517 : : this->_Bx._Buf);
  4773.  
  4774. jb SHORT $LN51@assign
  4775. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  4776.  
  4777. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  4778.  
  4779. mov eax, DWORD PTR [esi]
  4780. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  4781.  
  4782. ; 564 : _Left = _Right;
  4783.  
  4784. mov BYTE PTR [eax+edi], 0
  4785. pop edi
  4786. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  4787.  
  4788. ; 1119 : return (*this);
  4789.  
  4790. mov eax, esi
  4791. pop esi
  4792. pop ebx
  4793.  
  4794. ; 1120 : }
  4795.  
  4796. pop ebp
  4797. ret 12 ; 0000000cH
  4798. $LN51@assign:
  4799.  
  4800. ; 517 : : this->_Bx._Buf);
  4801.  
  4802. mov eax, esi
  4803. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  4804.  
  4805. ; 564 : _Left = _Right;
  4806.  
  4807. mov BYTE PTR [eax+edi], 0
  4808. $LN55@assign:
  4809. pop edi
  4810. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  4811.  
  4812. ; 1119 : return (*this);
  4813.  
  4814. mov eax, esi
  4815. pop esi
  4816. pop ebx
  4817.  
  4818. ; 1120 : }
  4819.  
  4820. pop ebp
  4821. ret 12 ; 0000000cH
  4822. $LN58@assign:
  4823. ?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
  4824. _TEXT ENDS
  4825. ; Function compile flags: /Ogtp
  4826. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  4827. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  4828. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  4829. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  4830. ; COMDAT ?_Grow@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE_NI_N@Z
  4831. _TEXT SEGMENT
  4832. __Newsize$ = 8 ; size = 4
  4833. __Trim$dead$ = 12 ; size = 1
  4834. ?_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
  4835. ; _this$ = ecx
  4836.  
  4837. ; 2223 : { // ensure buffer is big enough, trim to size if _Trim is true
  4838.  
  4839. push ebp
  4840. mov ebp, esp
  4841. push esi
  4842.  
  4843. ; 2224 : if (max_size() < _Newsize)
  4844.  
  4845. mov esi, DWORD PTR __Newsize$[ebp]
  4846. cmp esi, -2 ; fffffffeH
  4847. jbe SHORT $LN6@Grow
  4848.  
  4849. ; 2235 :
  4850. ; 2236 : bool _Inside(const _Elem *_Ptr)
  4851. ; 2237 : { // test if _Ptr points inside string
  4852. ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
  4853. ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
  4854. ; 2240 : return (false); // don't ask
  4855. ; 2241 : else
  4856. ; 2242 : return (true);
  4857. ; 2243 : }
  4858. ; 2244 :
  4859. ; 2245 : static size_type _Pdif(const_iterator _P2,
  4860. ; 2246 : const_iterator _P1)
  4861. ; 2247 : { // compute safe iterator difference
  4862. ; 2248 : return (_STRING_ITER_BASE(_P2) == 0 ? 0 : _P2 - _P1);
  4863. ; 2249 : }
  4864. ; 2250 :
  4865. ; 2251 : void _Tidy(bool _Built = false,
  4866. ; 2252 : size_type _Newsize = 0)
  4867. ; 2253 : { // initialize buffer, deallocating any storage
  4868. ; 2254 : if (!_Built)
  4869. ; 2255 : ;
  4870. ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
  4871. ; 2257 : { // copy any leftovers to small buffer and deallocate
  4872. ; 2258 : pointer _Ptr = this->_Bx._Ptr;
  4873. ; 2259 : this->_Getal().destroy(&this->_Bx._Ptr);
  4874. ; 2260 : if (0 < _Newsize)
  4875. ; 2261 : _Traits::copy(this->_Bx._Buf,
  4876. ; 2262 : _STD addressof(*_Ptr), _Newsize);
  4877. ; 2263 : this->_Getal().deallocate(_Ptr, this->_Myres + 1);
  4878. ; 2264 : }
  4879. ; 2265 : this->_Myres = this->_BUF_SIZE - 1;
  4880. ; 2266 : _Eos(_Newsize);
  4881. ; 2267 : }
  4882. ; 2268 :
  4883. ; 2269 : __declspec(noreturn) void _Xlen() const
  4884. ; 2270 : { // report a length_error
  4885. ; 2271 : _Xlength_error("string too long");
  4886.  
  4887. push OFFSET ??_C@_0BA@JFNIOLAK@string?5too?5long?$AA@
  4888. call DWORD PTR __imp_?_Xlength_error@std@@YAXPBD@Z
  4889. $LN68@Grow:
  4890. $LN6@Grow:
  4891.  
  4892. ; 2225 : _Xlen(); // result too long
  4893. ; 2226 : if (this->_Myres < _Newsize)
  4894.  
  4895. mov eax, DWORD PTR [ecx+20]
  4896. cmp eax, esi
  4897. jae SHORT $LN3@Grow
  4898.  
  4899. ; 2227 : _Copy(_Newsize, this->_Mysize); // reallocate to grow
  4900.  
  4901. push DWORD PTR [ecx+16]
  4902. push esi
  4903. 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
  4904.  
  4905. ; 2233 : return (0 < _Newsize); // return true only if more work to do
  4906.  
  4907. xor eax, eax
  4908. cmp eax, esi
  4909. sbb eax, eax
  4910. neg eax
  4911. pop esi
  4912.  
  4913. ; 2234 : }
  4914.  
  4915. pop ebp
  4916. ret 8
  4917. $LN3@Grow:
  4918.  
  4919. ; 2228 : else if (_Trim && _Newsize < this->_BUF_SIZE)
  4920. ; 2229 : _Tidy(true, // copy and deallocate if trimming to small string
  4921. ; 2230 : _Newsize < this->_Mysize ? _Newsize : this->_Mysize);
  4922. ; 2231 : else if (_Newsize == 0)
  4923.  
  4924. test esi, esi
  4925. jne SHORT $LN64@Grow
  4926.  
  4927. ; 518 : }
  4928. ; 519 :
  4929. ; 520 : const value_type *_Myptr() const
  4930. ; 521 : { // determine current pointer to buffer for nonmutable string
  4931. ; 522 : return (this->_BUF_SIZE <= this->_Myres
  4932. ; 523 : ? _STD addressof(*this->_Bx._Ptr)
  4933. ; 524 : : this->_Bx._Buf);
  4934. ; 525 : }
  4935. ; 526 :
  4936. ; 527 : union _Bxty
  4937. ; 528 : { // storage for small buffer or pointer to larger one
  4938. ; 529 : value_type _Buf[_BUF_SIZE];
  4939. ; 530 : pointer _Ptr;
  4940. ; 531 : char _Alias[_BUF_SIZE]; // to permit aliasing
  4941. ; 532 : } _Bx;
  4942. ; 533 :
  4943. ; 534 : size_type _Mysize; // current length of string
  4944. ; 535 : size_type _Myres; // current storage reserved for string
  4945. ; 536 : };
  4946. ; 537 :
  4947. ; 538 : // TEMPLATE CLASS _String_alloc
  4948. ; 539 : template<bool _Al_has_storage,
  4949. ; 540 : class _Alloc_types>
  4950. ; 541 : class _String_alloc
  4951. ; 542 : : public _String_val<typename _Alloc_types::_Val_types>
  4952. ; 543 : { // base class for basic_string to hold allocator with storage
  4953. ; 544 : public:
  4954. ; 545 : typedef _String_alloc<_Al_has_storage, _Alloc_types> _Myt;
  4955. ; 546 : typedef typename _Alloc_types::_Alloc _Alloc;
  4956. ; 547 :
  4957. ; 548 : typedef typename _Alloc_types::_Alty _Alty;
  4958. ; 549 :
  4959. ; 550 : #if _ITERATOR_DEBUG_LEVEL == 0
  4960. ; 551 : _String_alloc(const _Alloc& _Al = _Alloc())
  4961. ; 552 : : _Alval(_Al)
  4962. ; 553 : { // construct allocator from _Al
  4963. ; 554 : }
  4964. ; 555 :
  4965. ; 556 : void _Change_alloc(const _Alty& _Al)
  4966. ; 557 : { // replace old allocator
  4967. ; 558 : _Alval = _Al;
  4968. ; 559 : }
  4969. ; 560 :
  4970. ; 561 : void _Swap_alloc(_Myt& _Right)
  4971. ; 562 : { // swap allocators
  4972. ; 563 : _Swap_adl(this->_Alval, _Right._Alval);
  4973. ; 564 : }
  4974. ; 565 :
  4975. ; 566 : #else /* _ITERATOR_DEBUG_LEVEL == 0 */
  4976. ; 567 : _String_alloc(const _Alloc& _Al = _Alloc())
  4977. ; 568 : : _Alval(_Al)
  4978. ; 569 : { // construct allocator from _Al
  4979. ; 570 : _Alloc_proxy();
  4980. ; 571 : }
  4981. ; 572 :
  4982. ; 573 : ~_String_alloc() _NOEXCEPT
  4983. ; 574 : { // destroy the object
  4984. ; 575 : _Free_proxy();
  4985. ; 576 : }
  4986. ; 577 :
  4987. ; 578 : void _Change_alloc(const _Alty& _Al)
  4988. ; 579 : { // replace old allocator
  4989. ; 580 : _Free_proxy();
  4990. ; 581 : _Alval = _Al;
  4991. ; 582 : _Alloc_proxy();
  4992. ; 583 : }
  4993. ; 584 :
  4994. ; 585 : void _Swap_alloc(_Myt& _Right)
  4995. ; 586 : { // swap allocators
  4996. ; 587 : _Swap_adl(_Alval, _Right._Alval);
  4997. ; 588 : _Swap_adl(this->_Myproxy, _Right._Myproxy);
  4998. ; 589 : }
  4999. ; 590 :
  5000. ; 591 : void _Alloc_proxy()
  5001. ; 592 : { // construct proxy from _Alval
  5002. ; 593 : typename _Alloc::template rebind<_Container_proxy>::other
  5003. ; 594 : _Alproxy(_Alval);
  5004. ; 595 : this->_Myproxy = _Alproxy.allocate(1);
  5005. ; 596 : _Alproxy.construct(this->_Myproxy, _Container_proxy());
  5006. ; 597 : this->_Myproxy->_Mycont = this;
  5007. ; 598 : }
  5008. ; 599 :
  5009. ; 600 : void _Free_proxy()
  5010. ; 601 : { // destroy proxy
  5011. ; 602 : typename _Alloc::template rebind<_Container_proxy>::other
  5012. ; 603 : _Alproxy(_Alval);
  5013. ; 604 : this->_Orphan_all();
  5014. ; 605 : _Alproxy.destroy(this->_Myproxy);
  5015. ; 606 : _Alproxy.deallocate(this->_Myproxy, 1);
  5016. ; 607 : this->_Myproxy = 0;
  5017. ; 608 : }
  5018. ; 609 : #endif /* _ITERATOR_DEBUG_LEVEL == 0 */
  5019. ; 610 :
  5020. ; 611 : _Alty& _Getal()
  5021. ; 612 : { // get reference to allocator
  5022. ; 613 : return (_Alval);
  5023. ; 614 : }
  5024. ; 615 :
  5025. ; 616 : const _Alty& _Getal() const
  5026. ; 617 : { // get reference to allocator
  5027. ; 618 : return (_Alval);
  5028. ; 619 : }
  5029. ; 620 :
  5030. ; 621 : _Alty _Alval; // allocator object for strings
  5031. ; 622 : };
  5032. ; 623 :
  5033. ; 624 : template<class _Alloc_types>
  5034. ; 625 : class _String_alloc<false, _Alloc_types>
  5035. ; 626 : : public _String_val<typename _Alloc_types::_Val_types>
  5036. ; 627 : { // base class for basic_string to hold allocator with no storage
  5037. ; 628 : public:
  5038. ; 629 : typedef _String_alloc<false, _Alloc_types> _Myt;
  5039. ; 630 : typedef typename _Alloc_types::_Alloc _Alloc;
  5040. ; 631 :
  5041. ; 632 : typedef typename _Alloc_types::_Alty _Alty;
  5042. ; 633 :
  5043. ; 634 : #if _ITERATOR_DEBUG_LEVEL == 0
  5044. ; 635 : _String_alloc(const _Alloc& = _Alloc())
  5045. ; 636 : { // construct allocator from _Al
  5046. ; 637 : }
  5047. ; 638 :
  5048. ; 639 : void _Change_alloc(const _Alty&)
  5049. ; 640 : { // replace old allocator
  5050. ; 641 : }
  5051. ; 642 :
  5052. ; 643 : void _Swap_alloc(_Myt&)
  5053. ; 644 : { // swap allocators
  5054. ; 645 : }
  5055. ; 646 :
  5056. ; 647 : #else /* _ITERATOR_DEBUG_LEVEL == 0 */
  5057. ; 648 : _String_alloc(const _Alloc& = _Alloc())
  5058. ; 649 : { // construct allocator from _Al
  5059. ; 650 : _Alloc_proxy();
  5060. ; 651 : }
  5061. ; 652 :
  5062. ; 653 : ~_String_alloc() _NOEXCEPT
  5063. ; 654 : { // destroy the object
  5064. ; 655 : _Free_proxy();
  5065. ; 656 : }
  5066. ; 657 :
  5067. ; 658 : void _Change_alloc(const _Alty&)
  5068. ; 659 : { // replace old allocator
  5069. ; 660 : }
  5070. ; 661 :
  5071. ; 662 : void _Swap_alloc(_Myt& _Right)
  5072. ; 663 : { // swap allocators
  5073. ; 664 : _Swap_adl(this->_Myproxy, _Right._Myproxy);
  5074. ; 665 : }
  5075. ; 666 :
  5076. ; 667 : void _Alloc_proxy()
  5077. ; 668 : { // construct proxy from _Alval
  5078. ; 669 : typename _Alloc::template rebind<_Container_proxy>::other
  5079. ; 670 : _Alproxy;
  5080. ; 671 : this->_Myproxy = _Alproxy.allocate(1);
  5081. ; 672 : _Alproxy.construct(this->_Myproxy, _Container_proxy());
  5082. ; 673 : this->_Myproxy->_Mycont = this;
  5083. ; 674 : }
  5084. ; 675 :
  5085. ; 676 : void _Free_proxy()
  5086. ; 677 : { // destroy proxy
  5087. ; 678 : typename _Alloc::template rebind<_Container_proxy>::other
  5088. ; 679 : _Alproxy;
  5089. ; 680 : this->_Orphan_all();
  5090. ; 681 : _Alproxy.destroy(this->_Myproxy);
  5091. ; 682 : _Alproxy.deallocate(this->_Myproxy, 1);
  5092. ; 683 : this->_Myproxy = 0;
  5093. ; 684 : }
  5094. ; 685 : #endif /* _ITERATOR_DEBUG_LEVEL == 0 */
  5095. ; 686 :
  5096. ; 687 : _Alty _Getal() const
  5097. ; 688 : { // get reference to allocator
  5098. ; 689 : return (_Alty());
  5099. ; 690 : }
  5100. ; 691 : };
  5101. ; 692 :
  5102. ; 693 : // TEMPLATE CLASS basic_string
  5103. ; 694 : template<class _Elem,
  5104. ; 695 : class _Traits,
  5105. ; 696 : class _Alloc>
  5106. ; 697 : class basic_string
  5107. ; 698 : : public _String_alloc<!is_empty<_Alloc>::value,
  5108. ; 699 : _String_base_types<_Elem, _Alloc> >
  5109. ; 700 : { // null-terminated transparent array of elements
  5110. ; 701 : public:
  5111. ; 702 : typedef basic_string<_Elem, _Traits, _Alloc> _Myt;
  5112. ; 703 : typedef _String_alloc<!is_empty<_Alloc>::value,
  5113. ; 704 : _String_base_types<_Elem, _Alloc> > _Mybase;
  5114. ; 705 : typedef _Traits traits_type;
  5115. ; 706 : typedef _Alloc allocator_type;
  5116. ; 707 :
  5117. ; 708 : typedef typename _Mybase::_Alty _Alty;
  5118. ; 709 :
  5119. ; 710 : typedef typename _Mybase::value_type value_type;
  5120. ; 711 : typedef typename _Mybase::size_type size_type;
  5121. ; 712 : typedef typename _Mybase::difference_type difference_type;
  5122. ; 713 : typedef typename _Mybase::pointer pointer;
  5123. ; 714 : typedef typename _Mybase::const_pointer const_pointer;
  5124. ; 715 : typedef typename _Mybase::reference reference;
  5125. ; 716 : typedef typename _Mybase::const_reference const_reference;
  5126. ; 717 :
  5127. ; 718 : typedef typename _Mybase::iterator iterator;
  5128. ; 719 : typedef typename _Mybase::const_iterator const_iterator;
  5129. ; 720 :
  5130. ; 721 : typedef _STD reverse_iterator<iterator> reverse_iterator;
  5131. ; 722 : typedef _STD reverse_iterator<const_iterator> const_reverse_iterator;
  5132. ; 723 :
  5133. ; 724 : basic_string(const _Myt& _Right)
  5134. ; 725 :
  5135. ; 726 : #if _HAS_CPP0X
  5136. ; 727 : : _Mybase(_Right._Getal().select_on_container_copy_construction())
  5137. ; 728 :
  5138. ; 729 : #else /* _HAS_CPP0X */
  5139. ; 730 : : _Mybase(_Right._Getal())
  5140. ; 731 : #endif /* _HAS_CPP0X */
  5141. ; 732 :
  5142. ; 733 : { // construct by copying _Right
  5143. ; 734 : _Tidy();
  5144. ; 735 : assign(_Right, 0, npos);
  5145. ; 736 : }
  5146. ; 737 :
  5147. ; 738 : #if _HAS_CPP0X
  5148. ; 739 : basic_string(const _Myt& _Right, const _Alloc& _Al)
  5149. ; 740 : : _Mybase(_Al)
  5150. ; 741 : { // construct by copying with allocator
  5151. ; 742 : _Tidy();
  5152. ; 743 : assign(_Right, 0, npos);
  5153. ; 744 : }
  5154. ; 745 : #endif /* _HAS_CPP0X */
  5155. ; 746 :
  5156. ; 747 : basic_string()
  5157. ; 748 : : _Mybase()
  5158. ; 749 : { // construct empty string
  5159. ; 750 : _Tidy();
  5160. ; 751 : }
  5161. ; 752 :
  5162. ; 753 : explicit basic_string(const _Alloc& _Al)
  5163. ; 754 : : _Mybase(_Al)
  5164. ; 755 : { // construct empty string with allocator
  5165. ; 756 : _Tidy();
  5166. ; 757 : }
  5167. ; 758 :
  5168. ; 759 : basic_string(const _Myt& _Right, size_type _Roff,
  5169. ; 760 : size_type _Count = npos)
  5170. ; 761 : : _Mybase(_Right._Getal())
  5171. ; 762 : { // construct from _Right [_Roff, _Roff + _Count)
  5172. ; 763 : _Tidy();
  5173. ; 764 : assign(_Right, _Roff, _Count);
  5174. ; 765 : }
  5175. ; 766 :
  5176. ; 767 : basic_string(const _Myt& _Right, size_type _Roff, size_type _Count,
  5177. ; 768 : const _Alloc& _Al)
  5178. ; 769 : : _Mybase(_Al)
  5179. ; 770 : { // construct from _Right [_Roff, _Roff + _Count) with allocator
  5180. ; 771 : _Tidy();
  5181. ; 772 : assign(_Right, _Roff, _Count);
  5182. ; 773 : }
  5183. ; 774 :
  5184. ; 775 : basic_string(const _Elem *_Ptr, size_type _Count)
  5185. ; 776 : : _Mybase()
  5186. ; 777 : { // construct from [_Ptr, _Ptr + _Count)
  5187. ; 778 : _Tidy();
  5188. ; 779 : assign(_Ptr, _Count);
  5189. ; 780 : }
  5190. ; 781 :
  5191. ; 782 : basic_string(const _Elem *_Ptr, size_type _Count, const _Alloc& _Al)
  5192. ; 783 : : _Mybase(_Al)
  5193. ; 784 : { // construct from [_Ptr, _Ptr + _Count) with allocator
  5194. ; 785 : _Tidy();
  5195. ; 786 : assign(_Ptr, _Count);
  5196. ; 787 : }
  5197. ; 788 :
  5198. ; 789 : basic_string(const _Elem *_Ptr)
  5199. ; 790 : : _Mybase()
  5200. ; 791 : { // construct from [_Ptr, <null>)
  5201. ; 792 : _Tidy();
  5202. ; 793 : assign(_Ptr);
  5203. ; 794 : }
  5204. ; 795 :
  5205. ; 796 : basic_string(const _Elem *_Ptr, const _Alloc& _Al)
  5206. ; 797 : : _Mybase(_Al)
  5207. ; 798 : { // construct from [_Ptr, <null>) with allocator
  5208. ; 799 : _Tidy();
  5209. ; 800 : assign(_Ptr);
  5210. ; 801 : }
  5211. ; 802 :
  5212. ; 803 : basic_string(size_type _Count, _Elem _Ch)
  5213. ; 804 : : _Mybase()
  5214. ; 805 : { // construct from _Count * _Ch
  5215. ; 806 : _Tidy();
  5216. ; 807 : assign(_Count, _Ch);
  5217. ; 808 : }
  5218. ; 809 :
  5219. ; 810 : basic_string(size_type _Count, _Elem _Ch, const _Alloc& _Al)
  5220. ; 811 : : _Mybase(_Al)
  5221. ; 812 : { // construct from _Count * _Ch with allocator
  5222. ; 813 : _Tidy();
  5223. ; 814 : assign(_Count, _Ch);
  5224. ; 815 : }
  5225. ; 816 :
  5226. ; 817 : template<class _Iter>
  5227. ; 818 : basic_string(_Iter _First, _Iter _Last,
  5228. ; 819 : typename enable_if<_Is_iterator<_Iter>::value,
  5229. ; 820 : void>::type ** = 0)
  5230. ; 821 : : _Mybase()
  5231. ; 822 : { // construct from [_First, _Last)
  5232. ; 823 : _Tidy();
  5233. ; 824 : _Construct(_First, _Last, _Iter_cat(_First));
  5234. ; 825 : }
  5235. ; 826 :
  5236. ; 827 : template<class _Iter>
  5237. ; 828 : basic_string(_Iter _First, _Iter _Last, const _Alloc& _Al,
  5238. ; 829 : typename enable_if<_Is_iterator<_Iter>::value,
  5239. ; 830 : void>::type ** = 0)
  5240. ; 831 : : _Mybase(_Al)
  5241. ; 832 : { // construct from [_First, _Last) with allocator
  5242. ; 833 : _Tidy();
  5243. ; 834 : _Construct(_First, _Last, _Iter_cat(_First));
  5244. ; 835 : }
  5245. ; 836 :
  5246. ; 837 : template<class _Iter>
  5247. ; 838 : void _Construct(_Iter _First,
  5248. ; 839 : _Iter _Last, input_iterator_tag)
  5249. ; 840 : { // initialize from [_First, _Last), input iterators
  5250. ; 841 : _TRY_BEGIN
  5251. ; 842 : for (; _First != _Last; ++_First)
  5252. ; 843 : append((size_type)1, (_Elem)*_First);
  5253. ; 844 : _CATCH_ALL
  5254. ; 845 : _Tidy(true);
  5255. ; 846 : _RERAISE;
  5256. ; 847 : _CATCH_END
  5257. ; 848 : }
  5258. ; 849 :
  5259. ; 850 : template<class _Iter>
  5260. ; 851 : void _Construct(_Iter _First,
  5261. ; 852 : _Iter _Last, forward_iterator_tag)
  5262. ; 853 : { // initialize from [_First, _Last), forward iterators
  5263. ; 854 : _DEBUG_RANGE(_First, _Last);
  5264. ; 855 : size_type _Count = 0;
  5265. ; 856 : _Distance(_First, _Last, _Count);
  5266. ; 857 : reserve(_Count);
  5267. ; 858 :
  5268. ; 859 : _TRY_BEGIN
  5269. ; 860 : for (; _First != _Last; ++_First)
  5270. ; 861 : append((size_type)1, (_Elem)*_First);
  5271. ; 862 : _CATCH_ALL
  5272. ; 863 : _Tidy(true);
  5273. ; 864 : _RERAISE;
  5274. ; 865 : _CATCH_END
  5275. ; 866 : }
  5276. ; 867 :
  5277. ; 868 : basic_string(const_pointer _First, const_pointer _Last)
  5278. ; 869 : : _Mybase()
  5279. ; 870 : { // construct from [_First, _Last), const pointers
  5280. ; 871 : _DEBUG_RANGE(_First, _Last);
  5281. ; 872 : _Tidy();
  5282. ; 873 : if (_First != _Last)
  5283. ; 874 : assign(&*_First, _Last - _First);
  5284. ; 875 : }
  5285. ; 876 :
  5286. ; 877 : basic_string(const_pointer _First, const_pointer _Last,
  5287. ; 878 : const _Alloc& _Al)
  5288. ; 879 : : _Mybase(_Al)
  5289. ; 880 : { // construct from [_First, _Last), const pointers
  5290. ; 881 : _DEBUG_RANGE(_First, _Last);
  5291. ; 882 : _Tidy();
  5292. ; 883 : if (_First != _Last)
  5293. ; 884 : assign(&*_First, _Last - _First);
  5294. ; 885 : }
  5295. ; 886 :
  5296. ; 887 : basic_string(const_iterator _First, const_iterator _Last)
  5297. ; 888 : : _Mybase()
  5298. ; 889 : { // construct from [_First, _Last), const_iterators
  5299. ; 890 : _DEBUG_RANGE(_First, _Last);
  5300. ; 891 : _Tidy();
  5301. ; 892 : if (_First != _Last)
  5302. ; 893 : assign(&*_First, _Last - _First);
  5303. ; 894 : }
  5304. ; 895 :
  5305. ; 896 : basic_string(_Myt&& _Right) _NOEXCEPT
  5306. ; 897 : : _Mybase(_Right._Getal())
  5307. ; 898 : { // construct by moving _Right
  5308. ; 899 : _Tidy();
  5309. ; 900 : _Assign_rv(_STD forward<_Myt>(_Right));
  5310. ; 901 : }
  5311. ; 902 :
  5312. ; 903 : basic_string(_Myt&& _Right, const _Alloc& _Al)
  5313. ; 904 : : _Mybase(_Al)
  5314. ; 905 : { // construct by moving _Right, allocator
  5315. ; 906 : if (this->_Getal() != _Right._Getal())
  5316. ; 907 : assign(_Right.begin(), _Right.end());
  5317. ; 908 : else
  5318. ; 909 : _Assign_rv(_STD forward<_Myt>(_Right));
  5319. ; 910 : }
  5320. ; 911 :
  5321. ; 912 : _Myt& operator=(_Myt&& _Right) _NOEXCEPT
  5322. ; 913 : { // assign by moving _Right
  5323. ; 914 : if (this != &_Right)
  5324. ; 915 : { // different, assign it
  5325. ; 916 : _Tidy(true);
  5326. ; 917 :
  5327. ; 918 : #if _HAS_CPP0X
  5328. ; 919 : if (this->_Getal() != _Right._Getal()
  5329. ; 920 : && _Alty::propagate_on_container_move_assignment::value)
  5330. ; 921 : this->_Change_alloc(_Right._Getal());
  5331. ; 922 : #endif /* _HAS_CPP0X */
  5332. ; 923 :
  5333. ; 924 : if (this->_Getal() != _Right._Getal())
  5334. ; 925 : assign(_Right.begin(), _Right.end());
  5335. ; 926 : else
  5336. ; 927 : _Assign_rv(_STD forward<_Myt>(_Right));
  5337. ; 928 : }
  5338. ; 929 : return (*this);
  5339. ; 930 : }
  5340. ; 931 :
  5341. ; 932 : _Myt& assign(_Myt&& _Right) _NOEXCEPT
  5342. ; 933 : { // assign by moving _Right
  5343. ; 934 : if (this == &_Right)
  5344. ; 935 : ;
  5345. ; 936 : else if (get_allocator() != _Right.get_allocator()
  5346. ; 937 : && this->_BUF_SIZE <= _Right._Myres)
  5347. ; 938 : *this = _Right;
  5348. ; 939 : else
  5349. ; 940 : { // not same, clear this and steal from _Right
  5350. ; 941 : _Tidy(true);
  5351. ; 942 : _Assign_rv(_STD forward<_Myt>(_Right));
  5352. ; 943 : }
  5353. ; 944 : return (*this);
  5354. ; 945 : }
  5355. ; 946 :
  5356. ; 947 : void _Assign_rv(_Myt&& _Right)
  5357. ; 948 : { // assign by moving _Right
  5358. ; 949 : if (_Right._Myres < this->_BUF_SIZE)
  5359. ; 950 : _Traits::move(this->_Bx._Buf, _Right._Bx._Buf,
  5360. ; 951 : _Right._Mysize + 1);
  5361. ; 952 : else
  5362. ; 953 : { // copy pointer
  5363. ; 954 : this->_Getal().construct(&this->_Bx._Ptr, _Right._Bx._Ptr);
  5364. ; 955 : _Right._Bx._Ptr = pointer();
  5365. ; 956 : }
  5366. ; 957 : this->_Mysize = _Right._Mysize;
  5367. ; 958 : this->_Myres = _Right._Myres;
  5368. ; 959 : _Right._Tidy();
  5369. ; 960 : }
  5370. ; 961 :
  5371. ; 962 : ~basic_string() _NOEXCEPT
  5372. ; 963 : { // destroy the string
  5373. ; 964 : _Tidy(true);
  5374. ; 965 : }
  5375. ; 966 :
  5376. ; 967 : _PGLOBAL static const size_type npos; // bad/missing length/position
  5377. ; 968 :
  5378. ; 969 : _Myt& operator=(const _Myt& _Right)
  5379. ; 970 : { // assign _Right
  5380. ; 971 : if (this != &_Right)
  5381. ; 972 : { // different, assign it
  5382. ; 973 : #if _HAS_CPP0X
  5383. ; 974 : if (this->_Getal() != _Right._Getal()
  5384. ; 975 : && _Alty::propagate_on_container_copy_assignment::value)
  5385. ; 976 : { // change allocator before copying
  5386. ; 977 : _Tidy(true);
  5387. ; 978 : this->_Change_alloc(_Right._Getal());
  5388. ; 979 : }
  5389. ; 980 : #endif /* _HAS_CPP0X */
  5390. ; 981 :
  5391. ; 982 : assign(_Right);
  5392. ; 983 : }
  5393. ; 984 : return (*this);
  5394. ; 985 : }
  5395. ; 986 :
  5396. ; 987 : _Myt& operator=(const _Elem *_Ptr)
  5397. ; 988 : { // assign [_Ptr, <null>)
  5398. ; 989 : return (assign(_Ptr));
  5399. ; 990 : }
  5400. ; 991 :
  5401. ; 992 : _Myt& operator=(_Elem _Ch)
  5402. ; 993 : { // assign 1 * _Ch
  5403. ; 994 : return (assign(1, _Ch));
  5404. ; 995 : }
  5405. ; 996 :
  5406. ; 997 : _Myt& operator+=(const _Myt& _Right)
  5407. ; 998 : { // append _Right
  5408. ; 999 : return (append(_Right));
  5409. ; 1000 : }
  5410. ; 1001 :
  5411. ; 1002 : _Myt& operator+=(const _Elem *_Ptr)
  5412. ; 1003 : { // append [_Ptr, <null>)
  5413. ; 1004 : return (append(_Ptr));
  5414. ; 1005 : }
  5415. ; 1006 :
  5416. ; 1007 : _Myt& operator+=(_Elem _Ch)
  5417. ; 1008 : { // append 1 * _Ch
  5418. ; 1009 : return (append((size_type)1, _Ch));
  5419. ; 1010 : }
  5420. ; 1011 :
  5421. ; 1012 : _Myt& append(const _Myt& _Right)
  5422. ; 1013 : { // append _Right
  5423. ; 1014 : return (append(_Right, 0, npos));
  5424. ; 1015 : }
  5425. ; 1016 :
  5426. ; 1017 : _Myt& append(const _Myt& _Right,
  5427. ; 1018 : size_type _Roff, size_type _Count)
  5428. ; 1019 : { // append _Right [_Roff, _Roff + _Count)
  5429. ; 1020 : if (_Right.size() < _Roff)
  5430. ; 1021 : _Xran(); // _Roff off end
  5431. ; 1022 : size_type _Num = _Right.size() - _Roff;
  5432. ; 1023 : if (_Num < _Count)
  5433. ; 1024 : _Count = _Num; // trim _Count to size
  5434. ; 1025 : if (npos - this->_Mysize <= _Count)
  5435. ; 1026 : _Xlen(); // result too long
  5436. ; 1027 :
  5437. ; 1028 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  5438. ; 1029 : { // make room and append new stuff
  5439. ; 1030 : _Traits::copy(this->_Myptr() + this->_Mysize,
  5440. ; 1031 : _Right._Myptr() + _Roff, _Count);
  5441. ; 1032 : _Eos(_Num);
  5442. ; 1033 : }
  5443. ; 1034 : return (*this);
  5444. ; 1035 : }
  5445. ; 1036 :
  5446. ; 1037 : _Myt& append(const _Elem *_Ptr, size_type _Count)
  5447. ; 1038 : { // append [_Ptr, _Ptr + _Count)
  5448. ; 1039 : #if _ITERATOR_DEBUG_LEVEL == 2
  5449. ; 1040 : if (_Count != 0)
  5450. ; 1041 : _DEBUG_POINTER(_Ptr);
  5451. ; 1042 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  5452. ; 1043 :
  5453. ; 1044 : if (_Inside(_Ptr))
  5454. ; 1045 : return (append(*this,
  5455. ; 1046 : _Ptr - this->_Myptr(), _Count)); // substring
  5456. ; 1047 : if (npos - this->_Mysize <= _Count)
  5457. ; 1048 : _Xlen(); // result too long
  5458. ; 1049 :
  5459. ; 1050 : size_type _Num;
  5460. ; 1051 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  5461. ; 1052 : { // make room and append new stuff
  5462. ; 1053 : _Traits::copy(this->_Myptr() + this->_Mysize, _Ptr, _Count);
  5463. ; 1054 : _Eos(_Num);
  5464. ; 1055 : }
  5465. ; 1056 : return (*this);
  5466. ; 1057 : }
  5467. ; 1058 :
  5468. ; 1059 : _Myt& append(const _Elem *_Ptr)
  5469. ; 1060 : { // append [_Ptr, <null>)
  5470. ; 1061 : _DEBUG_POINTER(_Ptr);
  5471. ; 1062 : return (append(_Ptr, _Traits::length(_Ptr)));
  5472. ; 1063 : }
  5473. ; 1064 :
  5474. ; 1065 : _Myt& append(size_type _Count, _Elem _Ch)
  5475. ; 1066 : { // append _Count * _Ch
  5476. ; 1067 : if (npos - this->_Mysize <= _Count)
  5477. ; 1068 : _Xlen(); // result too long
  5478. ; 1069 :
  5479. ; 1070 : size_type _Num;
  5480. ; 1071 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  5481. ; 1072 : { // make room and append new stuff using assign
  5482. ; 1073 : _Chassign(this->_Mysize, _Count, _Ch);
  5483. ; 1074 : _Eos(_Num);
  5484. ; 1075 : }
  5485. ; 1076 : return (*this);
  5486. ; 1077 : }
  5487. ; 1078 :
  5488. ; 1079 : template<class _Iter>
  5489. ; 1080 : typename enable_if<_Is_iterator<_Iter>::value,
  5490. ; 1081 : _Myt&>::type
  5491. ; 1082 : append(_Iter _First, _Iter _Last)
  5492. ; 1083 : { // append [_First, _Last), input iterators
  5493. ; 1084 : return (replace(end(), end(), _First, _Last));
  5494. ; 1085 : }
  5495. ; 1086 :
  5496. ; 1087 : _Myt& append(const_pointer _First, const_pointer _Last)
  5497. ; 1088 : { // append [_First, _Last), const pointers
  5498. ; 1089 : return (replace(end(), end(), _First, _Last));
  5499. ; 1090 : }
  5500. ; 1091 :
  5501. ; 1092 : _Myt& append(const_iterator _First, const_iterator _Last)
  5502. ; 1093 : { // append [_First, _Last), const_iterators
  5503. ; 1094 : return (replace(end(), end(), _First, _Last));
  5504. ; 1095 : }
  5505. ; 1096 :
  5506. ; 1097 : _Myt& assign(const _Myt& _Right)
  5507. ; 1098 : { // assign _Right
  5508. ; 1099 : return (assign(_Right, 0, npos));
  5509. ; 1100 : }
  5510. ; 1101 :
  5511. ; 1102 : _Myt& assign(const _Myt& _Right,
  5512. ; 1103 : size_type _Roff, size_type _Count)
  5513. ; 1104 : { // assign _Right [_Roff, _Roff + _Count)
  5514. ; 1105 : if (_Right.size() < _Roff)
  5515. ; 1106 : _Xran(); // _Roff off end
  5516. ; 1107 : size_type _Num = _Right.size() - _Roff;
  5517. ; 1108 : if (_Count < _Num)
  5518. ; 1109 : _Num = _Count; // trim _Num to size
  5519. ; 1110 :
  5520. ; 1111 : if (this == &_Right)
  5521. ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
  5522. ; 1113 : else if (_Grow(_Num))
  5523. ; 1114 : { // make room and assign new stuff
  5524. ; 1115 : _Traits::copy(this->_Myptr(),
  5525. ; 1116 : _Right._Myptr() + _Roff, _Num);
  5526. ; 1117 : _Eos(_Num);
  5527. ; 1118 : }
  5528. ; 1119 : return (*this);
  5529. ; 1120 : }
  5530. ; 1121 :
  5531. ; 1122 : _Myt& assign(const _Elem *_Ptr, size_type _Count)
  5532. ; 1123 : { // assign [_Ptr, _Ptr + _Count)
  5533. ; 1124 : #if _ITERATOR_DEBUG_LEVEL == 2
  5534. ; 1125 : if (_Count != 0)
  5535. ; 1126 : _DEBUG_POINTER(_Ptr);
  5536. ; 1127 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  5537. ; 1128 :
  5538. ; 1129 : if (_Inside(_Ptr))
  5539. ; 1130 : return (assign(*this,
  5540. ; 1131 : _Ptr - this->_Myptr(), _Count)); // substring
  5541. ; 1132 :
  5542. ; 1133 : if (_Grow(_Count))
  5543. ; 1134 : { // make room and assign new stuff
  5544. ; 1135 : _Traits::copy(this->_Myptr(), _Ptr, _Count);
  5545. ; 1136 : _Eos(_Count);
  5546. ; 1137 : }
  5547. ; 1138 : return (*this);
  5548. ; 1139 : }
  5549. ; 1140 :
  5550. ; 1141 : _Myt& assign(const _Elem *_Ptr)
  5551. ; 1142 : { // assign [_Ptr, <null>)
  5552. ; 1143 : _DEBUG_POINTER(_Ptr);
  5553. ; 1144 : return (assign(_Ptr, _Traits::length(_Ptr)));
  5554. ; 1145 : }
  5555. ; 1146 :
  5556. ; 1147 : _Myt& assign(size_type _Count, _Elem _Ch)
  5557. ; 1148 : { // assign _Count * _Ch
  5558. ; 1149 : if (_Count == npos)
  5559. ; 1150 : _Xlen(); // result too long
  5560. ; 1151 :
  5561. ; 1152 : if (_Grow(_Count))
  5562. ; 1153 : { // make room and assign new stuff
  5563. ; 1154 : _Chassign(0, _Count, _Ch);
  5564. ; 1155 : _Eos(_Count);
  5565. ; 1156 : }
  5566. ; 1157 : return (*this);
  5567. ; 1158 : }
  5568. ; 1159 :
  5569. ; 1160 : template<class _Iter>
  5570. ; 1161 : typename enable_if<_Is_iterator<_Iter>::value,
  5571. ; 1162 : _Myt&>::type
  5572. ; 1163 : assign(_Iter _First, _Iter _Last)
  5573. ; 1164 : { // assign [First, _Last), input iterators
  5574. ; 1165 : return (replace(begin(), end(), _First, _Last));
  5575. ; 1166 : }
  5576. ; 1167 :
  5577. ; 1168 : _Myt& assign(const_pointer _First, const_pointer _Last)
  5578. ; 1169 : { // assign [First, _Last), const pointers
  5579. ; 1170 : return (replace(begin(), end(), _First, _Last));
  5580. ; 1171 : }
  5581. ; 1172 :
  5582. ; 1173 : _Myt& assign(const_iterator _First, const_iterator _Last)
  5583. ; 1174 : { // assign [First, _Last), const_iterators
  5584. ; 1175 : return (replace(begin(), end(), _First, _Last));
  5585. ; 1176 : }
  5586. ; 1177 :
  5587. ; 1178 : _Myt& insert(size_type _Off, const _Myt& _Right)
  5588. ; 1179 : { // insert _Right at _Off
  5589. ; 1180 : return (insert(_Off, _Right, 0, npos));
  5590. ; 1181 : }
  5591. ; 1182 :
  5592. ; 1183 : _Myt& insert(size_type _Off,
  5593. ; 1184 : const _Myt& _Right, size_type _Roff, size_type _Count)
  5594. ; 1185 : { // insert _Right [_Roff, _Roff + _Count) at _Off
  5595. ; 1186 : if (this->_Mysize < _Off || _Right.size() < _Roff)
  5596. ; 1187 : _Xran(); // _Off or _Roff off end
  5597. ; 1188 : size_type _Num = _Right.size() - _Roff;
  5598. ; 1189 : if (_Num < _Count)
  5599. ; 1190 : _Count = _Num; // trim _Count to size
  5600. ; 1191 : if (npos - this->_Mysize <= _Count)
  5601. ; 1192 : _Xlen(); // result too long
  5602. ; 1193 :
  5603. ; 1194 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  5604. ; 1195 : { // make room and insert new stuff
  5605. ; 1196 : _Traits::move(this->_Myptr() + _Off + _Count,
  5606. ; 1197 : this->_Myptr() + _Off,
  5607. ; 1198 : this->_Mysize - _Off); // empty out hole
  5608. ; 1199 : if (this == &_Right)
  5609. ; 1200 : _Traits::move(this->_Myptr() + _Off,
  5610. ; 1201 : this->_Myptr() + (_Off < _Roff ? _Roff + _Count : _Roff),
  5611. ; 1202 : _Count); // substring
  5612. ; 1203 : else
  5613. ; 1204 : _Traits::copy(this->_Myptr() + _Off,
  5614. ; 1205 : _Right._Myptr() + _Roff, _Count); // fill hole
  5615. ; 1206 : _Eos(_Num);
  5616. ; 1207 : }
  5617. ; 1208 : return (*this);
  5618. ; 1209 : }
  5619. ; 1210 :
  5620. ; 1211 : _Myt& insert(size_type _Off,
  5621. ; 1212 : const _Elem *_Ptr, size_type _Count)
  5622. ; 1213 : { // insert [_Ptr, _Ptr + _Count) at _Off
  5623. ; 1214 : #if _ITERATOR_DEBUG_LEVEL == 2
  5624. ; 1215 : if (_Count != 0)
  5625. ; 1216 : _DEBUG_POINTER(_Ptr);
  5626. ; 1217 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  5627. ; 1218 :
  5628. ; 1219 : if (_Inside(_Ptr))
  5629. ; 1220 : return (insert(_Off, *this,
  5630. ; 1221 : _Ptr - this->_Myptr(), _Count)); // substring
  5631. ; 1222 : if (this->_Mysize < _Off)
  5632. ; 1223 : _Xran(); // _Off off end
  5633. ; 1224 : if (npos - this->_Mysize <= _Count)
  5634. ; 1225 : _Xlen(); // result too long
  5635. ; 1226 : size_type _Num;
  5636. ; 1227 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  5637. ; 1228 : { // make room and insert new stuff
  5638. ; 1229 : _Traits::move(this->_Myptr() + _Off + _Count,
  5639. ; 1230 : this->_Myptr() + _Off,
  5640. ; 1231 : this->_Mysize - _Off); // empty out hole
  5641. ; 1232 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
  5642. ; 1233 : _Eos(_Num);
  5643. ; 1234 : }
  5644. ; 1235 : return (*this);
  5645. ; 1236 : }
  5646. ; 1237 :
  5647. ; 1238 : _Myt& insert(size_type _Off, const _Elem *_Ptr)
  5648. ; 1239 : { // insert [_Ptr, <null>) at _Off
  5649. ; 1240 : _DEBUG_POINTER(_Ptr);
  5650. ; 1241 : return (insert(_Off, _Ptr, _Traits::length(_Ptr)));
  5651. ; 1242 : }
  5652. ; 1243 :
  5653. ; 1244 : _Myt& insert(size_type _Off,
  5654. ; 1245 : size_type _Count, _Elem _Ch)
  5655. ; 1246 : { // insert _Count * _Ch at _Off
  5656. ; 1247 : if (this->_Mysize < _Off)
  5657. ; 1248 : _Xran(); // _Off off end
  5658. ; 1249 : if (npos - this->_Mysize <= _Count)
  5659. ; 1250 : _Xlen(); // result too long
  5660. ; 1251 : size_type _Num;
  5661. ; 1252 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  5662. ; 1253 : { // make room and insert new stuff
  5663. ; 1254 : _Traits::move(this->_Myptr() + _Off + _Count,
  5664. ; 1255 : this->_Myptr() + _Off,
  5665. ; 1256 : this->_Mysize - _Off); // empty out hole
  5666. ; 1257 : _Chassign(_Off, _Count, _Ch); // fill hole
  5667. ; 1258 : _Eos(_Num);
  5668. ; 1259 : }
  5669. ; 1260 : return (*this);
  5670. ; 1261 : }
  5671. ; 1262 :
  5672. ; 1263 : iterator insert(const_iterator _Where)
  5673. ; 1264 : { // insert <null> at _Where
  5674. ; 1265 : return (insert(_Where, _Elem()));
  5675. ; 1266 : }
  5676. ; 1267 :
  5677. ; 1268 : iterator insert(const_iterator _Where, _Elem _Ch)
  5678. ; 1269 : { // insert _Ch at _Where
  5679. ; 1270 : size_type _Off = _Pdif(_Where, begin());
  5680. ; 1271 : insert(_Off, 1, _Ch);
  5681. ; 1272 : return (begin() + _Off);
  5682. ; 1273 : }
  5683. ; 1274 :
  5684. ; 1275 : iterator insert(const_iterator _Where, size_type _Count, _Elem _Ch)
  5685. ; 1276 : { // insert _Count * _Elem at _Where
  5686. ; 1277 : size_type _Off = _Pdif(_Where, begin());
  5687. ; 1278 : insert(_Off, _Count, _Ch);
  5688. ; 1279 : return (begin() + _Off);
  5689. ; 1280 : }
  5690. ; 1281 :
  5691. ; 1282 : template<class _Iter>
  5692. ; 1283 : typename enable_if<_Is_iterator<_Iter>::value,
  5693. ; 1284 : iterator>::type
  5694. ; 1285 : insert(const_iterator _Where, _Iter _First, _Iter _Last)
  5695. ; 1286 : { // insert [_First, _Last) at _Where, input iterators
  5696. ; 1287 : size_type _Off = _Pdif(_Where, begin());
  5697. ; 1288 : replace(_Where, _Where, _First, _Last);
  5698. ; 1289 : return (begin() + _Off);
  5699. ; 1290 : }
  5700. ; 1291 :
  5701. ; 1292 : iterator insert(const_iterator _Where,
  5702. ; 1293 : const_pointer _First, const_pointer _Last)
  5703. ; 1294 : { // insert [_First, _Last) at _Where, const pointers
  5704. ; 1295 : size_type _Off = _Pdif(_Where, begin());
  5705. ; 1296 : replace(_Where, _Where, _First, _Last);
  5706. ; 1297 : return (begin() + _Off);
  5707. ; 1298 : }
  5708. ; 1299 :
  5709. ; 1300 : iterator insert(const_iterator _Where,
  5710. ; 1301 : const_iterator _First, const_iterator _Last)
  5711. ; 1302 : { // insert [_First, _Last) at _Where, const_iterators
  5712. ; 1303 : size_type _Off = _Pdif(_Where, begin());
  5713. ; 1304 : replace(_Where, _Where, _First, _Last);
  5714. ; 1305 : return (begin() + _Off);
  5715. ; 1306 : }
  5716. ; 1307 :
  5717. ; 1308 : _Myt& erase(size_type _Off = 0)
  5718. ; 1309 : { // erase elements [_Off, ...)
  5719. ; 1310 : if (this->_Mysize < _Off)
  5720. ; 1311 : _Xran(); // _Off off end
  5721. ; 1312 : _Eos(_Off);
  5722. ; 1313 : return (*this);
  5723. ; 1314 : }
  5724. ; 1315 :
  5725. ; 1316 : _Myt& erase(size_type _Off, size_type _Count)
  5726. ; 1317 : { // erase elements [_Off, _Off + _Count)
  5727. ; 1318 : if (this->_Mysize < _Off)
  5728. ; 1319 : _Xran(); // _Off off end
  5729. ; 1320 : if (this->_Mysize - _Off <= _Count)
  5730. ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
  5731. ; 1322 : else if (0 < _Count)
  5732. ; 1323 : { // move elements down
  5733. ; 1324 : value_type *_Ptr = this->_Myptr() + _Off;
  5734. ; 1325 : size_type _Newsize = this->_Mysize - _Count;
  5735. ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
  5736. ; 1327 : _Eos(_Newsize);
  5737. ; 1328 : }
  5738. ; 1329 : return (*this);
  5739. ; 1330 : }
  5740. ; 1331 :
  5741. ; 1332 : iterator erase(const_iterator _Where)
  5742. ; 1333 : { // erase element at _Where
  5743. ; 1334 : size_type _Count = _Pdif(_Where, begin());
  5744. ; 1335 : erase(_Count, 1);
  5745. ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  5746. ; 1337 : }
  5747. ; 1338 :
  5748. ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
  5749. ; 1340 : { // erase substring [_First, _Last)
  5750. ; 1341 : _DEBUG_RANGE(_First, _Last);
  5751. ; 1342 : size_type _Count = _Pdif(_First, begin());
  5752. ; 1343 : erase(_Count, _Pdif(_Last, _First));
  5753. ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  5754. ; 1345 : }
  5755. ; 1346 :
  5756. ; 1347 : void clear() _NOEXCEPT
  5757. ; 1348 : { // erase all
  5758. ; 1349 : _Eos(0);
  5759. ; 1350 : }
  5760. ; 1351 :
  5761. ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
  5762. ; 1353 : { // replace [_Off, _Off + _N0) with _Right
  5763. ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
  5764. ; 1355 : }
  5765. ; 1356 :
  5766. ; 1357 : _Myt& replace(size_type _Off,
  5767. ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
  5768. ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  5769. ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
  5770. ; 1361 : _Xran(); // _Off or _Roff off end
  5771. ; 1362 : if (this->_Mysize - _Off < _N0)
  5772. ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  5773. ; 1364 : size_type _Num = _Right.size() - _Roff;
  5774. ; 1365 : if (_Num < _Count)
  5775. ; 1366 : _Count = _Num; // trim _Count to size
  5776. ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
  5777. ; 1368 : _Xlen(); // result too long
  5778. ; 1369 :
  5779. ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
  5780. ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
  5781. ; 1372 : if (this->_Mysize < _Newsize)
  5782. ; 1373 : _Grow(_Newsize);
  5783. ; 1374 :
  5784. ; 1375 : if (this != &_Right)
  5785. ; 1376 : { // no overlap, just move down and copy in new stuff
  5786. ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
  5787. ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
  5788. ; 1379 : _Traits::copy(this->_Myptr() + _Off,
  5789. ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
  5790. ; 1381 : }
  5791. ; 1382 : else if (_Count <= _N0)
  5792. ; 1383 : { // hole doesn't get larger, just copy in substring
  5793. ; 1384 : _Traits::move(this->_Myptr() + _Off,
  5794. ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
  5795. ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
  5796. ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  5797. ; 1388 : }
  5798. ; 1389 : else if (_Roff <= _Off)
  5799. ; 1390 : { // hole gets larger, substring begins before hole
  5800. ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
  5801. ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  5802. ; 1393 : _Traits::move(this->_Myptr() + _Off,
  5803. ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
  5804. ; 1395 : }
  5805. ; 1396 : else if (_Off + _N0 <= _Roff)
  5806. ; 1397 : { // hole gets larger, substring begins after hole
  5807. ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
  5808. ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  5809. ; 1400 : _Traits::move(this->_Myptr() + _Off,
  5810. ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
  5811. ; 1402 : _Count); // fill hole
  5812. ; 1403 : }
  5813. ; 1404 : else
  5814. ; 1405 : { // hole gets larger, substring begins in hole
  5815. ; 1406 : _Traits::move(this->_Myptr() + _Off,
  5816. ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
  5817. ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
  5818. ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  5819. ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
  5820. ; 1411 : this->_Myptr() + _Roff + _Count,
  5821. ; 1412 : _Count - _N0); // fill rest of new hole
  5822. ; 1413 : }
  5823. ; 1414 :
  5824. ; 1415 : _Eos(_Newsize);
  5825. ; 1416 : return (*this);
  5826. ; 1417 : }
  5827. ; 1418 :
  5828. ; 1419 : _Myt& replace(size_type _Off,
  5829. ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
  5830. ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  5831. ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
  5832. ; 1423 : if (_Count != 0)
  5833. ; 1424 : _DEBUG_POINTER(_Ptr);
  5834. ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  5835. ; 1426 :
  5836. ; 1427 : if (_Inside(_Ptr))
  5837. ; 1428 : return (replace(_Off, _N0, *this,
  5838. ; 1429 : _Ptr - this->_Myptr(),
  5839. ; 1430 : _Count)); // substring, replace carefully
  5840. ; 1431 : if (this->_Mysize < _Off)
  5841. ; 1432 : _Xran(); // _Off off end
  5842. ; 1433 : if (this->_Mysize - _Off < _N0)
  5843. ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  5844. ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
  5845. ; 1436 : _Xlen(); // result too long
  5846. ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
  5847. ; 1438 :
  5848. ; 1439 : if (_Count < _N0)
  5849. ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
  5850. ; 1441 : this->_Myptr() + _Off + _N0,
  5851. ; 1442 : _Nm); // smaller hole, move tail up
  5852. ; 1443 : size_type _Num;
  5853. ; 1444 : if ((0 < _Count || 0 < _N0)
  5854. ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  5855. ; 1446 : { // make room and rearrange
  5856. ; 1447 : if (_N0 < _Count)
  5857. ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
  5858. ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  5859. ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
  5860. ; 1451 : _Eos(_Num);
  5861. ; 1452 : }
  5862. ; 1453 : return (*this);
  5863. ; 1454 : }
  5864. ; 1455 :
  5865. ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
  5866. ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
  5867. ; 1458 : _DEBUG_POINTER(_Ptr);
  5868. ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  5869. ; 1460 : }
  5870. ; 1461 :
  5871. ; 1462 : _Myt& replace(size_type _Off,
  5872. ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
  5873. ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
  5874. ; 1465 : if (this->_Mysize < _Off)
  5875. ; 1466 : _Xran(); // _Off off end
  5876. ; 1467 : if (this->_Mysize - _Off < _N0)
  5877. ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  5878. ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
  5879. ; 1470 : _Xlen(); // result too long
  5880. ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
  5881. ; 1472 :
  5882. ; 1473 : if (_Count < _N0)
  5883. ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
  5884. ; 1475 : this->_Myptr() + _Off + _N0,
  5885. ; 1476 : _Nm); // smaller hole, move tail up
  5886. ; 1477 : size_type _Num;
  5887. ; 1478 : if ((0 < _Count || 0 < _N0)
  5888. ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  5889. ; 1480 : { // make room and rearrange
  5890. ; 1481 : if (_N0 < _Count)
  5891. ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
  5892. ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  5893. ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
  5894. ; 1485 : _Eos(_Num);
  5895. ; 1486 : }
  5896. ; 1487 : return (*this);
  5897. ; 1488 : }
  5898. ; 1489 :
  5899. ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
  5900. ; 1491 : const _Myt& _Right)
  5901. ; 1492 : { // replace [_First, _Last) with _Right
  5902. ; 1493 : return (replace(
  5903. ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
  5904. ; 1495 : }
  5905. ; 1496 :
  5906. ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
  5907. ; 1498 : const _Elem *_Ptr, size_type _Count)
  5908. ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
  5909. ; 1500 : return (replace(
  5910. ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
  5911. ; 1502 : }
  5912. ; 1503 :
  5913. ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
  5914. ; 1505 : const _Elem *_Ptr)
  5915. ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
  5916. ; 1507 : return (replace(
  5917. ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
  5918. ; 1509 : }
  5919. ; 1510 :
  5920. ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
  5921. ; 1512 : size_type _Count, _Elem _Ch)
  5922. ; 1513 : { // replace [_First, _Last) with _Count * _Ch
  5923. ; 1514 : return (replace(
  5924. ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
  5925. ; 1516 : }
  5926. ; 1517 :
  5927. ; 1518 : template<class _Iter>
  5928. ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
  5929. ; 1520 : _Myt&>::type
  5930. ; 1521 : replace(const_iterator _First, const_iterator _Last,
  5931. ; 1522 : _Iter _First2, _Iter _Last2)
  5932. ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
  5933. ; 1524 : _Myt _Right(_First2, _Last2);
  5934. ; 1525 : replace(_First, _Last, _Right);
  5935. ; 1526 : return (*this);
  5936. ; 1527 : }
  5937. ; 1528 :
  5938. ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
  5939. ; 1530 : const_pointer _First2, const_pointer _Last2)
  5940. ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  5941. ; 1532 : if (_First2 == _Last2)
  5942. ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  5943. ; 1534 : else
  5944. ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  5945. ; 1536 : &*_First2, _Last2 - _First2);
  5946. ; 1537 : return (*this);
  5947. ; 1538 : }
  5948. ; 1539 :
  5949. ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
  5950. ; 1541 : pointer _First2, pointer _Last2)
  5951. ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  5952. ; 1543 : if (_First2 == _Last2)
  5953. ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  5954. ; 1545 : else
  5955. ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  5956. ; 1547 : &*_First2, _Last2 - _First2);
  5957. ; 1548 : return (*this);
  5958. ; 1549 : }
  5959. ; 1550 :
  5960. ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
  5961. ; 1552 : const_iterator _First2, const_iterator _Last2)
  5962. ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  5963. ; 1554 : if (_First2 == _Last2)
  5964. ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  5965. ; 1556 : else
  5966. ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  5967. ; 1558 : &*_First2, _Last2 - _First2);
  5968. ; 1559 : return (*this);
  5969. ; 1560 : }
  5970. ; 1561 :
  5971. ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
  5972. ; 1563 : iterator _First2, iterator _Last2)
  5973. ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  5974. ; 1565 : if (_First2 == _Last2)
  5975. ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  5976. ; 1567 : else
  5977. ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  5978. ; 1569 : &*_First2, _Last2 - _First2);
  5979. ; 1570 : return (*this);
  5980. ; 1571 : }
  5981. ; 1572 :
  5982. ; 1573 : iterator begin() _NOEXCEPT
  5983. ; 1574 : { // return iterator for beginning of mutable sequence
  5984. ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
  5985. ; 1576 : }
  5986. ; 1577 :
  5987. ; 1578 : const_iterator begin() const _NOEXCEPT
  5988. ; 1579 : { // return iterator for beginning of nonmutable sequence
  5989. ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
  5990. ; 1581 : }
  5991. ; 1582 :
  5992. ; 1583 : iterator end() _NOEXCEPT
  5993. ; 1584 : { // return iterator for end of mutable sequence
  5994. ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
  5995. ; 1586 : }
  5996. ; 1587 :
  5997. ; 1588 : const_iterator end() const _NOEXCEPT
  5998. ; 1589 : { // return iterator for end of nonmutable sequence
  5999. ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
  6000. ; 1591 : }
  6001. ; 1592 :
  6002. ; 1593 : reverse_iterator rbegin() _NOEXCEPT
  6003. ; 1594 : { // return iterator for beginning of reversed mutable sequence
  6004. ; 1595 : return (reverse_iterator(end()));
  6005. ; 1596 : }
  6006. ; 1597 :
  6007. ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
  6008. ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
  6009. ; 1600 : return (const_reverse_iterator(end()));
  6010. ; 1601 : }
  6011. ; 1602 :
  6012. ; 1603 : reverse_iterator rend() _NOEXCEPT
  6013. ; 1604 : { // return iterator for end of reversed mutable sequence
  6014. ; 1605 : return (reverse_iterator(begin()));
  6015. ; 1606 : }
  6016. ; 1607 :
  6017. ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
  6018. ; 1609 : { // return iterator for end of reversed nonmutable sequence
  6019. ; 1610 : return (const_reverse_iterator(begin()));
  6020. ; 1611 : }
  6021. ; 1612 :
  6022. ; 1613 : #if _HAS_CPP0X
  6023. ; 1614 : const_iterator cbegin() const _NOEXCEPT
  6024. ; 1615 : { // return iterator for beginning of nonmutable sequence
  6025. ; 1616 : return (((const _Myt *)this)->begin());
  6026. ; 1617 : }
  6027. ; 1618 :
  6028. ; 1619 : const_iterator cend() const _NOEXCEPT
  6029. ; 1620 : { // return iterator for end of nonmutable sequence
  6030. ; 1621 : return (((const _Myt *)this)->end());
  6031. ; 1622 : }
  6032. ; 1623 :
  6033. ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
  6034. ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
  6035. ; 1626 : return (((const _Myt *)this)->rbegin());
  6036. ; 1627 : }
  6037. ; 1628 :
  6038. ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
  6039. ; 1630 : { // return iterator for end of reversed nonmutable sequence
  6040. ; 1631 : return (((const _Myt *)this)->rend());
  6041. ; 1632 : }
  6042. ; 1633 :
  6043. ; 1634 : void shrink_to_fit()
  6044. ; 1635 : { // reduce capacity
  6045. ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
  6046. ; 1637 : { // worth shrinking, do it
  6047. ; 1638 : _Myt _Tmp(*this);
  6048. ; 1639 : swap(_Tmp);
  6049. ; 1640 : }
  6050. ; 1641 : }
  6051. ; 1642 : #endif /* _HAS_CPP0X */
  6052. ; 1643 :
  6053. ; 1644 : reference at(size_type _Off)
  6054. ; 1645 : { // subscript mutable sequence with checking
  6055. ; 1646 : if (this->_Mysize <= _Off)
  6056. ; 1647 : _Xran(); // _Off off end
  6057. ; 1648 : return (this->_Myptr()[_Off]);
  6058. ; 1649 : }
  6059. ; 1650 :
  6060. ; 1651 : const_reference at(size_type _Off) const
  6061. ; 1652 : { // subscript nonmutable sequence with checking
  6062. ; 1653 : if (this->_Mysize <= _Off)
  6063. ; 1654 : _Xran(); // _Off off end
  6064. ; 1655 : return (this->_Myptr()[_Off]);
  6065. ; 1656 : }
  6066. ; 1657 :
  6067. ; 1658 : reference operator[](size_type _Off)
  6068. ; 1659 : { // subscript mutable sequence
  6069. ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
  6070. ; 1661 : if (this->_Mysize < _Off) // sic
  6071. ; 1662 : _DEBUG_ERROR("string subscript out of range");
  6072. ; 1663 :
  6073. ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
  6074. ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  6075. ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6076. ; 1667 :
  6077. ; 1668 : return (this->_Myptr()[_Off]);
  6078. ; 1669 : }
  6079. ; 1670 :
  6080. ; 1671 : const_reference operator[](size_type _Off) const
  6081. ; 1672 : { // subscript nonmutable sequence
  6082. ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
  6083. ; 1674 : if (this->_Mysize < _Off) // sic
  6084. ; 1675 : _DEBUG_ERROR("string subscript out of range");
  6085. ; 1676 :
  6086. ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
  6087. ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  6088. ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6089. ; 1680 :
  6090. ; 1681 : return (this->_Myptr()[_Off]);
  6091. ; 1682 : }
  6092. ; 1683 :
  6093. ; 1684 : void push_back(_Elem _Ch)
  6094. ; 1685 : { // insert element at end
  6095. ; 1686 : insert(end(), _Ch);
  6096. ; 1687 : }
  6097. ; 1688 :
  6098. ; 1689 : #if _HAS_CPP0X
  6099. ; 1690 : void pop_back()
  6100. ; 1691 : { // erase element at end
  6101. ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
  6102. ; 1693 : }
  6103. ; 1694 :
  6104. ; 1695 : reference front()
  6105. ; 1696 : { // return first element of mutable sequence
  6106. ; 1697 : return (*begin());
  6107. ; 1698 : }
  6108. ; 1699 :
  6109. ; 1700 : const_reference front() const
  6110. ; 1701 : { // return first element of nonmutable sequence
  6111. ; 1702 : return (*begin());
  6112. ; 1703 : }
  6113. ; 1704 :
  6114. ; 1705 : reference back()
  6115. ; 1706 : { // return last element of mutable sequence
  6116. ; 1707 : return (*(end() - 1));
  6117. ; 1708 : }
  6118. ; 1709 :
  6119. ; 1710 : const_reference back() const
  6120. ; 1711 : { // return last element of nonmutable sequence
  6121. ; 1712 : return (*(end() - 1));
  6122. ; 1713 : }
  6123. ; 1714 : #endif /* _HAS_CPP0X */
  6124. ; 1715 :
  6125. ; 1716 : const _Elem *c_str() const _NOEXCEPT
  6126. ; 1717 : { // return pointer to null-terminated nonmutable array
  6127. ; 1718 : return (this->_Myptr());
  6128. ; 1719 : }
  6129. ; 1720 :
  6130. ; 1721 : const _Elem *data() const _NOEXCEPT
  6131. ; 1722 : { // return pointer to nonmutable array
  6132. ; 1723 : return (c_str());
  6133. ; 1724 : }
  6134. ; 1725 :
  6135. ; 1726 : size_type length() const _NOEXCEPT
  6136. ; 1727 : { // return length of sequence
  6137. ; 1728 : return (this->_Mysize);
  6138. ; 1729 : }
  6139. ; 1730 :
  6140. ; 1731 : size_type size() const _NOEXCEPT
  6141. ; 1732 : { // return length of sequence
  6142. ; 1733 : return (this->_Mysize);
  6143. ; 1734 : }
  6144. ; 1735 :
  6145. ; 1736 : size_type max_size() const _NOEXCEPT
  6146. ; 1737 : { // return maximum possible length of sequence
  6147. ; 1738 : size_type _Num = this->_Getal().max_size();
  6148. ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
  6149. ; 1740 : }
  6150. ; 1741 :
  6151. ; 1742 : void resize(size_type _Newsize)
  6152. ; 1743 : { // determine new length, padding with null elements as needed
  6153. ; 1744 : resize(_Newsize, _Elem());
  6154. ; 1745 : }
  6155. ; 1746 :
  6156. ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
  6157. ; 1748 : { // determine new length, padding with _Ch elements as needed
  6158. ; 1749 : if (_Newsize <= this->_Mysize)
  6159. ; 1750 : _Eos(_Newsize);
  6160. ; 1751 : else
  6161. ; 1752 : append(_Newsize - this->_Mysize, _Ch);
  6162. ; 1753 : }
  6163. ; 1754 :
  6164. ; 1755 : size_type capacity() const _NOEXCEPT
  6165. ; 1756 : { // return current length of allocated storage
  6166. ; 1757 : return (this->_Myres);
  6167. ; 1758 : }
  6168. ; 1759 :
  6169. ; 1760 : void reserve(size_type _Newcap = 0)
  6170. ; 1761 : { // determine new minimum length of allocated storage
  6171. ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
  6172. ; 1763 : { // change reservation
  6173. ; 1764 : size_type _Size = this->_Mysize;
  6174. ; 1765 : if (_Grow(_Newcap, true))
  6175. ; 1766 : _Eos(_Size);
  6176. ; 1767 : }
  6177. ; 1768 : }
  6178. ; 1769 :
  6179. ; 1770 : bool empty() const _NOEXCEPT
  6180. ; 1771 : { // test if sequence is empty
  6181. ; 1772 : return (this->_Mysize == 0);
  6182. ; 1773 : }
  6183. ; 1774 :
  6184. ; 1775 : _SCL_INSECURE_DEPRECATE
  6185. ; 1776 :
  6186. ; 1777 : size_type copy(_Elem *_Ptr,
  6187. ; 1778 : size_type _Count, size_type _Off = 0) const
  6188. ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
  6189. ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
  6190. ; 1781 : if (_Count != 0)
  6191. ; 1782 : _DEBUG_POINTER(_Ptr);
  6192. ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6193. ; 1784 :
  6194. ; 1785 : if (this->_Mysize < _Off)
  6195. ; 1786 : _Xran(); // _Off off end
  6196. ; 1787 : if (this->_Mysize - _Off < _Count)
  6197. ; 1788 : _Count = this->_Mysize - _Off;
  6198. ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
  6199. ; 1790 : return (_Count);
  6200. ; 1791 : }
  6201. ; 1792 :
  6202. ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
  6203. ; 1794 : size_type _Count, size_type _Off = 0) const
  6204. ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
  6205. ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
  6206. ; 1797 : if (_Count != 0)
  6207. ; 1798 : _DEBUG_POINTER(_Dest);
  6208. ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6209. ; 1800 :
  6210. ; 1801 : if (this->_Mysize < _Off)
  6211. ; 1802 : _Xran(); // _Off off end
  6212. ; 1803 : if (this->_Mysize - _Off < _Count)
  6213. ; 1804 : _Count = this->_Mysize - _Off;
  6214. ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
  6215. ; 1806 : return (_Count);
  6216. ; 1807 : }
  6217. ; 1808 :
  6218. ; 1809 : void _Swap_bx(_Myt& _Right)
  6219. ; 1810 : { // exchange _Bx with _Right._Bx
  6220. ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
  6221. ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
  6222. ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
  6223. ; 1814 : else
  6224. ; 1815 : { // swap large with small
  6225. ; 1816 : pointer _Ptr = this->_Bx._Ptr;
  6226. ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
  6227. ; 1818 : _Traits::copy(this->_Bx._Buf,
  6228. ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
  6229. ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
  6230. ; 1821 : }
  6231. ; 1822 : else
  6232. ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
  6233. ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
  6234. ; 1825 : else
  6235. ; 1826 : { // swap small with large
  6236. ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
  6237. ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
  6238. ; 1829 : _Traits::copy(_Right._Bx._Buf,
  6239. ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
  6240. ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  6241. ; 1832 : }
  6242. ; 1833 : }
  6243. ; 1834 :
  6244. ; 1835 : void swap(_Myt& _Right)
  6245. ; 1836 : { // exchange contents with _Right
  6246. ; 1837 : if (this == &_Right)
  6247. ; 1838 : ; // same object, do nothing
  6248. ; 1839 : else if (this->_Getal() == _Right._Getal())
  6249. ; 1840 : { // same allocator, swap control information
  6250. ; 1841 : this->_Swap_all(_Right);
  6251. ; 1842 : _Swap_bx(_Right);
  6252. ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
  6253. ; 1844 : _STD swap(this->_Myres, _Right._Myres);
  6254. ; 1845 : }
  6255. ; 1846 :
  6256. ; 1847 : #if _HAS_CPP0X
  6257. ; 1848 : else if (_Alty::propagate_on_container_swap::value)
  6258. ; 1849 : { // swap allocators and control information
  6259. ; 1850 : this->_Swap_alloc(_Right);
  6260. ; 1851 : _Swap_bx(_Right);
  6261. ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
  6262. ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
  6263. ; 1854 : _STD swap(this->_Myres, _Right._Myres);
  6264. ; 1855 : }
  6265. ; 1856 : #endif /* _HAS_CPP0X */
  6266. ; 1857 :
  6267. ; 1858 : else
  6268. ; 1859 : { // different allocator, do multiple assigns
  6269. ; 1860 : _Myt _Tmp = *this;
  6270. ; 1861 :
  6271. ; 1862 : *this = _Right;
  6272. ; 1863 : _Right = _Tmp;
  6273. ; 1864 : }
  6274. ; 1865 : }
  6275. ; 1866 :
  6276. ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
  6277. ; 1868 : { // look for _Right beginning at or after _Off
  6278. ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
  6279. ; 1870 : }
  6280. ; 1871 :
  6281. ; 1872 : size_type find(const _Elem *_Ptr,
  6282. ; 1873 : size_type _Off, size_type _Count) const
  6283. ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
  6284. ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
  6285. ; 1876 : if (_Count != 0)
  6286. ; 1877 : _DEBUG_POINTER(_Ptr);
  6287. ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6288. ; 1879 :
  6289. ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
  6290. ; 1881 : return (_Off); // null string always matches (if inside string)
  6291. ; 1882 :
  6292. ; 1883 : size_type _Nm;
  6293. ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
  6294. ; 1885 : { // room for match, look for it
  6295. ; 1886 : const _Elem *_Uptr, *_Vptr;
  6296. ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
  6297. ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
  6298. ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
  6299. ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
  6300. ; 1891 : return (_Uptr - this->_Myptr()); // found a match
  6301. ; 1892 : }
  6302. ; 1893 :
  6303. ; 1894 : return (npos); // no match
  6304. ; 1895 : }
  6305. ; 1896 :
  6306. ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
  6307. ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
  6308. ; 1899 : _DEBUG_POINTER(_Ptr);
  6309. ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
  6310. ; 1901 : }
  6311. ; 1902 :
  6312. ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
  6313. ; 1904 : { // look for _Ch at or after _Off
  6314. ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
  6315. ; 1906 : }
  6316. ; 1907 :
  6317. ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
  6318. ; 1909 : { // look for _Right beginning before _Off
  6319. ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
  6320. ; 1911 : }
  6321. ; 1912 :
  6322. ; 1913 : size_type rfind(const _Elem *_Ptr,
  6323. ; 1914 : size_type _Off, size_type _Count) const
  6324. ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
  6325. ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
  6326. ; 1917 : if (_Count != 0)
  6327. ; 1918 : _DEBUG_POINTER(_Ptr);
  6328. ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6329. ; 1920 :
  6330. ; 1921 : if (_Count == 0)
  6331. ; 1922 : return (_Off < this->_Mysize ? _Off
  6332. ; 1923 : : this->_Mysize); // null always matches
  6333. ; 1924 : if (_Count <= this->_Mysize)
  6334. ; 1925 : { // room for match, look for it
  6335. ; 1926 : const _Elem *_Uptr = this->_Myptr() +
  6336. ; 1927 : (_Off < this->_Mysize - _Count ? _Off
  6337. ; 1928 : : this->_Mysize - _Count);
  6338. ; 1929 : for (; ; --_Uptr)
  6339. ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
  6340. ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
  6341. ; 1932 : return (_Uptr - this->_Myptr()); // found a match
  6342. ; 1933 : else if (_Uptr == this->_Myptr())
  6343. ; 1934 : break; // at beginning, no more chance for match
  6344. ; 1935 : }
  6345. ; 1936 :
  6346. ; 1937 : return (npos); // no match
  6347. ; 1938 : }
  6348. ; 1939 :
  6349. ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
  6350. ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
  6351. ; 1942 : _DEBUG_POINTER(_Ptr);
  6352. ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
  6353. ; 1944 : }
  6354. ; 1945 :
  6355. ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
  6356. ; 1947 : { // look for _Ch before _Off
  6357. ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  6358. ; 1949 : }
  6359. ; 1950 :
  6360. ; 1951 : size_type find_first_of(const _Myt& _Right,
  6361. ; 1952 : size_type _Off = 0) const _NOEXCEPT
  6362. ; 1953 : { // look for one of _Right at or after _Off
  6363. ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
  6364. ; 1955 : }
  6365. ; 1956 :
  6366. ; 1957 : size_type find_first_of(const _Elem *_Ptr,
  6367. ; 1958 : size_type _Off, size_type _Count) const
  6368. ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
  6369. ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
  6370. ; 1961 : if (_Count != 0)
  6371. ; 1962 : _DEBUG_POINTER(_Ptr);
  6372. ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6373. ; 1964 :
  6374. ; 1965 : if (0 < _Count && _Off < this->_Mysize)
  6375. ; 1966 : { // room for match, look for it
  6376. ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  6377. ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  6378. ; 1969 : _Uptr < _Vptr; ++_Uptr)
  6379. ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  6380. ; 1971 : return (_Uptr - this->_Myptr()); // found a match
  6381. ; 1972 : }
  6382. ; 1973 :
  6383. ; 1974 : return (npos); // no match
  6384. ; 1975 : }
  6385. ; 1976 :
  6386. ; 1977 : size_type find_first_of(const _Elem *_Ptr,
  6387. ; 1978 : size_type _Off = 0) const
  6388. ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
  6389. ; 1980 : _DEBUG_POINTER(_Ptr);
  6390. ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
  6391. ; 1982 : }
  6392. ; 1983 :
  6393. ; 1984 : size_type find_first_of(_Elem _Ch,
  6394. ; 1985 : size_type _Off = 0) const
  6395. ; 1986 : { // look for _Ch at or after _Off
  6396. ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
  6397. ; 1988 : }
  6398. ; 1989 :
  6399. ; 1990 : size_type find_last_of(const _Myt& _Right,
  6400. ; 1991 : size_type _Off = npos) const _NOEXCEPT
  6401. ; 1992 : { // look for one of _Right before _Off
  6402. ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
  6403. ; 1994 : }
  6404. ; 1995 :
  6405. ; 1996 : size_type find_last_of(const _Elem *_Ptr,
  6406. ; 1997 : size_type _Off, size_type _Count) const
  6407. ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
  6408. ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
  6409. ; 2000 : if (_Count != 0)
  6410. ; 2001 : _DEBUG_POINTER(_Ptr);
  6411. ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6412. ; 2003 :
  6413. ; 2004 : if (0 < _Count && 0 < this->_Mysize)
  6414. ; 2005 : { // worth searching, do it
  6415. ; 2006 : const _Elem *_Uptr = this->_Myptr()
  6416. ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  6417. ; 2008 : for (; ; --_Uptr)
  6418. ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  6419. ; 2010 : return (_Uptr - this->_Myptr()); // found a match
  6420. ; 2011 : else if (_Uptr == this->_Myptr())
  6421. ; 2012 : break; // at beginning, no more chance for match
  6422. ; 2013 : }
  6423. ; 2014 :
  6424. ; 2015 : return (npos); // no match
  6425. ; 2016 : }
  6426. ; 2017 :
  6427. ; 2018 : size_type find_last_of(const _Elem *_Ptr,
  6428. ; 2019 : size_type _Off = npos) const
  6429. ; 2020 : { // look for one of [_Ptr, <null>) before _Off
  6430. ; 2021 : _DEBUG_POINTER(_Ptr);
  6431. ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
  6432. ; 2023 : }
  6433. ; 2024 :
  6434. ; 2025 : size_type find_last_of(_Elem _Ch,
  6435. ; 2026 : size_type _Off = npos) const
  6436. ; 2027 : { // look for _Ch before _Off
  6437. ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  6438. ; 2029 : }
  6439. ; 2030 :
  6440. ; 2031 : size_type find_first_not_of(const _Myt& _Right,
  6441. ; 2032 : size_type _Off = 0) const _NOEXCEPT
  6442. ; 2033 : { // look for none of _Right at or after _Off
  6443. ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
  6444. ; 2035 : _Right.size()));
  6445. ; 2036 : }
  6446. ; 2037 :
  6447. ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
  6448. ; 2039 : size_type _Off, size_type _Count) const
  6449. ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
  6450. ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
  6451. ; 2042 : if (_Count != 0)
  6452. ; 2043 : _DEBUG_POINTER(_Ptr);
  6453. ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6454. ; 2045 :
  6455. ; 2046 : if (_Off < this->_Mysize)
  6456. ; 2047 : { // room for match, look for it
  6457. ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  6458. ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  6459. ; 2050 : _Uptr < _Vptr; ++_Uptr)
  6460. ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  6461. ; 2052 : return (_Uptr - this->_Myptr());
  6462. ; 2053 : }
  6463. ; 2054 : return (npos);
  6464. ; 2055 : }
  6465. ; 2056 :
  6466. ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
  6467. ; 2058 : size_type _Off = 0) const
  6468. ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
  6469. ; 2060 : _DEBUG_POINTER(_Ptr);
  6470. ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  6471. ; 2062 : }
  6472. ; 2063 :
  6473. ; 2064 : size_type find_first_not_of(_Elem _Ch,
  6474. ; 2065 : size_type _Off = 0) const
  6475. ; 2066 : { // look for non _Ch at or after _Off
  6476. ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
  6477. ; 2068 : }
  6478. ; 2069 :
  6479. ; 2070 : size_type find_last_not_of(const _Myt& _Right,
  6480. ; 2071 : size_type _Off = npos) const _NOEXCEPT
  6481. ; 2072 : { // look for none of _Right before _Off
  6482. ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
  6483. ; 2074 : }
  6484. ; 2075 :
  6485. ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
  6486. ; 2077 : size_type _Off, size_type _Count) const
  6487. ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
  6488. ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
  6489. ; 2080 : if (_Count != 0)
  6490. ; 2081 : _DEBUG_POINTER(_Ptr);
  6491. ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6492. ; 2083 :
  6493. ; 2084 : if (0 < this->_Mysize)
  6494. ; 2085 : { // worth searching, do it
  6495. ; 2086 : const _Elem *_Uptr = this->_Myptr()
  6496. ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  6497. ; 2088 : for (; ; --_Uptr)
  6498. ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  6499. ; 2090 : return (_Uptr - this->_Myptr());
  6500. ; 2091 : else if (_Uptr == this->_Myptr())
  6501. ; 2092 : break;
  6502. ; 2093 : }
  6503. ; 2094 : return (npos);
  6504. ; 2095 : }
  6505. ; 2096 :
  6506. ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
  6507. ; 2098 : size_type _Off = npos) const
  6508. ; 2099 : { // look for none of [_Ptr, <null>) before _Off
  6509. ; 2100 : _DEBUG_POINTER(_Ptr);
  6510. ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  6511. ; 2102 : }
  6512. ; 2103 :
  6513. ; 2104 : size_type find_last_not_of(_Elem _Ch,
  6514. ; 2105 : size_type _Off = npos) const
  6515. ; 2106 : { // look for non _Ch before _Off
  6516. ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
  6517. ; 2108 : }
  6518. ; 2109 :
  6519. ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
  6520. ; 2111 : { // return [_Off, _Off + _Count) as new string
  6521. ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
  6522. ; 2113 : }
  6523. ; 2114 :
  6524. ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
  6525. ; 2116 : { // compare [0, _Mysize) with _Right
  6526. ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
  6527. ; 2118 : }
  6528. ; 2119 :
  6529. ; 2120 : int compare(size_type _Off, size_type _N0,
  6530. ; 2121 : const _Myt& _Right) const
  6531. ; 2122 : { // compare [_Off, _Off + _N0) with _Right
  6532. ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
  6533. ; 2124 : }
  6534. ; 2125 :
  6535. ; 2126 : int compare(size_type _Off,
  6536. ; 2127 : size_type _N0, const _Myt& _Right,
  6537. ; 2128 : size_type _Roff, size_type _Count) const
  6538. ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  6539. ; 2130 : if (_Right.size() < _Roff)
  6540. ; 2131 : _Xran(); // _Off off end
  6541. ; 2132 : if (_Right._Mysize - _Roff < _Count)
  6542. ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
  6543. ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
  6544. ; 2135 : }
  6545. ; 2136 :
  6546. ; 2137 : int compare(const _Elem *_Ptr) const
  6547. ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
  6548. ; 2139 : _DEBUG_POINTER(_Ptr);
  6549. ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
  6550. ; 2141 : }
  6551. ; 2142 :
  6552. ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
  6553. ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
  6554. ; 2145 : _DEBUG_POINTER(_Ptr);
  6555. ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  6556. ; 2147 : }
  6557. ; 2148 :
  6558. ; 2149 : int compare(size_type _Off,
  6559. ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
  6560. ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  6561. ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
  6562. ; 2153 : if (_Count != 0)
  6563. ; 2154 : _DEBUG_POINTER(_Ptr);
  6564. ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  6565. ; 2156 :
  6566. ; 2157 : if (this->_Mysize < _Off)
  6567. ; 2158 : _Xran(); // _Off off end
  6568. ; 2159 : if (this->_Mysize - _Off < _N0)
  6569. ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  6570. ; 2161 :
  6571. ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
  6572. ; 2163 : _N0 < _Count ? _N0 : _Count);
  6573. ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
  6574. ; 2165 : : _N0 == _Count ? 0 : +1);
  6575. ; 2166 : }
  6576. ; 2167 :
  6577. ; 2168 : allocator_type get_allocator() const _NOEXCEPT
  6578. ; 2169 : { // return allocator object for values
  6579. ; 2170 : return (this->_Getal());
  6580. ; 2171 : }
  6581. ; 2172 :
  6582. ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
  6583. ; 2174 : { // assign _Count copies of _Ch beginning at _Off
  6584. ; 2175 : if (_Count == 1)
  6585. ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
  6586. ; 2177 : else
  6587. ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
  6588. ; 2179 : }
  6589. ; 2180 :
  6590. ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
  6591. ; 2182 : { // copy _Oldlen elements to newly allocated buffer
  6592. ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
  6593. ; 2184 : if (max_size() < _Newres)
  6594. ; 2185 : _Newres = _Newsize; // undo roundup if too big
  6595. ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
  6596. ; 2187 : ;
  6597. ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
  6598. ; 2189 : _Newres = this->_Myres
  6599. ; 2190 : + this->_Myres / 2; // grow exponentially if possible
  6600. ; 2191 : else
  6601. ; 2192 : _Newres = max_size(); // settle for max_size()
  6602. ; 2193 :
  6603. ; 2194 : _Elem *_Ptr;
  6604. ; 2195 : _TRY_BEGIN
  6605. ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
  6606. ; 2197 : _CATCH_ALL
  6607. ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
  6608. ; 2199 : _TRY_BEGIN
  6609. ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
  6610. ; 2201 : _CATCH_ALL
  6611. ; 2202 : _Tidy(true); // failed again, discard storage and reraise
  6612. ; 2203 : _RERAISE;
  6613. ; 2204 : _CATCH_END
  6614. ; 2205 : _CATCH_END
  6615. ; 2206 :
  6616. ; 2207 : if (0 < _Oldlen)
  6617. ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
  6618. ; 2209 : _Oldlen); // copy existing elements
  6619. ; 2210 : _Tidy(true);
  6620. ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  6621. ; 2212 : this->_Myres = _Newres;
  6622. ; 2213 : _Eos(_Oldlen);
  6623. ; 2214 : }
  6624. ; 2215 :
  6625. ; 2216 : void _Eos(size_type _Newsize)
  6626. ; 2217 : { // set new length and null terminator
  6627. ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
  6628.  
  6629. mov DWORD PTR [ecx+16], esi
  6630.  
  6631. ; 517 : : this->_Bx._Buf);
  6632.  
  6633. cmp eax, 16 ; 00000010H
  6634. jb SHORT $LN60@Grow
  6635. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  6636.  
  6637. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  6638.  
  6639. mov ecx, DWORD PTR [ecx]
  6640. $LN60@Grow:
  6641. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  6642.  
  6643. ; 564 : _Left = _Right;
  6644.  
  6645. mov BYTE PTR [ecx], 0
  6646. $LN64@Grow:
  6647. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  6648.  
  6649. ; 2233 : return (0 < _Newsize); // return true only if more work to do
  6650.  
  6651. xor eax, eax
  6652. cmp eax, esi
  6653. sbb eax, eax
  6654. neg eax
  6655. pop esi
  6656.  
  6657. ; 2234 : }
  6658.  
  6659. pop ebp
  6660. ret 8
  6661. $LN67@Grow:
  6662. ?_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
  6663. _TEXT ENDS
  6664. ; Function compile flags: /Ogtp
  6665. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  6666. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  6667. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  6668. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  6669. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  6670. ; COMDAT ?_Inside@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE_NPBD@Z
  6671. _TEXT SEGMENT
  6672. __Ptr$ = 8 ; size = 4
  6673. ?_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
  6674. ; _this$ = ecx
  6675.  
  6676. ; 2237 : { // test if _Ptr points inside string
  6677.  
  6678. push ebp
  6679. mov ebp, esp
  6680.  
  6681. ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
  6682. ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
  6683.  
  6684. mov edx, DWORD PTR __Ptr$[ebp]
  6685. push esi
  6686. test edx, edx
  6687. je SHORT $LN2@Inside
  6688.  
  6689. ; 517 : : this->_Bx._Buf);
  6690.  
  6691. mov eax, DWORD PTR [ecx+20]
  6692. cmp eax, 16 ; 00000010H
  6693. jb SHORT $LN8@Inside
  6694. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  6695.  
  6696. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  6697.  
  6698. mov esi, DWORD PTR [ecx]
  6699. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  6700.  
  6701. ; 517 : : this->_Bx._Buf);
  6702.  
  6703. jmp SHORT $LN9@Inside
  6704. $LN8@Inside:
  6705. mov esi, ecx
  6706. $LN9@Inside:
  6707.  
  6708. ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
  6709. ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
  6710.  
  6711. cmp edx, esi
  6712. jb SHORT $LN2@Inside
  6713.  
  6714. ; 517 : : this->_Bx._Buf);
  6715.  
  6716. cmp eax, 16 ; 00000010H
  6717. jb SHORT $LN14@Inside
  6718. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  6719.  
  6720. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  6721.  
  6722. mov esi, DWORD PTR [ecx]
  6723. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  6724.  
  6725. ; 517 : : this->_Bx._Buf);
  6726.  
  6727. jmp SHORT $LN15@Inside
  6728. $LN14@Inside:
  6729. mov esi, ecx
  6730. $LN15@Inside:
  6731.  
  6732. ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
  6733. ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
  6734.  
  6735. mov eax, DWORD PTR [ecx+16]
  6736. add eax, esi
  6737. cmp eax, edx
  6738. jbe SHORT $LN2@Inside
  6739.  
  6740. ; 2241 : else
  6741. ; 2242 : return (true);
  6742.  
  6743. mov al, 1
  6744. pop esi
  6745.  
  6746. ; 2243 : }
  6747.  
  6748. pop ebp
  6749. ret 4
  6750. $LN2@Inside:
  6751.  
  6752. ; 2240 : return (false); // don't ask
  6753.  
  6754. xor al, al
  6755. pop esi
  6756.  
  6757. ; 2243 : }
  6758.  
  6759. pop ebp
  6760. ret 4
  6761. ?_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
  6762. _TEXT ENDS
  6763. ; Function compile flags: /Ogtp
  6764. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  6765. ; COMDAT ?_Xlen@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEXXZ
  6766. _TEXT SEGMENT
  6767. ?_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
  6768. ; _this$dead$ = ecx
  6769.  
  6770. ; 2271 : _Xlength_error("string too long");
  6771.  
  6772. push OFFSET ??_C@_0BA@JFNIOLAK@string?5too?5long?$AA@
  6773. call DWORD PTR __imp_?_Xlength_error@std@@YAXPBD@Z
  6774. $LN4@Xlen:
  6775. $LN3@Xlen:
  6776. int 3
  6777. ?_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
  6778. _TEXT ENDS
  6779. ; Function compile flags: /Ogtp
  6780. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  6781. ; COMDAT ?deallocate@?$allocator@D@std@@QAEXPADI@Z
  6782. _TEXT SEGMENT
  6783. __Ptr$ = 8 ; size = 4
  6784. ___formal$dead$ = 12 ; size = 4
  6785. ?deallocate@?$allocator@D@std@@QAEXPADI@Z PROC ; std::allocator<char>::deallocate, COMDAT
  6786. ; _this$dead$ = ecx
  6787.  
  6788. ; 585 : { // deallocate object at _Ptr, ignore size
  6789.  
  6790. push ebp
  6791. mov ebp, esp
  6792.  
  6793. ; 586 : ::operator delete(_Ptr);
  6794.  
  6795. push DWORD PTR __Ptr$[ebp]
  6796. call DWORD PTR __imp_??3@YAXPAX@Z
  6797. add esp, 4
  6798.  
  6799. ; 587 : }
  6800.  
  6801. pop ebp
  6802. ret 8
  6803. ?deallocate@?$allocator@D@std@@QAEXPADI@Z ENDP ; std::allocator<char>::deallocate
  6804. _TEXT ENDS
  6805. ; Function compile flags: /Ogtp
  6806. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  6807. ; COMDAT ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ
  6808. _TEXT SEGMENT
  6809. ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ PROC ; std::_String_val<std::_Simple_types<char> >::_Myptr, COMDAT
  6810. ; _this$ = ecx
  6811.  
  6812. ; 515 : return (this->_BUF_SIZE <= this->_Myres
  6813. ; 516 : ? _STD addressof(*this->_Bx._Ptr)
  6814. ; 517 : : this->_Bx._Buf);
  6815.  
  6816. cmp DWORD PTR [ecx+20], 16 ; 00000010H
  6817. jb SHORT $LN3@Myptr
  6818. mov eax, DWORD PTR [ecx]
  6819.  
  6820. ; 518 : }
  6821.  
  6822. ret 0
  6823. $LN3@Myptr:
  6824.  
  6825. ; 515 : return (this->_BUF_SIZE <= this->_Myres
  6826. ; 516 : ? _STD addressof(*this->_Bx._Ptr)
  6827. ; 517 : : this->_Bx._Buf);
  6828.  
  6829. mov eax, ecx
  6830.  
  6831. ; 518 : }
  6832.  
  6833. ret 0
  6834. ?_Myptr@?$_String_val@U?$_Simple_types@D@std@@@std@@QAEPADXZ ENDP ; std::_String_val<std::_Simple_types<char> >::_Myptr
  6835. _TEXT ENDS
  6836. ; Function compile flags: /Ogtp
  6837. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  6838. ; COMDAT ?deallocate@?$allocator@H@std@@QAEXPAHI@Z
  6839. _TEXT SEGMENT
  6840. __Ptr$ = 8 ; size = 4
  6841. ___formal$dead$ = 12 ; size = 4
  6842. ?deallocate@?$allocator@H@std@@QAEXPAHI@Z PROC ; std::allocator<int>::deallocate, COMDAT
  6843. ; _this$dead$ = ecx
  6844.  
  6845. ; 585 : { // deallocate object at _Ptr, ignore size
  6846.  
  6847. push ebp
  6848. mov ebp, esp
  6849.  
  6850. ; 586 : ::operator delete(_Ptr);
  6851.  
  6852. push DWORD PTR __Ptr$[ebp]
  6853. call DWORD PTR __imp_??3@YAXPAX@Z
  6854. add esp, 4
  6855.  
  6856. ; 587 : }
  6857.  
  6858. pop ebp
  6859. ret 8
  6860. ?deallocate@?$allocator@H@std@@QAEXPAHI@Z ENDP ; std::allocator<int>::deallocate
  6861. _TEXT ENDS
  6862. ; Function compile flags: /Ogtp
  6863. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  6864. ; COMDAT ??0?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAE@XZ
  6865. _TEXT SEGMENT
  6866. ??0?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAE@XZ PROC ; std::_Wrap_alloc<std::allocator<int> >::_Wrap_alloc<std::allocator<int> >, COMDAT
  6867. ; _this$ = ecx
  6868.  
  6869. ; 831 : }
  6870.  
  6871. mov eax, ecx
  6872. ret 0
  6873. ??0?$_Wrap_alloc@V?$allocator@H@std@@@std@@QAE@XZ ENDP ; std::_Wrap_alloc<std::allocator<int> >::_Wrap_alloc<std::allocator<int> >
  6874. _TEXT ENDS
  6875. ; Function compile flags: /Ogtp
  6876. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  6877. ; COMDAT ?_Unused_capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ
  6878. _TEXT SEGMENT
  6879. ?_Unused_capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ PROC ; std::vector<double,std::allocator<double> >::_Unused_capacity, COMDAT
  6880. ; _this$ = ecx
  6881.  
  6882. ; 972 : return (this->_Myend - this->_Mylast);
  6883.  
  6884. mov eax, DWORD PTR [ecx+8]
  6885. sub eax, DWORD PTR [ecx+4]
  6886. sar eax, 3
  6887.  
  6888. ; 973 : }
  6889.  
  6890. ret 0
  6891. ?_Unused_capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ ENDP ; std::vector<double,std::allocator<double> >::_Unused_capacity
  6892. _TEXT ENDS
  6893. ; Function compile flags: /Ogtp
  6894. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  6895. ; 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
  6896. _TEXT SEGMENT
  6897. ___$ReturnUdt$ = 8 ; size = 4
  6898. __Where$ = 12 ; size = 4
  6899. ?_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
  6900. ; _this$dead$ = ecx
  6901.  
  6902. ; 1001 : { // make iterator from const_iterator
  6903.  
  6904. push ebp
  6905. mov ebp, esp
  6906.  
  6907. ; 47 : { // construct with pointer _Parg
  6908.  
  6909. mov eax, DWORD PTR ___$ReturnUdt$[ebp]
  6910. mov ecx, DWORD PTR __Where$[ebp]
  6911. mov DWORD PTR [eax], ecx
  6912.  
  6913. ; 1002 : return (iterator(_Where._Ptr, this));
  6914. ; 1003 : }
  6915.  
  6916. pop ebp
  6917. ret 8
  6918. ?_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
  6919. _TEXT ENDS
  6920. ; Function compile flags: /Ogtp
  6921. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  6922. ; COMDAT ?max_size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ
  6923. _TEXT SEGMENT
  6924. ?max_size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ PROC ; std::vector<double,std::allocator<double> >::max_size, COMDAT
  6925. ; _this$dead$ = ecx
  6926.  
  6927. ; 1092 : return (this->_Getal().max_size());
  6928.  
  6929. mov eax, 536870911 ; 1fffffffH
  6930.  
  6931. ; 1093 : }
  6932.  
  6933. ret 0
  6934. ?max_size@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ ENDP ; std::vector<double,std::allocator<double> >::max_size
  6935. _TEXT ENDS
  6936. ; Function compile flags: /Ogtp
  6937. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  6938. ; COMDAT ?clear@?$vector@NV?$allocator@N@std@@@std@@QAEXXZ
  6939. _TEXT SEGMENT
  6940. ?clear@?$vector@NV?$allocator@N@std@@@std@@QAEXXZ PROC ; std::vector<double,std::allocator<double> >::clear, COMDAT
  6941. ; _this$ = ecx
  6942.  
  6943. ; 1414 : this->_Orphan_all();
  6944. ; 1415 : _Destroy(this->_Myfirst, this->_Mylast);
  6945. ; 1416 : this->_Mylast = this->_Myfirst;
  6946.  
  6947. mov eax, DWORD PTR [ecx]
  6948. mov DWORD PTR [ecx+4], eax
  6949.  
  6950. ; 1417 : }
  6951.  
  6952. ret 0
  6953. ?clear@?$vector@NV?$allocator@N@std@@@std@@QAEXXZ ENDP ; std::vector<double,std::allocator<double> >::clear
  6954. _TEXT ENDS
  6955. ; Function compile flags: /Ogtp
  6956. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  6957. ; COMDAT ?_Grow_to@?$vector@NV?$allocator@N@std@@@std@@IBEII@Z
  6958. _TEXT SEGMENT
  6959. __Count$ = 8 ; size = 4
  6960. ?_Grow_to@?$vector@NV?$allocator@N@std@@@std@@IBEII@Z PROC ; std::vector<double,std::allocator<double> >::_Grow_to, COMDAT
  6961. ; _this$ = ecx
  6962.  
  6963. ; 1484 : { // grow by 50% or at least to _Count
  6964.  
  6965. push ebp
  6966. mov ebp, esp
  6967.  
  6968. ; 967 : return (this->_Myend - this->_Myfirst);
  6969.  
  6970. mov edx, DWORD PTR [ecx+8]
  6971. sub edx, DWORD PTR [ecx]
  6972.  
  6973. ; 1485 : size_type _Capacity = capacity();
  6974. ; 1486 :
  6975. ; 1487 : _Capacity = max_size() - _Capacity / 2 < _Capacity
  6976. ; 1488 : ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
  6977.  
  6978. mov eax, 536870911 ; 1fffffffH
  6979.  
  6980. ; 967 : return (this->_Myend - this->_Myfirst);
  6981.  
  6982. sar edx, 3
  6983.  
  6984. ; 1485 : size_type _Capacity = capacity();
  6985. ; 1486 :
  6986. ; 1487 : _Capacity = max_size() - _Capacity / 2 < _Capacity
  6987. ; 1488 : ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
  6988.  
  6989. mov ecx, edx
  6990. shr ecx, 1
  6991. sub eax, ecx
  6992. cmp eax, edx
  6993. jae SHORT $LN4@Grow_to
  6994. xor edx, edx
  6995.  
  6996. ; 1489 : if (_Capacity < _Count)
  6997.  
  6998. cmp edx, DWORD PTR __Count$[ebp]
  6999. cmovb edx, DWORD PTR __Count$[ebp]
  7000.  
  7001. ; 1490 : _Capacity = _Count;
  7002. ; 1491 : return (_Capacity);
  7003.  
  7004. mov eax, edx
  7005.  
  7006. ; 1492 : }
  7007.  
  7008. pop ebp
  7009. ret 4
  7010. $LN4@Grow_to:
  7011.  
  7012. ; 1485 : size_type _Capacity = capacity();
  7013. ; 1486 :
  7014. ; 1487 : _Capacity = max_size() - _Capacity / 2 < _Capacity
  7015. ; 1488 : ? 0 : _Capacity + _Capacity / 2; // try to grow by 50%
  7016.  
  7017. add edx, ecx
  7018.  
  7019. ; 1489 : if (_Capacity < _Count)
  7020.  
  7021. cmp edx, DWORD PTR __Count$[ebp]
  7022. cmovb edx, DWORD PTR __Count$[ebp]
  7023.  
  7024. ; 1490 : _Capacity = _Count;
  7025. ; 1491 : return (_Capacity);
  7026.  
  7027. mov eax, edx
  7028.  
  7029. ; 1492 : }
  7030.  
  7031. pop ebp
  7032. ret 4
  7033. ?_Grow_to@?$vector@NV?$allocator@N@std@@@std@@IBEII@Z ENDP ; std::vector<double,std::allocator<double> >::_Grow_to
  7034. _TEXT ENDS
  7035. ; Function compile flags: /Ogtp
  7036. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7037. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  7038. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7039. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  7040. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7041. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  7042. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7043. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  7044. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7045. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  7046. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7047. ; COMDAT ?_Reallocate@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z
  7048. _TEXT SEGMENT
  7049. __Size$1$ = 8 ; size = 4
  7050. __Count$ = 8 ; size = 4
  7051. ?_Reallocate@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z PROC ; std::vector<double,std::allocator<double> >::_Reallocate, COMDAT
  7052. ; _this$ = ecx
  7053.  
  7054. ; 1500 : { // move to array of exactly _Count elements
  7055.  
  7056. push ebp
  7057. mov ebp, esp
  7058. push ebx
  7059. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  7060.  
  7061. ; 25 : if (_Count == 0)
  7062.  
  7063. mov ebx, DWORD PTR __Count$[ebp]
  7064. push esi
  7065.  
  7066. ; 23 : void *_Ptr = 0;
  7067.  
  7068. xor esi, esi
  7069. push edi
  7070. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7071.  
  7072. ; 1500 : { // move to array of exactly _Count elements
  7073.  
  7074. mov edi, ecx
  7075. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  7076.  
  7077. ; 25 : if (_Count == 0)
  7078.  
  7079. test ebx, ebx
  7080. je SHORT $LN16@Reallocate
  7081.  
  7082. ; 26 : ;
  7083. ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
  7084. ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
  7085.  
  7086. cmp ebx, 536870911 ; 1fffffffH
  7087. ja SHORT $LN15@Reallocate
  7088. lea eax, DWORD PTR [ebx*8]
  7089. push eax
  7090. call DWORD PTR __imp_??2@YAPAXI@Z
  7091. mov esi, eax
  7092. add esp, 4
  7093. test esi, esi
  7094. jne SHORT $LN16@Reallocate
  7095. $LN15@Reallocate:
  7096.  
  7097. ; 29 : _Xbad_alloc(); // report no memory
  7098.  
  7099. call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
  7100. $LN52@Reallocate:
  7101. $LN16@Reallocate:
  7102. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7103.  
  7104. ; 1504 : _Umove(this->_Myfirst, this->_Mylast, _Ptr);
  7105.  
  7106. mov ecx, DWORD PTR [edi]
  7107. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  7108.  
  7109. ; 461 : size_t _Count = (size_t)(_Last - _First);
  7110.  
  7111. mov eax, DWORD PTR [edi+4]
  7112. sub eax, ecx
  7113.  
  7114. ; 463 : _Count * sizeof (*_First)) + _Count); // NB: non-overlapping move
  7115.  
  7116. and eax, -8 ; fffffff8H
  7117. push eax
  7118. push ecx
  7119. push esi
  7120. call DWORD PTR __imp__memmove
  7121. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7122.  
  7123. ; 1087 : return (this->_Mylast - this->_Myfirst);
  7124.  
  7125. mov ecx, DWORD PTR [edi]
  7126. mov eax, DWORD PTR [edi+4]
  7127. sub eax, ecx
  7128. sar eax, 3
  7129. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  7130.  
  7131. ; 463 : _Count * sizeof (*_First)) + _Count); // NB: non-overlapping move
  7132.  
  7133. add esp, 12 ; 0000000cH
  7134. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7135.  
  7136. ; 1087 : return (this->_Mylast - this->_Myfirst);
  7137.  
  7138. mov DWORD PTR __Size$1$[ebp], eax
  7139.  
  7140. ; 1505 : _CATCH_ALL
  7141. ; 1506 : this->_Getal().deallocate(_Ptr, _Count);
  7142. ; 1507 : _RERAISE;
  7143. ; 1508 : _CATCH_END
  7144. ; 1509 :
  7145. ; 1510 : size_type _Size = size();
  7146. ; 1511 : if (this->_Myfirst != pointer())
  7147.  
  7148. test ecx, ecx
  7149. je SHORT $LN46@Reallocate
  7150. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  7151.  
  7152. ; 586 : ::operator delete(_Ptr);
  7153.  
  7154. push ecx
  7155. call DWORD PTR __imp_??3@YAXPAX@Z
  7156. add esp, 4
  7157. $LN46@Reallocate:
  7158. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7159.  
  7160. ; 1519 : this->_Myend = _Ptr + _Count;
  7161.  
  7162. lea eax, DWORD PTR [esi+ebx*8]
  7163. mov DWORD PTR [edi+8], eax
  7164.  
  7165. ; 1520 : this->_Mylast = _Ptr + _Size;
  7166.  
  7167. mov eax, DWORD PTR __Size$1$[ebp]
  7168.  
  7169. ; 1521 : this->_Myfirst = _Ptr;
  7170.  
  7171. mov DWORD PTR [edi], esi
  7172. lea eax, DWORD PTR [esi+eax*8]
  7173. mov DWORD PTR [edi+4], eax
  7174. pop edi
  7175. pop esi
  7176. pop ebx
  7177.  
  7178. ; 1522 : }
  7179.  
  7180. pop ebp
  7181. ret 4
  7182. $LN51@Reallocate:
  7183. ?_Reallocate@?$vector@NV?$allocator@N@std@@@std@@IAEXI@Z ENDP ; std::vector<double,std::allocator<double> >::_Reallocate
  7184. _TEXT ENDS
  7185. ; Function compile flags: /Ogtp
  7186. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7187. ; COMDAT ?_Xlen@?$vector@NV?$allocator@N@std@@@std@@IBEXXZ
  7188. _TEXT SEGMENT
  7189. ?_Xlen@?$vector@NV?$allocator@N@std@@@std@@IBEXXZ PROC ; std::vector<double,std::allocator<double> >::_Xlen, COMDAT
  7190. ; _this$dead$ = ecx
  7191.  
  7192. ; 1667 : _Xlength_error("vector<T> too long");
  7193.  
  7194. push OFFSET ??_C@_0BD@OLBABOEK@vector?$DMT?$DO?5too?5long?$AA@
  7195. call DWORD PTR __imp_?_Xlength_error@std@@YAXPBD@Z
  7196. $LN4@Xlen:
  7197. $LN3@Xlen:
  7198. int 3
  7199. ?_Xlen@?$vector@NV?$allocator@N@std@@@std@@IBEXXZ ENDP ; std::vector<double,std::allocator<double> >::_Xlen
  7200. _TEXT ENDS
  7201. ; Function compile flags: /Ogtp
  7202. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  7203. ; COMDAT ?deallocate@?$allocator@N@std@@QAEXPANI@Z
  7204. _TEXT SEGMENT
  7205. __Ptr$ = 8 ; size = 4
  7206. ___formal$dead$ = 12 ; size = 4
  7207. ?deallocate@?$allocator@N@std@@QAEXPANI@Z PROC ; std::allocator<double>::deallocate, COMDAT
  7208. ; _this$dead$ = ecx
  7209.  
  7210. ; 585 : { // deallocate object at _Ptr, ignore size
  7211.  
  7212. push ebp
  7213. mov ebp, esp
  7214.  
  7215. ; 586 : ::operator delete(_Ptr);
  7216.  
  7217. push DWORD PTR __Ptr$[ebp]
  7218. call DWORD PTR __imp_??3@YAXPAX@Z
  7219. add esp, 4
  7220.  
  7221. ; 587 : }
  7222.  
  7223. pop ebp
  7224. ret 8
  7225. ?deallocate@?$allocator@N@std@@QAEXPANI@Z ENDP ; std::allocator<double>::deallocate
  7226. _TEXT ENDS
  7227. ; Function compile flags: /Ogtp
  7228. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  7229. ; COMDAT ??0?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAE@XZ
  7230. _TEXT SEGMENT
  7231. ??0?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAE@XZ PROC ; std::_Wrap_alloc<std::allocator<double> >::_Wrap_alloc<std::allocator<double> >, COMDAT
  7232. ; _this$ = ecx
  7233.  
  7234. ; 831 : }
  7235.  
  7236. mov eax, ecx
  7237. ret 0
  7238. ??0?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAE@XZ ENDP ; std::_Wrap_alloc<std::allocator<double> >::_Wrap_alloc<std::allocator<double> >
  7239. _TEXT ENDS
  7240. ; Function compile flags: /Ogtp
  7241. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7242. ; COMDAT ??0?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAE@PANPBU_Container_base0@1@@Z
  7243. _TEXT SEGMENT
  7244. __Parg$ = 8 ; size = 4
  7245. __Pvector$dead$ = 12 ; size = 4
  7246. ??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
  7247. ; _this$ = ecx
  7248.  
  7249. ; 306 : { // construct with pointer _Parg
  7250.  
  7251. push ebp
  7252. mov ebp, esp
  7253.  
  7254. ; 47 : { // construct with pointer _Parg
  7255.  
  7256. mov eax, DWORD PTR __Parg$[ebp]
  7257. mov DWORD PTR [ecx], eax
  7258.  
  7259. ; 307 : }
  7260.  
  7261. mov eax, ecx
  7262. pop ebp
  7263. ret 8
  7264. ??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> > >
  7265. _TEXT ENDS
  7266. ; Function compile flags: /Ogtp
  7267. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7268. ; COMDAT ??Y?$_Vector_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAEAAV01@H@Z
  7269. _TEXT SEGMENT
  7270. __Off$ = 8 ; size = 4
  7271. ??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
  7272. ; _this$ = ecx
  7273.  
  7274. ; 359 : { // increment by integer
  7275.  
  7276. push ebp
  7277. mov ebp, esp
  7278.  
  7279. ; 170 : _Ptr += _Off;
  7280.  
  7281. mov eax, DWORD PTR __Off$[ebp]
  7282. shl eax, 3
  7283. add DWORD PTR [ecx], eax
  7284.  
  7285. ; 360 : *(_Mybase *)this += _Off;
  7286. ; 361 : return (*this);
  7287.  
  7288. mov eax, ecx
  7289.  
  7290. ; 362 : }
  7291.  
  7292. pop ebp
  7293. ret 4
  7294. ??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+=
  7295. _TEXT ENDS
  7296. ; Function compile flags: /Ogtp
  7297. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7298. ; COMDAT ??8?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE_NABV01@@Z
  7299. _TEXT SEGMENT
  7300. __Right$ = 8 ; size = 4
  7301. ??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
  7302. ; _this$ = ecx
  7303.  
  7304. ; 203 : { // test for iterator equality
  7305.  
  7306. push ebp
  7307. mov ebp, esp
  7308.  
  7309. ; 204 : _Compat(_Right);
  7310. ; 205 : return (this->_Ptr == _Right._Ptr);
  7311.  
  7312. mov edx, DWORD PTR [ecx]
  7313. mov ecx, DWORD PTR __Right$[ebp]
  7314. xor eax, eax
  7315. cmp edx, DWORD PTR [ecx]
  7316. sete al
  7317.  
  7318. ; 206 : }
  7319.  
  7320. pop ebp
  7321. ret 4
  7322. ??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==
  7323. _TEXT ENDS
  7324. ; Function compile flags: /Ogtp
  7325. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  7326. ; COMDAT ??9?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBE_NABV01@@Z
  7327. _TEXT SEGMENT
  7328. __Right$ = 8 ; size = 4
  7329. ??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
  7330. ; _this$ = ecx
  7331.  
  7332. ; 209 : { // test for iterator inequality
  7333.  
  7334. push ebp
  7335. mov ebp, esp
  7336.  
  7337. ; 205 : return (this->_Ptr == _Right._Ptr);
  7338.  
  7339. mov edx, DWORD PTR [ecx]
  7340. mov ecx, DWORD PTR __Right$[ebp]
  7341.  
  7342. ; 210 : return (!(*this == _Right));
  7343.  
  7344. xor eax, eax
  7345.  
  7346. ; 205 : return (this->_Ptr == _Right._Ptr);
  7347.  
  7348. cmp edx, DWORD PTR [ecx]
  7349.  
  7350. ; 210 : return (!(*this == _Right));
  7351.  
  7352. setne al
  7353.  
  7354. ; 211 : }
  7355.  
  7356. pop ebp
  7357. ret 4
  7358. ??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!=
  7359. _TEXT ENDS
  7360. ; Function compile flags: /Ogtp
  7361. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  7362. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  7363. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  7364. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  7365. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  7366. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  7367. ; COMDAT ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@I@Z
  7368. _TEXT SEGMENT
  7369. __Off$ = 8 ; size = 4
  7370. ?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
  7371. ; _this$ = ecx
  7372.  
  7373. ; 1309 : { // erase elements [_Off, ...)
  7374.  
  7375. push ebp
  7376. mov ebp, esp
  7377.  
  7378. ; 1310 : if (this->_Mysize < _Off)
  7379.  
  7380. mov eax, DWORD PTR __Off$[ebp]
  7381. cmp DWORD PTR [ecx+16], eax
  7382. jae SHORT $LN1@erase
  7383.  
  7384. ; 2219 : }
  7385. ; 2220 :
  7386. ; 2221 : bool _Grow(size_type _Newsize,
  7387. ; 2222 : bool _Trim = false)
  7388. ; 2223 : { // ensure buffer is big enough, trim to size if _Trim is true
  7389. ; 2224 : if (max_size() < _Newsize)
  7390. ; 2225 : _Xlen(); // result too long
  7391. ; 2226 : if (this->_Myres < _Newsize)
  7392. ; 2227 : _Copy(_Newsize, this->_Mysize); // reallocate to grow
  7393. ; 2228 : else if (_Trim && _Newsize < this->_BUF_SIZE)
  7394. ; 2229 : _Tidy(true, // copy and deallocate if trimming to small string
  7395. ; 2230 : _Newsize < this->_Mysize ? _Newsize : this->_Mysize);
  7396. ; 2231 : else if (_Newsize == 0)
  7397. ; 2232 : _Eos(0); // new size is zero, just null terminate
  7398. ; 2233 : return (0 < _Newsize); // return true only if more work to do
  7399. ; 2234 : }
  7400. ; 2235 :
  7401. ; 2236 : bool _Inside(const _Elem *_Ptr)
  7402. ; 2237 : { // test if _Ptr points inside string
  7403. ; 2238 : if (_Ptr == 0 || _Ptr < this->_Myptr()
  7404. ; 2239 : || this->_Myptr() + this->_Mysize <= _Ptr)
  7405. ; 2240 : return (false); // don't ask
  7406. ; 2241 : else
  7407. ; 2242 : return (true);
  7408. ; 2243 : }
  7409. ; 2244 :
  7410. ; 2245 : static size_type _Pdif(const_iterator _P2,
  7411. ; 2246 : const_iterator _P1)
  7412. ; 2247 : { // compute safe iterator difference
  7413. ; 2248 : return (_STRING_ITER_BASE(_P2) == 0 ? 0 : _P2 - _P1);
  7414. ; 2249 : }
  7415. ; 2250 :
  7416. ; 2251 : void _Tidy(bool _Built = false,
  7417. ; 2252 : size_type _Newsize = 0)
  7418. ; 2253 : { // initialize buffer, deallocating any storage
  7419. ; 2254 : if (!_Built)
  7420. ; 2255 : ;
  7421. ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
  7422. ; 2257 : { // copy any leftovers to small buffer and deallocate
  7423. ; 2258 : pointer _Ptr = this->_Bx._Ptr;
  7424. ; 2259 : this->_Getal().destroy(&this->_Bx._Ptr);
  7425. ; 2260 : if (0 < _Newsize)
  7426. ; 2261 : _Traits::copy(this->_Bx._Buf,
  7427. ; 2262 : _STD addressof(*_Ptr), _Newsize);
  7428. ; 2263 : this->_Getal().deallocate(_Ptr, this->_Myres + 1);
  7429. ; 2264 : }
  7430. ; 2265 : this->_Myres = this->_BUF_SIZE - 1;
  7431. ; 2266 : _Eos(_Newsize);
  7432. ; 2267 : }
  7433. ; 2268 :
  7434. ; 2269 : __declspec(noreturn) void _Xlen() const
  7435. ; 2270 : { // report a length_error
  7436. ; 2271 : _Xlength_error("string too long");
  7437. ; 2272 : }
  7438. ; 2273 :
  7439. ; 2274 : __declspec(noreturn) void _Xran() const
  7440. ; 2275 : { // report an out_of_range error
  7441. ; 2276 : _Xout_of_range("invalid string position");
  7442.  
  7443. push OFFSET ??_C@_0BI@CFPLBAOH@invalid?5string?5position?$AA@
  7444. call DWORD PTR __imp_?_Xout_of_range@std@@YAXPBD@Z
  7445. $LN19@erase:
  7446. $LN1@erase:
  7447.  
  7448. ; 517 : : this->_Bx._Buf);
  7449.  
  7450. cmp DWORD PTR [ecx+20], 16 ; 00000010H
  7451.  
  7452. ; 1315 :
  7453. ; 1316 : _Myt& erase(size_type _Off, size_type _Count)
  7454. ; 1317 : { // erase elements [_Off, _Off + _Count)
  7455. ; 1318 : if (this->_Mysize < _Off)
  7456. ; 1319 : _Xran(); // _Off off end
  7457. ; 1320 : if (this->_Mysize - _Off <= _Count)
  7458. ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
  7459. ; 1322 : else if (0 < _Count)
  7460. ; 1323 : { // move elements down
  7461. ; 1324 : value_type *_Ptr = this->_Myptr() + _Off;
  7462. ; 1325 : size_type _Newsize = this->_Mysize - _Count;
  7463. ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
  7464. ; 1327 : _Eos(_Newsize);
  7465. ; 1328 : }
  7466. ; 1329 : return (*this);
  7467. ; 1330 : }
  7468. ; 1331 :
  7469. ; 1332 : iterator erase(const_iterator _Where)
  7470. ; 1333 : { // erase element at _Where
  7471. ; 1334 : size_type _Count = _Pdif(_Where, begin());
  7472. ; 1335 : erase(_Count, 1);
  7473. ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  7474. ; 1337 : }
  7475. ; 1338 :
  7476. ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
  7477. ; 1340 : { // erase substring [_First, _Last)
  7478. ; 1341 : _DEBUG_RANGE(_First, _Last);
  7479. ; 1342 : size_type _Count = _Pdif(_First, begin());
  7480. ; 1343 : erase(_Count, _Pdif(_Last, _First));
  7481. ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  7482. ; 1345 : }
  7483. ; 1346 :
  7484. ; 1347 : void clear() _NOEXCEPT
  7485. ; 1348 : { // erase all
  7486. ; 1349 : _Eos(0);
  7487. ; 1350 : }
  7488. ; 1351 :
  7489. ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
  7490. ; 1353 : { // replace [_Off, _Off + _N0) with _Right
  7491. ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
  7492. ; 1355 : }
  7493. ; 1356 :
  7494. ; 1357 : _Myt& replace(size_type _Off,
  7495. ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
  7496. ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  7497. ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
  7498. ; 1361 : _Xran(); // _Off or _Roff off end
  7499. ; 1362 : if (this->_Mysize - _Off < _N0)
  7500. ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  7501. ; 1364 : size_type _Num = _Right.size() - _Roff;
  7502. ; 1365 : if (_Num < _Count)
  7503. ; 1366 : _Count = _Num; // trim _Count to size
  7504. ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
  7505. ; 1368 : _Xlen(); // result too long
  7506. ; 1369 :
  7507. ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
  7508. ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
  7509. ; 1372 : if (this->_Mysize < _Newsize)
  7510. ; 1373 : _Grow(_Newsize);
  7511. ; 1374 :
  7512. ; 1375 : if (this != &_Right)
  7513. ; 1376 : { // no overlap, just move down and copy in new stuff
  7514. ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
  7515. ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
  7516. ; 1379 : _Traits::copy(this->_Myptr() + _Off,
  7517. ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
  7518. ; 1381 : }
  7519. ; 1382 : else if (_Count <= _N0)
  7520. ; 1383 : { // hole doesn't get larger, just copy in substring
  7521. ; 1384 : _Traits::move(this->_Myptr() + _Off,
  7522. ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
  7523. ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
  7524. ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  7525. ; 1388 : }
  7526. ; 1389 : else if (_Roff <= _Off)
  7527. ; 1390 : { // hole gets larger, substring begins before hole
  7528. ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
  7529. ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  7530. ; 1393 : _Traits::move(this->_Myptr() + _Off,
  7531. ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
  7532. ; 1395 : }
  7533. ; 1396 : else if (_Off + _N0 <= _Roff)
  7534. ; 1397 : { // hole gets larger, substring begins after hole
  7535. ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
  7536. ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  7537. ; 1400 : _Traits::move(this->_Myptr() + _Off,
  7538. ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
  7539. ; 1402 : _Count); // fill hole
  7540. ; 1403 : }
  7541. ; 1404 : else
  7542. ; 1405 : { // hole gets larger, substring begins in hole
  7543. ; 1406 : _Traits::move(this->_Myptr() + _Off,
  7544. ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
  7545. ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
  7546. ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  7547. ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
  7548. ; 1411 : this->_Myptr() + _Roff + _Count,
  7549. ; 1412 : _Count - _N0); // fill rest of new hole
  7550. ; 1413 : }
  7551. ; 1414 :
  7552. ; 1415 : _Eos(_Newsize);
  7553. ; 1416 : return (*this);
  7554. ; 1417 : }
  7555. ; 1418 :
  7556. ; 1419 : _Myt& replace(size_type _Off,
  7557. ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
  7558. ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  7559. ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
  7560. ; 1423 : if (_Count != 0)
  7561. ; 1424 : _DEBUG_POINTER(_Ptr);
  7562. ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  7563. ; 1426 :
  7564. ; 1427 : if (_Inside(_Ptr))
  7565. ; 1428 : return (replace(_Off, _N0, *this,
  7566. ; 1429 : _Ptr - this->_Myptr(),
  7567. ; 1430 : _Count)); // substring, replace carefully
  7568. ; 1431 : if (this->_Mysize < _Off)
  7569. ; 1432 : _Xran(); // _Off off end
  7570. ; 1433 : if (this->_Mysize - _Off < _N0)
  7571. ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  7572. ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
  7573. ; 1436 : _Xlen(); // result too long
  7574. ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
  7575. ; 1438 :
  7576. ; 1439 : if (_Count < _N0)
  7577. ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
  7578. ; 1441 : this->_Myptr() + _Off + _N0,
  7579. ; 1442 : _Nm); // smaller hole, move tail up
  7580. ; 1443 : size_type _Num;
  7581. ; 1444 : if ((0 < _Count || 0 < _N0)
  7582. ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  7583. ; 1446 : { // make room and rearrange
  7584. ; 1447 : if (_N0 < _Count)
  7585. ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
  7586. ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  7587. ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
  7588. ; 1451 : _Eos(_Num);
  7589. ; 1452 : }
  7590. ; 1453 : return (*this);
  7591. ; 1454 : }
  7592. ; 1455 :
  7593. ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
  7594. ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
  7595. ; 1458 : _DEBUG_POINTER(_Ptr);
  7596. ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  7597. ; 1460 : }
  7598. ; 1461 :
  7599. ; 1462 : _Myt& replace(size_type _Off,
  7600. ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
  7601. ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
  7602. ; 1465 : if (this->_Mysize < _Off)
  7603. ; 1466 : _Xran(); // _Off off end
  7604. ; 1467 : if (this->_Mysize - _Off < _N0)
  7605. ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  7606. ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
  7607. ; 1470 : _Xlen(); // result too long
  7608. ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
  7609. ; 1472 :
  7610. ; 1473 : if (_Count < _N0)
  7611. ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
  7612. ; 1475 : this->_Myptr() + _Off + _N0,
  7613. ; 1476 : _Nm); // smaller hole, move tail up
  7614. ; 1477 : size_type _Num;
  7615. ; 1478 : if ((0 < _Count || 0 < _N0)
  7616. ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  7617. ; 1480 : { // make room and rearrange
  7618. ; 1481 : if (_N0 < _Count)
  7619. ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
  7620. ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  7621. ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
  7622. ; 1485 : _Eos(_Num);
  7623. ; 1486 : }
  7624. ; 1487 : return (*this);
  7625. ; 1488 : }
  7626. ; 1489 :
  7627. ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
  7628. ; 1491 : const _Myt& _Right)
  7629. ; 1492 : { // replace [_First, _Last) with _Right
  7630. ; 1493 : return (replace(
  7631. ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
  7632. ; 1495 : }
  7633. ; 1496 :
  7634. ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
  7635. ; 1498 : const _Elem *_Ptr, size_type _Count)
  7636. ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
  7637. ; 1500 : return (replace(
  7638. ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
  7639. ; 1502 : }
  7640. ; 1503 :
  7641. ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
  7642. ; 1505 : const _Elem *_Ptr)
  7643. ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
  7644. ; 1507 : return (replace(
  7645. ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
  7646. ; 1509 : }
  7647. ; 1510 :
  7648. ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
  7649. ; 1512 : size_type _Count, _Elem _Ch)
  7650. ; 1513 : { // replace [_First, _Last) with _Count * _Ch
  7651. ; 1514 : return (replace(
  7652. ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
  7653. ; 1516 : }
  7654. ; 1517 :
  7655. ; 1518 : template<class _Iter>
  7656. ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
  7657. ; 1520 : _Myt&>::type
  7658. ; 1521 : replace(const_iterator _First, const_iterator _Last,
  7659. ; 1522 : _Iter _First2, _Iter _Last2)
  7660. ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
  7661. ; 1524 : _Myt _Right(_First2, _Last2);
  7662. ; 1525 : replace(_First, _Last, _Right);
  7663. ; 1526 : return (*this);
  7664. ; 1527 : }
  7665. ; 1528 :
  7666. ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
  7667. ; 1530 : const_pointer _First2, const_pointer _Last2)
  7668. ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  7669. ; 1532 : if (_First2 == _Last2)
  7670. ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  7671. ; 1534 : else
  7672. ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  7673. ; 1536 : &*_First2, _Last2 - _First2);
  7674. ; 1537 : return (*this);
  7675. ; 1538 : }
  7676. ; 1539 :
  7677. ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
  7678. ; 1541 : pointer _First2, pointer _Last2)
  7679. ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  7680. ; 1543 : if (_First2 == _Last2)
  7681. ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  7682. ; 1545 : else
  7683. ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  7684. ; 1547 : &*_First2, _Last2 - _First2);
  7685. ; 1548 : return (*this);
  7686. ; 1549 : }
  7687. ; 1550 :
  7688. ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
  7689. ; 1552 : const_iterator _First2, const_iterator _Last2)
  7690. ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  7691. ; 1554 : if (_First2 == _Last2)
  7692. ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  7693. ; 1556 : else
  7694. ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  7695. ; 1558 : &*_First2, _Last2 - _First2);
  7696. ; 1559 : return (*this);
  7697. ; 1560 : }
  7698. ; 1561 :
  7699. ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
  7700. ; 1563 : iterator _First2, iterator _Last2)
  7701. ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  7702. ; 1565 : if (_First2 == _Last2)
  7703. ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  7704. ; 1567 : else
  7705. ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  7706. ; 1569 : &*_First2, _Last2 - _First2);
  7707. ; 1570 : return (*this);
  7708. ; 1571 : }
  7709. ; 1572 :
  7710. ; 1573 : iterator begin() _NOEXCEPT
  7711. ; 1574 : { // return iterator for beginning of mutable sequence
  7712. ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
  7713. ; 1576 : }
  7714. ; 1577 :
  7715. ; 1578 : const_iterator begin() const _NOEXCEPT
  7716. ; 1579 : { // return iterator for beginning of nonmutable sequence
  7717. ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
  7718. ; 1581 : }
  7719. ; 1582 :
  7720. ; 1583 : iterator end() _NOEXCEPT
  7721. ; 1584 : { // return iterator for end of mutable sequence
  7722. ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
  7723. ; 1586 : }
  7724. ; 1587 :
  7725. ; 1588 : const_iterator end() const _NOEXCEPT
  7726. ; 1589 : { // return iterator for end of nonmutable sequence
  7727. ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
  7728. ; 1591 : }
  7729. ; 1592 :
  7730. ; 1593 : reverse_iterator rbegin() _NOEXCEPT
  7731. ; 1594 : { // return iterator for beginning of reversed mutable sequence
  7732. ; 1595 : return (reverse_iterator(end()));
  7733. ; 1596 : }
  7734. ; 1597 :
  7735. ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
  7736. ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
  7737. ; 1600 : return (const_reverse_iterator(end()));
  7738. ; 1601 : }
  7739. ; 1602 :
  7740. ; 1603 : reverse_iterator rend() _NOEXCEPT
  7741. ; 1604 : { // return iterator for end of reversed mutable sequence
  7742. ; 1605 : return (reverse_iterator(begin()));
  7743. ; 1606 : }
  7744. ; 1607 :
  7745. ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
  7746. ; 1609 : { // return iterator for end of reversed nonmutable sequence
  7747. ; 1610 : return (const_reverse_iterator(begin()));
  7748. ; 1611 : }
  7749. ; 1612 :
  7750. ; 1613 : #if _HAS_CPP0X
  7751. ; 1614 : const_iterator cbegin() const _NOEXCEPT
  7752. ; 1615 : { // return iterator for beginning of nonmutable sequence
  7753. ; 1616 : return (((const _Myt *)this)->begin());
  7754. ; 1617 : }
  7755. ; 1618 :
  7756. ; 1619 : const_iterator cend() const _NOEXCEPT
  7757. ; 1620 : { // return iterator for end of nonmutable sequence
  7758. ; 1621 : return (((const _Myt *)this)->end());
  7759. ; 1622 : }
  7760. ; 1623 :
  7761. ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
  7762. ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
  7763. ; 1626 : return (((const _Myt *)this)->rbegin());
  7764. ; 1627 : }
  7765. ; 1628 :
  7766. ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
  7767. ; 1630 : { // return iterator for end of reversed nonmutable sequence
  7768. ; 1631 : return (((const _Myt *)this)->rend());
  7769. ; 1632 : }
  7770. ; 1633 :
  7771. ; 1634 : void shrink_to_fit()
  7772. ; 1635 : { // reduce capacity
  7773. ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
  7774. ; 1637 : { // worth shrinking, do it
  7775. ; 1638 : _Myt _Tmp(*this);
  7776. ; 1639 : swap(_Tmp);
  7777. ; 1640 : }
  7778. ; 1641 : }
  7779. ; 1642 : #endif /* _HAS_CPP0X */
  7780. ; 1643 :
  7781. ; 1644 : reference at(size_type _Off)
  7782. ; 1645 : { // subscript mutable sequence with checking
  7783. ; 1646 : if (this->_Mysize <= _Off)
  7784. ; 1647 : _Xran(); // _Off off end
  7785. ; 1648 : return (this->_Myptr()[_Off]);
  7786. ; 1649 : }
  7787. ; 1650 :
  7788. ; 1651 : const_reference at(size_type _Off) const
  7789. ; 1652 : { // subscript nonmutable sequence with checking
  7790. ; 1653 : if (this->_Mysize <= _Off)
  7791. ; 1654 : _Xran(); // _Off off end
  7792. ; 1655 : return (this->_Myptr()[_Off]);
  7793. ; 1656 : }
  7794. ; 1657 :
  7795. ; 1658 : reference operator[](size_type _Off)
  7796. ; 1659 : { // subscript mutable sequence
  7797. ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
  7798. ; 1661 : if (this->_Mysize < _Off) // sic
  7799. ; 1662 : _DEBUG_ERROR("string subscript out of range");
  7800. ; 1663 :
  7801. ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
  7802. ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  7803. ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  7804. ; 1667 :
  7805. ; 1668 : return (this->_Myptr()[_Off]);
  7806. ; 1669 : }
  7807. ; 1670 :
  7808. ; 1671 : const_reference operator[](size_type _Off) const
  7809. ; 1672 : { // subscript nonmutable sequence
  7810. ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
  7811. ; 1674 : if (this->_Mysize < _Off) // sic
  7812. ; 1675 : _DEBUG_ERROR("string subscript out of range");
  7813. ; 1676 :
  7814. ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
  7815. ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  7816. ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  7817. ; 1680 :
  7818. ; 1681 : return (this->_Myptr()[_Off]);
  7819. ; 1682 : }
  7820. ; 1683 :
  7821. ; 1684 : void push_back(_Elem _Ch)
  7822. ; 1685 : { // insert element at end
  7823. ; 1686 : insert(end(), _Ch);
  7824. ; 1687 : }
  7825. ; 1688 :
  7826. ; 1689 : #if _HAS_CPP0X
  7827. ; 1690 : void pop_back()
  7828. ; 1691 : { // erase element at end
  7829. ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
  7830. ; 1693 : }
  7831. ; 1694 :
  7832. ; 1695 : reference front()
  7833. ; 1696 : { // return first element of mutable sequence
  7834. ; 1697 : return (*begin());
  7835. ; 1698 : }
  7836. ; 1699 :
  7837. ; 1700 : const_reference front() const
  7838. ; 1701 : { // return first element of nonmutable sequence
  7839. ; 1702 : return (*begin());
  7840. ; 1703 : }
  7841. ; 1704 :
  7842. ; 1705 : reference back()
  7843. ; 1706 : { // return last element of mutable sequence
  7844. ; 1707 : return (*(end() - 1));
  7845. ; 1708 : }
  7846. ; 1709 :
  7847. ; 1710 : const_reference back() const
  7848. ; 1711 : { // return last element of nonmutable sequence
  7849. ; 1712 : return (*(end() - 1));
  7850. ; 1713 : }
  7851. ; 1714 : #endif /* _HAS_CPP0X */
  7852. ; 1715 :
  7853. ; 1716 : const _Elem *c_str() const _NOEXCEPT
  7854. ; 1717 : { // return pointer to null-terminated nonmutable array
  7855. ; 1718 : return (this->_Myptr());
  7856. ; 1719 : }
  7857. ; 1720 :
  7858. ; 1721 : const _Elem *data() const _NOEXCEPT
  7859. ; 1722 : { // return pointer to nonmutable array
  7860. ; 1723 : return (c_str());
  7861. ; 1724 : }
  7862. ; 1725 :
  7863. ; 1726 : size_type length() const _NOEXCEPT
  7864. ; 1727 : { // return length of sequence
  7865. ; 1728 : return (this->_Mysize);
  7866. ; 1729 : }
  7867. ; 1730 :
  7868. ; 1731 : size_type size() const _NOEXCEPT
  7869. ; 1732 : { // return length of sequence
  7870. ; 1733 : return (this->_Mysize);
  7871. ; 1734 : }
  7872. ; 1735 :
  7873. ; 1736 : size_type max_size() const _NOEXCEPT
  7874. ; 1737 : { // return maximum possible length of sequence
  7875. ; 1738 : size_type _Num = this->_Getal().max_size();
  7876. ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
  7877. ; 1740 : }
  7878. ; 1741 :
  7879. ; 1742 : void resize(size_type _Newsize)
  7880. ; 1743 : { // determine new length, padding with null elements as needed
  7881. ; 1744 : resize(_Newsize, _Elem());
  7882. ; 1745 : }
  7883. ; 1746 :
  7884. ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
  7885. ; 1748 : { // determine new length, padding with _Ch elements as needed
  7886. ; 1749 : if (_Newsize <= this->_Mysize)
  7887. ; 1750 : _Eos(_Newsize);
  7888. ; 1751 : else
  7889. ; 1752 : append(_Newsize - this->_Mysize, _Ch);
  7890. ; 1753 : }
  7891. ; 1754 :
  7892. ; 1755 : size_type capacity() const _NOEXCEPT
  7893. ; 1756 : { // return current length of allocated storage
  7894. ; 1757 : return (this->_Myres);
  7895. ; 1758 : }
  7896. ; 1759 :
  7897. ; 1760 : void reserve(size_type _Newcap = 0)
  7898. ; 1761 : { // determine new minimum length of allocated storage
  7899. ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
  7900. ; 1763 : { // change reservation
  7901. ; 1764 : size_type _Size = this->_Mysize;
  7902. ; 1765 : if (_Grow(_Newcap, true))
  7903. ; 1766 : _Eos(_Size);
  7904. ; 1767 : }
  7905. ; 1768 : }
  7906. ; 1769 :
  7907. ; 1770 : bool empty() const _NOEXCEPT
  7908. ; 1771 : { // test if sequence is empty
  7909. ; 1772 : return (this->_Mysize == 0);
  7910. ; 1773 : }
  7911. ; 1774 :
  7912. ; 1775 : _SCL_INSECURE_DEPRECATE
  7913. ; 1776 :
  7914. ; 1777 : size_type copy(_Elem *_Ptr,
  7915. ; 1778 : size_type _Count, size_type _Off = 0) const
  7916. ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
  7917. ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
  7918. ; 1781 : if (_Count != 0)
  7919. ; 1782 : _DEBUG_POINTER(_Ptr);
  7920. ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  7921. ; 1784 :
  7922. ; 1785 : if (this->_Mysize < _Off)
  7923. ; 1786 : _Xran(); // _Off off end
  7924. ; 1787 : if (this->_Mysize - _Off < _Count)
  7925. ; 1788 : _Count = this->_Mysize - _Off;
  7926. ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
  7927. ; 1790 : return (_Count);
  7928. ; 1791 : }
  7929. ; 1792 :
  7930. ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
  7931. ; 1794 : size_type _Count, size_type _Off = 0) const
  7932. ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
  7933. ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
  7934. ; 1797 : if (_Count != 0)
  7935. ; 1798 : _DEBUG_POINTER(_Dest);
  7936. ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  7937. ; 1800 :
  7938. ; 1801 : if (this->_Mysize < _Off)
  7939. ; 1802 : _Xran(); // _Off off end
  7940. ; 1803 : if (this->_Mysize - _Off < _Count)
  7941. ; 1804 : _Count = this->_Mysize - _Off;
  7942. ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
  7943. ; 1806 : return (_Count);
  7944. ; 1807 : }
  7945. ; 1808 :
  7946. ; 1809 : void _Swap_bx(_Myt& _Right)
  7947. ; 1810 : { // exchange _Bx with _Right._Bx
  7948. ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
  7949. ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
  7950. ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
  7951. ; 1814 : else
  7952. ; 1815 : { // swap large with small
  7953. ; 1816 : pointer _Ptr = this->_Bx._Ptr;
  7954. ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
  7955. ; 1818 : _Traits::copy(this->_Bx._Buf,
  7956. ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
  7957. ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
  7958. ; 1821 : }
  7959. ; 1822 : else
  7960. ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
  7961. ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
  7962. ; 1825 : else
  7963. ; 1826 : { // swap small with large
  7964. ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
  7965. ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
  7966. ; 1829 : _Traits::copy(_Right._Bx._Buf,
  7967. ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
  7968. ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  7969. ; 1832 : }
  7970. ; 1833 : }
  7971. ; 1834 :
  7972. ; 1835 : void swap(_Myt& _Right)
  7973. ; 1836 : { // exchange contents with _Right
  7974. ; 1837 : if (this == &_Right)
  7975. ; 1838 : ; // same object, do nothing
  7976. ; 1839 : else if (this->_Getal() == _Right._Getal())
  7977. ; 1840 : { // same allocator, swap control information
  7978. ; 1841 : this->_Swap_all(_Right);
  7979. ; 1842 : _Swap_bx(_Right);
  7980. ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
  7981. ; 1844 : _STD swap(this->_Myres, _Right._Myres);
  7982. ; 1845 : }
  7983. ; 1846 :
  7984. ; 1847 : #if _HAS_CPP0X
  7985. ; 1848 : else if (_Alty::propagate_on_container_swap::value)
  7986. ; 1849 : { // swap allocators and control information
  7987. ; 1850 : this->_Swap_alloc(_Right);
  7988. ; 1851 : _Swap_bx(_Right);
  7989. ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
  7990. ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
  7991. ; 1854 : _STD swap(this->_Myres, _Right._Myres);
  7992. ; 1855 : }
  7993. ; 1856 : #endif /* _HAS_CPP0X */
  7994. ; 1857 :
  7995. ; 1858 : else
  7996. ; 1859 : { // different allocator, do multiple assigns
  7997. ; 1860 : _Myt _Tmp = *this;
  7998. ; 1861 :
  7999. ; 1862 : *this = _Right;
  8000. ; 1863 : _Right = _Tmp;
  8001. ; 1864 : }
  8002. ; 1865 : }
  8003. ; 1866 :
  8004. ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
  8005. ; 1868 : { // look for _Right beginning at or after _Off
  8006. ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
  8007. ; 1870 : }
  8008. ; 1871 :
  8009. ; 1872 : size_type find(const _Elem *_Ptr,
  8010. ; 1873 : size_type _Off, size_type _Count) const
  8011. ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
  8012. ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
  8013. ; 1876 : if (_Count != 0)
  8014. ; 1877 : _DEBUG_POINTER(_Ptr);
  8015. ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8016. ; 1879 :
  8017. ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
  8018. ; 1881 : return (_Off); // null string always matches (if inside string)
  8019. ; 1882 :
  8020. ; 1883 : size_type _Nm;
  8021. ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
  8022. ; 1885 : { // room for match, look for it
  8023. ; 1886 : const _Elem *_Uptr, *_Vptr;
  8024. ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
  8025. ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
  8026. ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
  8027. ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
  8028. ; 1891 : return (_Uptr - this->_Myptr()); // found a match
  8029. ; 1892 : }
  8030. ; 1893 :
  8031. ; 1894 : return (npos); // no match
  8032. ; 1895 : }
  8033. ; 1896 :
  8034. ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
  8035. ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
  8036. ; 1899 : _DEBUG_POINTER(_Ptr);
  8037. ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
  8038. ; 1901 : }
  8039. ; 1902 :
  8040. ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
  8041. ; 1904 : { // look for _Ch at or after _Off
  8042. ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
  8043. ; 1906 : }
  8044. ; 1907 :
  8045. ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
  8046. ; 1909 : { // look for _Right beginning before _Off
  8047. ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
  8048. ; 1911 : }
  8049. ; 1912 :
  8050. ; 1913 : size_type rfind(const _Elem *_Ptr,
  8051. ; 1914 : size_type _Off, size_type _Count) const
  8052. ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
  8053. ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
  8054. ; 1917 : if (_Count != 0)
  8055. ; 1918 : _DEBUG_POINTER(_Ptr);
  8056. ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8057. ; 1920 :
  8058. ; 1921 : if (_Count == 0)
  8059. ; 1922 : return (_Off < this->_Mysize ? _Off
  8060. ; 1923 : : this->_Mysize); // null always matches
  8061. ; 1924 : if (_Count <= this->_Mysize)
  8062. ; 1925 : { // room for match, look for it
  8063. ; 1926 : const _Elem *_Uptr = this->_Myptr() +
  8064. ; 1927 : (_Off < this->_Mysize - _Count ? _Off
  8065. ; 1928 : : this->_Mysize - _Count);
  8066. ; 1929 : for (; ; --_Uptr)
  8067. ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
  8068. ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
  8069. ; 1932 : return (_Uptr - this->_Myptr()); // found a match
  8070. ; 1933 : else if (_Uptr == this->_Myptr())
  8071. ; 1934 : break; // at beginning, no more chance for match
  8072. ; 1935 : }
  8073. ; 1936 :
  8074. ; 1937 : return (npos); // no match
  8075. ; 1938 : }
  8076. ; 1939 :
  8077. ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
  8078. ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
  8079. ; 1942 : _DEBUG_POINTER(_Ptr);
  8080. ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
  8081. ; 1944 : }
  8082. ; 1945 :
  8083. ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
  8084. ; 1947 : { // look for _Ch before _Off
  8085. ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  8086. ; 1949 : }
  8087. ; 1950 :
  8088. ; 1951 : size_type find_first_of(const _Myt& _Right,
  8089. ; 1952 : size_type _Off = 0) const _NOEXCEPT
  8090. ; 1953 : { // look for one of _Right at or after _Off
  8091. ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
  8092. ; 1955 : }
  8093. ; 1956 :
  8094. ; 1957 : size_type find_first_of(const _Elem *_Ptr,
  8095. ; 1958 : size_type _Off, size_type _Count) const
  8096. ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
  8097. ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
  8098. ; 1961 : if (_Count != 0)
  8099. ; 1962 : _DEBUG_POINTER(_Ptr);
  8100. ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8101. ; 1964 :
  8102. ; 1965 : if (0 < _Count && _Off < this->_Mysize)
  8103. ; 1966 : { // room for match, look for it
  8104. ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  8105. ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  8106. ; 1969 : _Uptr < _Vptr; ++_Uptr)
  8107. ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  8108. ; 1971 : return (_Uptr - this->_Myptr()); // found a match
  8109. ; 1972 : }
  8110. ; 1973 :
  8111. ; 1974 : return (npos); // no match
  8112. ; 1975 : }
  8113. ; 1976 :
  8114. ; 1977 : size_type find_first_of(const _Elem *_Ptr,
  8115. ; 1978 : size_type _Off = 0) const
  8116. ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
  8117. ; 1980 : _DEBUG_POINTER(_Ptr);
  8118. ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
  8119. ; 1982 : }
  8120. ; 1983 :
  8121. ; 1984 : size_type find_first_of(_Elem _Ch,
  8122. ; 1985 : size_type _Off = 0) const
  8123. ; 1986 : { // look for _Ch at or after _Off
  8124. ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
  8125. ; 1988 : }
  8126. ; 1989 :
  8127. ; 1990 : size_type find_last_of(const _Myt& _Right,
  8128. ; 1991 : size_type _Off = npos) const _NOEXCEPT
  8129. ; 1992 : { // look for one of _Right before _Off
  8130. ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
  8131. ; 1994 : }
  8132. ; 1995 :
  8133. ; 1996 : size_type find_last_of(const _Elem *_Ptr,
  8134. ; 1997 : size_type _Off, size_type _Count) const
  8135. ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
  8136. ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
  8137. ; 2000 : if (_Count != 0)
  8138. ; 2001 : _DEBUG_POINTER(_Ptr);
  8139. ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8140. ; 2003 :
  8141. ; 2004 : if (0 < _Count && 0 < this->_Mysize)
  8142. ; 2005 : { // worth searching, do it
  8143. ; 2006 : const _Elem *_Uptr = this->_Myptr()
  8144. ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  8145. ; 2008 : for (; ; --_Uptr)
  8146. ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  8147. ; 2010 : return (_Uptr - this->_Myptr()); // found a match
  8148. ; 2011 : else if (_Uptr == this->_Myptr())
  8149. ; 2012 : break; // at beginning, no more chance for match
  8150. ; 2013 : }
  8151. ; 2014 :
  8152. ; 2015 : return (npos); // no match
  8153. ; 2016 : }
  8154. ; 2017 :
  8155. ; 2018 : size_type find_last_of(const _Elem *_Ptr,
  8156. ; 2019 : size_type _Off = npos) const
  8157. ; 2020 : { // look for one of [_Ptr, <null>) before _Off
  8158. ; 2021 : _DEBUG_POINTER(_Ptr);
  8159. ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
  8160. ; 2023 : }
  8161. ; 2024 :
  8162. ; 2025 : size_type find_last_of(_Elem _Ch,
  8163. ; 2026 : size_type _Off = npos) const
  8164. ; 2027 : { // look for _Ch before _Off
  8165. ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  8166. ; 2029 : }
  8167. ; 2030 :
  8168. ; 2031 : size_type find_first_not_of(const _Myt& _Right,
  8169. ; 2032 : size_type _Off = 0) const _NOEXCEPT
  8170. ; 2033 : { // look for none of _Right at or after _Off
  8171. ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
  8172. ; 2035 : _Right.size()));
  8173. ; 2036 : }
  8174. ; 2037 :
  8175. ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
  8176. ; 2039 : size_type _Off, size_type _Count) const
  8177. ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
  8178. ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
  8179. ; 2042 : if (_Count != 0)
  8180. ; 2043 : _DEBUG_POINTER(_Ptr);
  8181. ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8182. ; 2045 :
  8183. ; 2046 : if (_Off < this->_Mysize)
  8184. ; 2047 : { // room for match, look for it
  8185. ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  8186. ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  8187. ; 2050 : _Uptr < _Vptr; ++_Uptr)
  8188. ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  8189. ; 2052 : return (_Uptr - this->_Myptr());
  8190. ; 2053 : }
  8191. ; 2054 : return (npos);
  8192. ; 2055 : }
  8193. ; 2056 :
  8194. ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
  8195. ; 2058 : size_type _Off = 0) const
  8196. ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
  8197. ; 2060 : _DEBUG_POINTER(_Ptr);
  8198. ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  8199. ; 2062 : }
  8200. ; 2063 :
  8201. ; 2064 : size_type find_first_not_of(_Elem _Ch,
  8202. ; 2065 : size_type _Off = 0) const
  8203. ; 2066 : { // look for non _Ch at or after _Off
  8204. ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
  8205. ; 2068 : }
  8206. ; 2069 :
  8207. ; 2070 : size_type find_last_not_of(const _Myt& _Right,
  8208. ; 2071 : size_type _Off = npos) const _NOEXCEPT
  8209. ; 2072 : { // look for none of _Right before _Off
  8210. ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
  8211. ; 2074 : }
  8212. ; 2075 :
  8213. ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
  8214. ; 2077 : size_type _Off, size_type _Count) const
  8215. ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
  8216. ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
  8217. ; 2080 : if (_Count != 0)
  8218. ; 2081 : _DEBUG_POINTER(_Ptr);
  8219. ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8220. ; 2083 :
  8221. ; 2084 : if (0 < this->_Mysize)
  8222. ; 2085 : { // worth searching, do it
  8223. ; 2086 : const _Elem *_Uptr = this->_Myptr()
  8224. ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  8225. ; 2088 : for (; ; --_Uptr)
  8226. ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  8227. ; 2090 : return (_Uptr - this->_Myptr());
  8228. ; 2091 : else if (_Uptr == this->_Myptr())
  8229. ; 2092 : break;
  8230. ; 2093 : }
  8231. ; 2094 : return (npos);
  8232. ; 2095 : }
  8233. ; 2096 :
  8234. ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
  8235. ; 2098 : size_type _Off = npos) const
  8236. ; 2099 : { // look for none of [_Ptr, <null>) before _Off
  8237. ; 2100 : _DEBUG_POINTER(_Ptr);
  8238. ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  8239. ; 2102 : }
  8240. ; 2103 :
  8241. ; 2104 : size_type find_last_not_of(_Elem _Ch,
  8242. ; 2105 : size_type _Off = npos) const
  8243. ; 2106 : { // look for non _Ch before _Off
  8244. ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
  8245. ; 2108 : }
  8246. ; 2109 :
  8247. ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
  8248. ; 2111 : { // return [_Off, _Off + _Count) as new string
  8249. ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
  8250. ; 2113 : }
  8251. ; 2114 :
  8252. ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
  8253. ; 2116 : { // compare [0, _Mysize) with _Right
  8254. ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
  8255. ; 2118 : }
  8256. ; 2119 :
  8257. ; 2120 : int compare(size_type _Off, size_type _N0,
  8258. ; 2121 : const _Myt& _Right) const
  8259. ; 2122 : { // compare [_Off, _Off + _N0) with _Right
  8260. ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
  8261. ; 2124 : }
  8262. ; 2125 :
  8263. ; 2126 : int compare(size_type _Off,
  8264. ; 2127 : size_type _N0, const _Myt& _Right,
  8265. ; 2128 : size_type _Roff, size_type _Count) const
  8266. ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  8267. ; 2130 : if (_Right.size() < _Roff)
  8268. ; 2131 : _Xran(); // _Off off end
  8269. ; 2132 : if (_Right._Mysize - _Roff < _Count)
  8270. ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
  8271. ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
  8272. ; 2135 : }
  8273. ; 2136 :
  8274. ; 2137 : int compare(const _Elem *_Ptr) const
  8275. ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
  8276. ; 2139 : _DEBUG_POINTER(_Ptr);
  8277. ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
  8278. ; 2141 : }
  8279. ; 2142 :
  8280. ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
  8281. ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
  8282. ; 2145 : _DEBUG_POINTER(_Ptr);
  8283. ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  8284. ; 2147 : }
  8285. ; 2148 :
  8286. ; 2149 : int compare(size_type _Off,
  8287. ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
  8288. ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  8289. ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
  8290. ; 2153 : if (_Count != 0)
  8291. ; 2154 : _DEBUG_POINTER(_Ptr);
  8292. ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8293. ; 2156 :
  8294. ; 2157 : if (this->_Mysize < _Off)
  8295. ; 2158 : _Xran(); // _Off off end
  8296. ; 2159 : if (this->_Mysize - _Off < _N0)
  8297. ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  8298. ; 2161 :
  8299. ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
  8300. ; 2163 : _N0 < _Count ? _N0 : _Count);
  8301. ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
  8302. ; 2165 : : _N0 == _Count ? 0 : +1);
  8303. ; 2166 : }
  8304. ; 2167 :
  8305. ; 2168 : allocator_type get_allocator() const _NOEXCEPT
  8306. ; 2169 : { // return allocator object for values
  8307. ; 2170 : return (this->_Getal());
  8308. ; 2171 : }
  8309. ; 2172 :
  8310. ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
  8311. ; 2174 : { // assign _Count copies of _Ch beginning at _Off
  8312. ; 2175 : if (_Count == 1)
  8313. ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
  8314. ; 2177 : else
  8315. ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
  8316. ; 2179 : }
  8317. ; 2180 :
  8318. ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
  8319. ; 2182 : { // copy _Oldlen elements to newly allocated buffer
  8320. ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
  8321. ; 2184 : if (max_size() < _Newres)
  8322. ; 2185 : _Newres = _Newsize; // undo roundup if too big
  8323. ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
  8324. ; 2187 : ;
  8325. ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
  8326. ; 2189 : _Newres = this->_Myres
  8327. ; 2190 : + this->_Myres / 2; // grow exponentially if possible
  8328. ; 2191 : else
  8329. ; 2192 : _Newres = max_size(); // settle for max_size()
  8330. ; 2193 :
  8331. ; 2194 : _Elem *_Ptr;
  8332. ; 2195 : _TRY_BEGIN
  8333. ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
  8334. ; 2197 : _CATCH_ALL
  8335. ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
  8336. ; 2199 : _TRY_BEGIN
  8337. ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
  8338. ; 2201 : _CATCH_ALL
  8339. ; 2202 : _Tidy(true); // failed again, discard storage and reraise
  8340. ; 2203 : _RERAISE;
  8341. ; 2204 : _CATCH_END
  8342. ; 2205 : _CATCH_END
  8343. ; 2206 :
  8344. ; 2207 : if (0 < _Oldlen)
  8345. ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
  8346. ; 2209 : _Oldlen); // copy existing elements
  8347. ; 2210 : _Tidy(true);
  8348. ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  8349. ; 2212 : this->_Myres = _Newres;
  8350. ; 2213 : _Eos(_Oldlen);
  8351. ; 2214 : }
  8352. ; 2215 :
  8353. ; 2216 : void _Eos(size_type _Newsize)
  8354. ; 2217 : { // set new length and null terminator
  8355. ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
  8356.  
  8357. mov DWORD PTR [ecx+16], eax
  8358.  
  8359. ; 517 : : this->_Bx._Buf);
  8360.  
  8361. jb SHORT $LN11@erase
  8362. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  8363.  
  8364. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  8365.  
  8366. mov edx, DWORD PTR [ecx]
  8367. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  8368.  
  8369. ; 564 : _Left = _Right;
  8370.  
  8371. mov BYTE PTR [edx+eax], 0
  8372. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  8373.  
  8374. ; 1313 : return (*this);
  8375.  
  8376. mov eax, ecx
  8377.  
  8378. ; 1314 : }
  8379.  
  8380. pop ebp
  8381. ret 4
  8382. $LN11@erase:
  8383.  
  8384. ; 517 : : this->_Bx._Buf);
  8385.  
  8386. mov edx, ecx
  8387. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  8388.  
  8389. ; 564 : _Left = _Right;
  8390.  
  8391. mov BYTE PTR [edx+eax], 0
  8392. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  8393.  
  8394. ; 1313 : return (*this);
  8395.  
  8396. mov eax, ecx
  8397.  
  8398. ; 1314 : }
  8399.  
  8400. pop ebp
  8401. ret 4
  8402. $LN18@erase:
  8403. ?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
  8404. _TEXT ENDS
  8405. ; Function compile flags: /Ogtp
  8406. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  8407. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  8408. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  8409. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  8410. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  8411. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  8412. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  8413. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  8414. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  8415. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  8416. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  8417. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  8418. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  8419. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  8420. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  8421. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  8422. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  8423. ; COMDAT ?erase@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEAAV12@II@Z
  8424. _TEXT SEGMENT
  8425. __Off$dead$ = 8 ; size = 4
  8426. __Count$ = 12 ; size = 4
  8427. ?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
  8428. ; _this$ = ecx
  8429.  
  8430. ; 1317 : { // erase elements [_Off, _Off + _Count)
  8431.  
  8432. push ebp
  8433. mov ebp, esp
  8434.  
  8435. ; 1318 : if (this->_Mysize < _Off)
  8436. ; 1319 : _Xran(); // _Off off end
  8437. ; 1320 : if (this->_Mysize - _Off <= _Count)
  8438.  
  8439. mov eax, DWORD PTR __Count$[ebp]
  8440. push esi
  8441. mov esi, ecx
  8442. push edi
  8443. mov edi, DWORD PTR [esi+16]
  8444. cmp edi, eax
  8445. ja SHORT $LN3@erase
  8446.  
  8447. ; 517 : : this->_Bx._Buf);
  8448.  
  8449. cmp DWORD PTR [esi+20], 16 ; 00000010H
  8450.  
  8451. ; 1331 :
  8452. ; 1332 : iterator erase(const_iterator _Where)
  8453. ; 1333 : { // erase element at _Where
  8454. ; 1334 : size_type _Count = _Pdif(_Where, begin());
  8455. ; 1335 : erase(_Count, 1);
  8456. ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  8457. ; 1337 : }
  8458. ; 1338 :
  8459. ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
  8460. ; 1340 : { // erase substring [_First, _Last)
  8461. ; 1341 : _DEBUG_RANGE(_First, _Last);
  8462. ; 1342 : size_type _Count = _Pdif(_First, begin());
  8463. ; 1343 : erase(_Count, _Pdif(_Last, _First));
  8464. ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  8465. ; 1345 : }
  8466. ; 1346 :
  8467. ; 1347 : void clear() _NOEXCEPT
  8468. ; 1348 : { // erase all
  8469. ; 1349 : _Eos(0);
  8470. ; 1350 : }
  8471. ; 1351 :
  8472. ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
  8473. ; 1353 : { // replace [_Off, _Off + _N0) with _Right
  8474. ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
  8475. ; 1355 : }
  8476. ; 1356 :
  8477. ; 1357 : _Myt& replace(size_type _Off,
  8478. ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
  8479. ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  8480. ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
  8481. ; 1361 : _Xran(); // _Off or _Roff off end
  8482. ; 1362 : if (this->_Mysize - _Off < _N0)
  8483. ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  8484. ; 1364 : size_type _Num = _Right.size() - _Roff;
  8485. ; 1365 : if (_Num < _Count)
  8486. ; 1366 : _Count = _Num; // trim _Count to size
  8487. ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
  8488. ; 1368 : _Xlen(); // result too long
  8489. ; 1369 :
  8490. ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
  8491. ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
  8492. ; 1372 : if (this->_Mysize < _Newsize)
  8493. ; 1373 : _Grow(_Newsize);
  8494. ; 1374 :
  8495. ; 1375 : if (this != &_Right)
  8496. ; 1376 : { // no overlap, just move down and copy in new stuff
  8497. ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
  8498. ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
  8499. ; 1379 : _Traits::copy(this->_Myptr() + _Off,
  8500. ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
  8501. ; 1381 : }
  8502. ; 1382 : else if (_Count <= _N0)
  8503. ; 1383 : { // hole doesn't get larger, just copy in substring
  8504. ; 1384 : _Traits::move(this->_Myptr() + _Off,
  8505. ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
  8506. ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
  8507. ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  8508. ; 1388 : }
  8509. ; 1389 : else if (_Roff <= _Off)
  8510. ; 1390 : { // hole gets larger, substring begins before hole
  8511. ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
  8512. ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  8513. ; 1393 : _Traits::move(this->_Myptr() + _Off,
  8514. ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
  8515. ; 1395 : }
  8516. ; 1396 : else if (_Off + _N0 <= _Roff)
  8517. ; 1397 : { // hole gets larger, substring begins after hole
  8518. ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
  8519. ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  8520. ; 1400 : _Traits::move(this->_Myptr() + _Off,
  8521. ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
  8522. ; 1402 : _Count); // fill hole
  8523. ; 1403 : }
  8524. ; 1404 : else
  8525. ; 1405 : { // hole gets larger, substring begins in hole
  8526. ; 1406 : _Traits::move(this->_Myptr() + _Off,
  8527. ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
  8528. ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
  8529. ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  8530. ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
  8531. ; 1411 : this->_Myptr() + _Roff + _Count,
  8532. ; 1412 : _Count - _N0); // fill rest of new hole
  8533. ; 1413 : }
  8534. ; 1414 :
  8535. ; 1415 : _Eos(_Newsize);
  8536. ; 1416 : return (*this);
  8537. ; 1417 : }
  8538. ; 1418 :
  8539. ; 1419 : _Myt& replace(size_type _Off,
  8540. ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
  8541. ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  8542. ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
  8543. ; 1423 : if (_Count != 0)
  8544. ; 1424 : _DEBUG_POINTER(_Ptr);
  8545. ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8546. ; 1426 :
  8547. ; 1427 : if (_Inside(_Ptr))
  8548. ; 1428 : return (replace(_Off, _N0, *this,
  8549. ; 1429 : _Ptr - this->_Myptr(),
  8550. ; 1430 : _Count)); // substring, replace carefully
  8551. ; 1431 : if (this->_Mysize < _Off)
  8552. ; 1432 : _Xran(); // _Off off end
  8553. ; 1433 : if (this->_Mysize - _Off < _N0)
  8554. ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  8555. ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
  8556. ; 1436 : _Xlen(); // result too long
  8557. ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
  8558. ; 1438 :
  8559. ; 1439 : if (_Count < _N0)
  8560. ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
  8561. ; 1441 : this->_Myptr() + _Off + _N0,
  8562. ; 1442 : _Nm); // smaller hole, move tail up
  8563. ; 1443 : size_type _Num;
  8564. ; 1444 : if ((0 < _Count || 0 < _N0)
  8565. ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  8566. ; 1446 : { // make room and rearrange
  8567. ; 1447 : if (_N0 < _Count)
  8568. ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
  8569. ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  8570. ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
  8571. ; 1451 : _Eos(_Num);
  8572. ; 1452 : }
  8573. ; 1453 : return (*this);
  8574. ; 1454 : }
  8575. ; 1455 :
  8576. ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
  8577. ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
  8578. ; 1458 : _DEBUG_POINTER(_Ptr);
  8579. ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  8580. ; 1460 : }
  8581. ; 1461 :
  8582. ; 1462 : _Myt& replace(size_type _Off,
  8583. ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
  8584. ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
  8585. ; 1465 : if (this->_Mysize < _Off)
  8586. ; 1466 : _Xran(); // _Off off end
  8587. ; 1467 : if (this->_Mysize - _Off < _N0)
  8588. ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  8589. ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
  8590. ; 1470 : _Xlen(); // result too long
  8591. ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
  8592. ; 1472 :
  8593. ; 1473 : if (_Count < _N0)
  8594. ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
  8595. ; 1475 : this->_Myptr() + _Off + _N0,
  8596. ; 1476 : _Nm); // smaller hole, move tail up
  8597. ; 1477 : size_type _Num;
  8598. ; 1478 : if ((0 < _Count || 0 < _N0)
  8599. ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  8600. ; 1480 : { // make room and rearrange
  8601. ; 1481 : if (_N0 < _Count)
  8602. ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
  8603. ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  8604. ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
  8605. ; 1485 : _Eos(_Num);
  8606. ; 1486 : }
  8607. ; 1487 : return (*this);
  8608. ; 1488 : }
  8609. ; 1489 :
  8610. ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
  8611. ; 1491 : const _Myt& _Right)
  8612. ; 1492 : { // replace [_First, _Last) with _Right
  8613. ; 1493 : return (replace(
  8614. ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
  8615. ; 1495 : }
  8616. ; 1496 :
  8617. ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
  8618. ; 1498 : const _Elem *_Ptr, size_type _Count)
  8619. ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
  8620. ; 1500 : return (replace(
  8621. ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
  8622. ; 1502 : }
  8623. ; 1503 :
  8624. ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
  8625. ; 1505 : const _Elem *_Ptr)
  8626. ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
  8627. ; 1507 : return (replace(
  8628. ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
  8629. ; 1509 : }
  8630. ; 1510 :
  8631. ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
  8632. ; 1512 : size_type _Count, _Elem _Ch)
  8633. ; 1513 : { // replace [_First, _Last) with _Count * _Ch
  8634. ; 1514 : return (replace(
  8635. ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
  8636. ; 1516 : }
  8637. ; 1517 :
  8638. ; 1518 : template<class _Iter>
  8639. ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
  8640. ; 1520 : _Myt&>::type
  8641. ; 1521 : replace(const_iterator _First, const_iterator _Last,
  8642. ; 1522 : _Iter _First2, _Iter _Last2)
  8643. ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
  8644. ; 1524 : _Myt _Right(_First2, _Last2);
  8645. ; 1525 : replace(_First, _Last, _Right);
  8646. ; 1526 : return (*this);
  8647. ; 1527 : }
  8648. ; 1528 :
  8649. ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
  8650. ; 1530 : const_pointer _First2, const_pointer _Last2)
  8651. ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  8652. ; 1532 : if (_First2 == _Last2)
  8653. ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  8654. ; 1534 : else
  8655. ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  8656. ; 1536 : &*_First2, _Last2 - _First2);
  8657. ; 1537 : return (*this);
  8658. ; 1538 : }
  8659. ; 1539 :
  8660. ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
  8661. ; 1541 : pointer _First2, pointer _Last2)
  8662. ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  8663. ; 1543 : if (_First2 == _Last2)
  8664. ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  8665. ; 1545 : else
  8666. ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  8667. ; 1547 : &*_First2, _Last2 - _First2);
  8668. ; 1548 : return (*this);
  8669. ; 1549 : }
  8670. ; 1550 :
  8671. ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
  8672. ; 1552 : const_iterator _First2, const_iterator _Last2)
  8673. ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  8674. ; 1554 : if (_First2 == _Last2)
  8675. ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  8676. ; 1556 : else
  8677. ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  8678. ; 1558 : &*_First2, _Last2 - _First2);
  8679. ; 1559 : return (*this);
  8680. ; 1560 : }
  8681. ; 1561 :
  8682. ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
  8683. ; 1563 : iterator _First2, iterator _Last2)
  8684. ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  8685. ; 1565 : if (_First2 == _Last2)
  8686. ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  8687. ; 1567 : else
  8688. ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  8689. ; 1569 : &*_First2, _Last2 - _First2);
  8690. ; 1570 : return (*this);
  8691. ; 1571 : }
  8692. ; 1572 :
  8693. ; 1573 : iterator begin() _NOEXCEPT
  8694. ; 1574 : { // return iterator for beginning of mutable sequence
  8695. ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
  8696. ; 1576 : }
  8697. ; 1577 :
  8698. ; 1578 : const_iterator begin() const _NOEXCEPT
  8699. ; 1579 : { // return iterator for beginning of nonmutable sequence
  8700. ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
  8701. ; 1581 : }
  8702. ; 1582 :
  8703. ; 1583 : iterator end() _NOEXCEPT
  8704. ; 1584 : { // return iterator for end of mutable sequence
  8705. ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
  8706. ; 1586 : }
  8707. ; 1587 :
  8708. ; 1588 : const_iterator end() const _NOEXCEPT
  8709. ; 1589 : { // return iterator for end of nonmutable sequence
  8710. ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
  8711. ; 1591 : }
  8712. ; 1592 :
  8713. ; 1593 : reverse_iterator rbegin() _NOEXCEPT
  8714. ; 1594 : { // return iterator for beginning of reversed mutable sequence
  8715. ; 1595 : return (reverse_iterator(end()));
  8716. ; 1596 : }
  8717. ; 1597 :
  8718. ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
  8719. ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
  8720. ; 1600 : return (const_reverse_iterator(end()));
  8721. ; 1601 : }
  8722. ; 1602 :
  8723. ; 1603 : reverse_iterator rend() _NOEXCEPT
  8724. ; 1604 : { // return iterator for end of reversed mutable sequence
  8725. ; 1605 : return (reverse_iterator(begin()));
  8726. ; 1606 : }
  8727. ; 1607 :
  8728. ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
  8729. ; 1609 : { // return iterator for end of reversed nonmutable sequence
  8730. ; 1610 : return (const_reverse_iterator(begin()));
  8731. ; 1611 : }
  8732. ; 1612 :
  8733. ; 1613 : #if _HAS_CPP0X
  8734. ; 1614 : const_iterator cbegin() const _NOEXCEPT
  8735. ; 1615 : { // return iterator for beginning of nonmutable sequence
  8736. ; 1616 : return (((const _Myt *)this)->begin());
  8737. ; 1617 : }
  8738. ; 1618 :
  8739. ; 1619 : const_iterator cend() const _NOEXCEPT
  8740. ; 1620 : { // return iterator for end of nonmutable sequence
  8741. ; 1621 : return (((const _Myt *)this)->end());
  8742. ; 1622 : }
  8743. ; 1623 :
  8744. ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
  8745. ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
  8746. ; 1626 : return (((const _Myt *)this)->rbegin());
  8747. ; 1627 : }
  8748. ; 1628 :
  8749. ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
  8750. ; 1630 : { // return iterator for end of reversed nonmutable sequence
  8751. ; 1631 : return (((const _Myt *)this)->rend());
  8752. ; 1632 : }
  8753. ; 1633 :
  8754. ; 1634 : void shrink_to_fit()
  8755. ; 1635 : { // reduce capacity
  8756. ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
  8757. ; 1637 : { // worth shrinking, do it
  8758. ; 1638 : _Myt _Tmp(*this);
  8759. ; 1639 : swap(_Tmp);
  8760. ; 1640 : }
  8761. ; 1641 : }
  8762. ; 1642 : #endif /* _HAS_CPP0X */
  8763. ; 1643 :
  8764. ; 1644 : reference at(size_type _Off)
  8765. ; 1645 : { // subscript mutable sequence with checking
  8766. ; 1646 : if (this->_Mysize <= _Off)
  8767. ; 1647 : _Xran(); // _Off off end
  8768. ; 1648 : return (this->_Myptr()[_Off]);
  8769. ; 1649 : }
  8770. ; 1650 :
  8771. ; 1651 : const_reference at(size_type _Off) const
  8772. ; 1652 : { // subscript nonmutable sequence with checking
  8773. ; 1653 : if (this->_Mysize <= _Off)
  8774. ; 1654 : _Xran(); // _Off off end
  8775. ; 1655 : return (this->_Myptr()[_Off]);
  8776. ; 1656 : }
  8777. ; 1657 :
  8778. ; 1658 : reference operator[](size_type _Off)
  8779. ; 1659 : { // subscript mutable sequence
  8780. ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
  8781. ; 1661 : if (this->_Mysize < _Off) // sic
  8782. ; 1662 : _DEBUG_ERROR("string subscript out of range");
  8783. ; 1663 :
  8784. ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
  8785. ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  8786. ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8787. ; 1667 :
  8788. ; 1668 : return (this->_Myptr()[_Off]);
  8789. ; 1669 : }
  8790. ; 1670 :
  8791. ; 1671 : const_reference operator[](size_type _Off) const
  8792. ; 1672 : { // subscript nonmutable sequence
  8793. ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
  8794. ; 1674 : if (this->_Mysize < _Off) // sic
  8795. ; 1675 : _DEBUG_ERROR("string subscript out of range");
  8796. ; 1676 :
  8797. ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
  8798. ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  8799. ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8800. ; 1680 :
  8801. ; 1681 : return (this->_Myptr()[_Off]);
  8802. ; 1682 : }
  8803. ; 1683 :
  8804. ; 1684 : void push_back(_Elem _Ch)
  8805. ; 1685 : { // insert element at end
  8806. ; 1686 : insert(end(), _Ch);
  8807. ; 1687 : }
  8808. ; 1688 :
  8809. ; 1689 : #if _HAS_CPP0X
  8810. ; 1690 : void pop_back()
  8811. ; 1691 : { // erase element at end
  8812. ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
  8813. ; 1693 : }
  8814. ; 1694 :
  8815. ; 1695 : reference front()
  8816. ; 1696 : { // return first element of mutable sequence
  8817. ; 1697 : return (*begin());
  8818. ; 1698 : }
  8819. ; 1699 :
  8820. ; 1700 : const_reference front() const
  8821. ; 1701 : { // return first element of nonmutable sequence
  8822. ; 1702 : return (*begin());
  8823. ; 1703 : }
  8824. ; 1704 :
  8825. ; 1705 : reference back()
  8826. ; 1706 : { // return last element of mutable sequence
  8827. ; 1707 : return (*(end() - 1));
  8828. ; 1708 : }
  8829. ; 1709 :
  8830. ; 1710 : const_reference back() const
  8831. ; 1711 : { // return last element of nonmutable sequence
  8832. ; 1712 : return (*(end() - 1));
  8833. ; 1713 : }
  8834. ; 1714 : #endif /* _HAS_CPP0X */
  8835. ; 1715 :
  8836. ; 1716 : const _Elem *c_str() const _NOEXCEPT
  8837. ; 1717 : { // return pointer to null-terminated nonmutable array
  8838. ; 1718 : return (this->_Myptr());
  8839. ; 1719 : }
  8840. ; 1720 :
  8841. ; 1721 : const _Elem *data() const _NOEXCEPT
  8842. ; 1722 : { // return pointer to nonmutable array
  8843. ; 1723 : return (c_str());
  8844. ; 1724 : }
  8845. ; 1725 :
  8846. ; 1726 : size_type length() const _NOEXCEPT
  8847. ; 1727 : { // return length of sequence
  8848. ; 1728 : return (this->_Mysize);
  8849. ; 1729 : }
  8850. ; 1730 :
  8851. ; 1731 : size_type size() const _NOEXCEPT
  8852. ; 1732 : { // return length of sequence
  8853. ; 1733 : return (this->_Mysize);
  8854. ; 1734 : }
  8855. ; 1735 :
  8856. ; 1736 : size_type max_size() const _NOEXCEPT
  8857. ; 1737 : { // return maximum possible length of sequence
  8858. ; 1738 : size_type _Num = this->_Getal().max_size();
  8859. ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
  8860. ; 1740 : }
  8861. ; 1741 :
  8862. ; 1742 : void resize(size_type _Newsize)
  8863. ; 1743 : { // determine new length, padding with null elements as needed
  8864. ; 1744 : resize(_Newsize, _Elem());
  8865. ; 1745 : }
  8866. ; 1746 :
  8867. ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
  8868. ; 1748 : { // determine new length, padding with _Ch elements as needed
  8869. ; 1749 : if (_Newsize <= this->_Mysize)
  8870. ; 1750 : _Eos(_Newsize);
  8871. ; 1751 : else
  8872. ; 1752 : append(_Newsize - this->_Mysize, _Ch);
  8873. ; 1753 : }
  8874. ; 1754 :
  8875. ; 1755 : size_type capacity() const _NOEXCEPT
  8876. ; 1756 : { // return current length of allocated storage
  8877. ; 1757 : return (this->_Myres);
  8878. ; 1758 : }
  8879. ; 1759 :
  8880. ; 1760 : void reserve(size_type _Newcap = 0)
  8881. ; 1761 : { // determine new minimum length of allocated storage
  8882. ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
  8883. ; 1763 : { // change reservation
  8884. ; 1764 : size_type _Size = this->_Mysize;
  8885. ; 1765 : if (_Grow(_Newcap, true))
  8886. ; 1766 : _Eos(_Size);
  8887. ; 1767 : }
  8888. ; 1768 : }
  8889. ; 1769 :
  8890. ; 1770 : bool empty() const _NOEXCEPT
  8891. ; 1771 : { // test if sequence is empty
  8892. ; 1772 : return (this->_Mysize == 0);
  8893. ; 1773 : }
  8894. ; 1774 :
  8895. ; 1775 : _SCL_INSECURE_DEPRECATE
  8896. ; 1776 :
  8897. ; 1777 : size_type copy(_Elem *_Ptr,
  8898. ; 1778 : size_type _Count, size_type _Off = 0) const
  8899. ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
  8900. ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
  8901. ; 1781 : if (_Count != 0)
  8902. ; 1782 : _DEBUG_POINTER(_Ptr);
  8903. ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8904. ; 1784 :
  8905. ; 1785 : if (this->_Mysize < _Off)
  8906. ; 1786 : _Xran(); // _Off off end
  8907. ; 1787 : if (this->_Mysize - _Off < _Count)
  8908. ; 1788 : _Count = this->_Mysize - _Off;
  8909. ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
  8910. ; 1790 : return (_Count);
  8911. ; 1791 : }
  8912. ; 1792 :
  8913. ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
  8914. ; 1794 : size_type _Count, size_type _Off = 0) const
  8915. ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
  8916. ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
  8917. ; 1797 : if (_Count != 0)
  8918. ; 1798 : _DEBUG_POINTER(_Dest);
  8919. ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8920. ; 1800 :
  8921. ; 1801 : if (this->_Mysize < _Off)
  8922. ; 1802 : _Xran(); // _Off off end
  8923. ; 1803 : if (this->_Mysize - _Off < _Count)
  8924. ; 1804 : _Count = this->_Mysize - _Off;
  8925. ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
  8926. ; 1806 : return (_Count);
  8927. ; 1807 : }
  8928. ; 1808 :
  8929. ; 1809 : void _Swap_bx(_Myt& _Right)
  8930. ; 1810 : { // exchange _Bx with _Right._Bx
  8931. ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
  8932. ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
  8933. ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
  8934. ; 1814 : else
  8935. ; 1815 : { // swap large with small
  8936. ; 1816 : pointer _Ptr = this->_Bx._Ptr;
  8937. ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
  8938. ; 1818 : _Traits::copy(this->_Bx._Buf,
  8939. ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
  8940. ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
  8941. ; 1821 : }
  8942. ; 1822 : else
  8943. ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
  8944. ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
  8945. ; 1825 : else
  8946. ; 1826 : { // swap small with large
  8947. ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
  8948. ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
  8949. ; 1829 : _Traits::copy(_Right._Bx._Buf,
  8950. ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
  8951. ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  8952. ; 1832 : }
  8953. ; 1833 : }
  8954. ; 1834 :
  8955. ; 1835 : void swap(_Myt& _Right)
  8956. ; 1836 : { // exchange contents with _Right
  8957. ; 1837 : if (this == &_Right)
  8958. ; 1838 : ; // same object, do nothing
  8959. ; 1839 : else if (this->_Getal() == _Right._Getal())
  8960. ; 1840 : { // same allocator, swap control information
  8961. ; 1841 : this->_Swap_all(_Right);
  8962. ; 1842 : _Swap_bx(_Right);
  8963. ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
  8964. ; 1844 : _STD swap(this->_Myres, _Right._Myres);
  8965. ; 1845 : }
  8966. ; 1846 :
  8967. ; 1847 : #if _HAS_CPP0X
  8968. ; 1848 : else if (_Alty::propagate_on_container_swap::value)
  8969. ; 1849 : { // swap allocators and control information
  8970. ; 1850 : this->_Swap_alloc(_Right);
  8971. ; 1851 : _Swap_bx(_Right);
  8972. ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
  8973. ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
  8974. ; 1854 : _STD swap(this->_Myres, _Right._Myres);
  8975. ; 1855 : }
  8976. ; 1856 : #endif /* _HAS_CPP0X */
  8977. ; 1857 :
  8978. ; 1858 : else
  8979. ; 1859 : { // different allocator, do multiple assigns
  8980. ; 1860 : _Myt _Tmp = *this;
  8981. ; 1861 :
  8982. ; 1862 : *this = _Right;
  8983. ; 1863 : _Right = _Tmp;
  8984. ; 1864 : }
  8985. ; 1865 : }
  8986. ; 1866 :
  8987. ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
  8988. ; 1868 : { // look for _Right beginning at or after _Off
  8989. ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
  8990. ; 1870 : }
  8991. ; 1871 :
  8992. ; 1872 : size_type find(const _Elem *_Ptr,
  8993. ; 1873 : size_type _Off, size_type _Count) const
  8994. ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
  8995. ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
  8996. ; 1876 : if (_Count != 0)
  8997. ; 1877 : _DEBUG_POINTER(_Ptr);
  8998. ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  8999. ; 1879 :
  9000. ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
  9001. ; 1881 : return (_Off); // null string always matches (if inside string)
  9002. ; 1882 :
  9003. ; 1883 : size_type _Nm;
  9004. ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
  9005. ; 1885 : { // room for match, look for it
  9006. ; 1886 : const _Elem *_Uptr, *_Vptr;
  9007. ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
  9008. ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
  9009. ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
  9010. ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
  9011. ; 1891 : return (_Uptr - this->_Myptr()); // found a match
  9012. ; 1892 : }
  9013. ; 1893 :
  9014. ; 1894 : return (npos); // no match
  9015. ; 1895 : }
  9016. ; 1896 :
  9017. ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
  9018. ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
  9019. ; 1899 : _DEBUG_POINTER(_Ptr);
  9020. ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
  9021. ; 1901 : }
  9022. ; 1902 :
  9023. ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
  9024. ; 1904 : { // look for _Ch at or after _Off
  9025. ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
  9026. ; 1906 : }
  9027. ; 1907 :
  9028. ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
  9029. ; 1909 : { // look for _Right beginning before _Off
  9030. ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
  9031. ; 1911 : }
  9032. ; 1912 :
  9033. ; 1913 : size_type rfind(const _Elem *_Ptr,
  9034. ; 1914 : size_type _Off, size_type _Count) const
  9035. ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
  9036. ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
  9037. ; 1917 : if (_Count != 0)
  9038. ; 1918 : _DEBUG_POINTER(_Ptr);
  9039. ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9040. ; 1920 :
  9041. ; 1921 : if (_Count == 0)
  9042. ; 1922 : return (_Off < this->_Mysize ? _Off
  9043. ; 1923 : : this->_Mysize); // null always matches
  9044. ; 1924 : if (_Count <= this->_Mysize)
  9045. ; 1925 : { // room for match, look for it
  9046. ; 1926 : const _Elem *_Uptr = this->_Myptr() +
  9047. ; 1927 : (_Off < this->_Mysize - _Count ? _Off
  9048. ; 1928 : : this->_Mysize - _Count);
  9049. ; 1929 : for (; ; --_Uptr)
  9050. ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
  9051. ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
  9052. ; 1932 : return (_Uptr - this->_Myptr()); // found a match
  9053. ; 1933 : else if (_Uptr == this->_Myptr())
  9054. ; 1934 : break; // at beginning, no more chance for match
  9055. ; 1935 : }
  9056. ; 1936 :
  9057. ; 1937 : return (npos); // no match
  9058. ; 1938 : }
  9059. ; 1939 :
  9060. ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
  9061. ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
  9062. ; 1942 : _DEBUG_POINTER(_Ptr);
  9063. ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
  9064. ; 1944 : }
  9065. ; 1945 :
  9066. ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
  9067. ; 1947 : { // look for _Ch before _Off
  9068. ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  9069. ; 1949 : }
  9070. ; 1950 :
  9071. ; 1951 : size_type find_first_of(const _Myt& _Right,
  9072. ; 1952 : size_type _Off = 0) const _NOEXCEPT
  9073. ; 1953 : { // look for one of _Right at or after _Off
  9074. ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
  9075. ; 1955 : }
  9076. ; 1956 :
  9077. ; 1957 : size_type find_first_of(const _Elem *_Ptr,
  9078. ; 1958 : size_type _Off, size_type _Count) const
  9079. ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
  9080. ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
  9081. ; 1961 : if (_Count != 0)
  9082. ; 1962 : _DEBUG_POINTER(_Ptr);
  9083. ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9084. ; 1964 :
  9085. ; 1965 : if (0 < _Count && _Off < this->_Mysize)
  9086. ; 1966 : { // room for match, look for it
  9087. ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  9088. ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  9089. ; 1969 : _Uptr < _Vptr; ++_Uptr)
  9090. ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  9091. ; 1971 : return (_Uptr - this->_Myptr()); // found a match
  9092. ; 1972 : }
  9093. ; 1973 :
  9094. ; 1974 : return (npos); // no match
  9095. ; 1975 : }
  9096. ; 1976 :
  9097. ; 1977 : size_type find_first_of(const _Elem *_Ptr,
  9098. ; 1978 : size_type _Off = 0) const
  9099. ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
  9100. ; 1980 : _DEBUG_POINTER(_Ptr);
  9101. ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
  9102. ; 1982 : }
  9103. ; 1983 :
  9104. ; 1984 : size_type find_first_of(_Elem _Ch,
  9105. ; 1985 : size_type _Off = 0) const
  9106. ; 1986 : { // look for _Ch at or after _Off
  9107. ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
  9108. ; 1988 : }
  9109. ; 1989 :
  9110. ; 1990 : size_type find_last_of(const _Myt& _Right,
  9111. ; 1991 : size_type _Off = npos) const _NOEXCEPT
  9112. ; 1992 : { // look for one of _Right before _Off
  9113. ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
  9114. ; 1994 : }
  9115. ; 1995 :
  9116. ; 1996 : size_type find_last_of(const _Elem *_Ptr,
  9117. ; 1997 : size_type _Off, size_type _Count) const
  9118. ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
  9119. ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
  9120. ; 2000 : if (_Count != 0)
  9121. ; 2001 : _DEBUG_POINTER(_Ptr);
  9122. ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9123. ; 2003 :
  9124. ; 2004 : if (0 < _Count && 0 < this->_Mysize)
  9125. ; 2005 : { // worth searching, do it
  9126. ; 2006 : const _Elem *_Uptr = this->_Myptr()
  9127. ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  9128. ; 2008 : for (; ; --_Uptr)
  9129. ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  9130. ; 2010 : return (_Uptr - this->_Myptr()); // found a match
  9131. ; 2011 : else if (_Uptr == this->_Myptr())
  9132. ; 2012 : break; // at beginning, no more chance for match
  9133. ; 2013 : }
  9134. ; 2014 :
  9135. ; 2015 : return (npos); // no match
  9136. ; 2016 : }
  9137. ; 2017 :
  9138. ; 2018 : size_type find_last_of(const _Elem *_Ptr,
  9139. ; 2019 : size_type _Off = npos) const
  9140. ; 2020 : { // look for one of [_Ptr, <null>) before _Off
  9141. ; 2021 : _DEBUG_POINTER(_Ptr);
  9142. ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
  9143. ; 2023 : }
  9144. ; 2024 :
  9145. ; 2025 : size_type find_last_of(_Elem _Ch,
  9146. ; 2026 : size_type _Off = npos) const
  9147. ; 2027 : { // look for _Ch before _Off
  9148. ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  9149. ; 2029 : }
  9150. ; 2030 :
  9151. ; 2031 : size_type find_first_not_of(const _Myt& _Right,
  9152. ; 2032 : size_type _Off = 0) const _NOEXCEPT
  9153. ; 2033 : { // look for none of _Right at or after _Off
  9154. ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
  9155. ; 2035 : _Right.size()));
  9156. ; 2036 : }
  9157. ; 2037 :
  9158. ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
  9159. ; 2039 : size_type _Off, size_type _Count) const
  9160. ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
  9161. ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
  9162. ; 2042 : if (_Count != 0)
  9163. ; 2043 : _DEBUG_POINTER(_Ptr);
  9164. ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9165. ; 2045 :
  9166. ; 2046 : if (_Off < this->_Mysize)
  9167. ; 2047 : { // room for match, look for it
  9168. ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  9169. ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  9170. ; 2050 : _Uptr < _Vptr; ++_Uptr)
  9171. ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  9172. ; 2052 : return (_Uptr - this->_Myptr());
  9173. ; 2053 : }
  9174. ; 2054 : return (npos);
  9175. ; 2055 : }
  9176. ; 2056 :
  9177. ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
  9178. ; 2058 : size_type _Off = 0) const
  9179. ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
  9180. ; 2060 : _DEBUG_POINTER(_Ptr);
  9181. ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  9182. ; 2062 : }
  9183. ; 2063 :
  9184. ; 2064 : size_type find_first_not_of(_Elem _Ch,
  9185. ; 2065 : size_type _Off = 0) const
  9186. ; 2066 : { // look for non _Ch at or after _Off
  9187. ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
  9188. ; 2068 : }
  9189. ; 2069 :
  9190. ; 2070 : size_type find_last_not_of(const _Myt& _Right,
  9191. ; 2071 : size_type _Off = npos) const _NOEXCEPT
  9192. ; 2072 : { // look for none of _Right before _Off
  9193. ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
  9194. ; 2074 : }
  9195. ; 2075 :
  9196. ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
  9197. ; 2077 : size_type _Off, size_type _Count) const
  9198. ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
  9199. ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
  9200. ; 2080 : if (_Count != 0)
  9201. ; 2081 : _DEBUG_POINTER(_Ptr);
  9202. ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9203. ; 2083 :
  9204. ; 2084 : if (0 < this->_Mysize)
  9205. ; 2085 : { // worth searching, do it
  9206. ; 2086 : const _Elem *_Uptr = this->_Myptr()
  9207. ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  9208. ; 2088 : for (; ; --_Uptr)
  9209. ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  9210. ; 2090 : return (_Uptr - this->_Myptr());
  9211. ; 2091 : else if (_Uptr == this->_Myptr())
  9212. ; 2092 : break;
  9213. ; 2093 : }
  9214. ; 2094 : return (npos);
  9215. ; 2095 : }
  9216. ; 2096 :
  9217. ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
  9218. ; 2098 : size_type _Off = npos) const
  9219. ; 2099 : { // look for none of [_Ptr, <null>) before _Off
  9220. ; 2100 : _DEBUG_POINTER(_Ptr);
  9221. ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  9222. ; 2102 : }
  9223. ; 2103 :
  9224. ; 2104 : size_type find_last_not_of(_Elem _Ch,
  9225. ; 2105 : size_type _Off = npos) const
  9226. ; 2106 : { // look for non _Ch before _Off
  9227. ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
  9228. ; 2108 : }
  9229. ; 2109 :
  9230. ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
  9231. ; 2111 : { // return [_Off, _Off + _Count) as new string
  9232. ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
  9233. ; 2113 : }
  9234. ; 2114 :
  9235. ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
  9236. ; 2116 : { // compare [0, _Mysize) with _Right
  9237. ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
  9238. ; 2118 : }
  9239. ; 2119 :
  9240. ; 2120 : int compare(size_type _Off, size_type _N0,
  9241. ; 2121 : const _Myt& _Right) const
  9242. ; 2122 : { // compare [_Off, _Off + _N0) with _Right
  9243. ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
  9244. ; 2124 : }
  9245. ; 2125 :
  9246. ; 2126 : int compare(size_type _Off,
  9247. ; 2127 : size_type _N0, const _Myt& _Right,
  9248. ; 2128 : size_type _Roff, size_type _Count) const
  9249. ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  9250. ; 2130 : if (_Right.size() < _Roff)
  9251. ; 2131 : _Xran(); // _Off off end
  9252. ; 2132 : if (_Right._Mysize - _Roff < _Count)
  9253. ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
  9254. ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
  9255. ; 2135 : }
  9256. ; 2136 :
  9257. ; 2137 : int compare(const _Elem *_Ptr) const
  9258. ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
  9259. ; 2139 : _DEBUG_POINTER(_Ptr);
  9260. ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
  9261. ; 2141 : }
  9262. ; 2142 :
  9263. ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
  9264. ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
  9265. ; 2145 : _DEBUG_POINTER(_Ptr);
  9266. ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  9267. ; 2147 : }
  9268. ; 2148 :
  9269. ; 2149 : int compare(size_type _Off,
  9270. ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
  9271. ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  9272. ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
  9273. ; 2153 : if (_Count != 0)
  9274. ; 2154 : _DEBUG_POINTER(_Ptr);
  9275. ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9276. ; 2156 :
  9277. ; 2157 : if (this->_Mysize < _Off)
  9278. ; 2158 : _Xran(); // _Off off end
  9279. ; 2159 : if (this->_Mysize - _Off < _N0)
  9280. ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  9281. ; 2161 :
  9282. ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
  9283. ; 2163 : _N0 < _Count ? _N0 : _Count);
  9284. ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
  9285. ; 2165 : : _N0 == _Count ? 0 : +1);
  9286. ; 2166 : }
  9287. ; 2167 :
  9288. ; 2168 : allocator_type get_allocator() const _NOEXCEPT
  9289. ; 2169 : { // return allocator object for values
  9290. ; 2170 : return (this->_Getal());
  9291. ; 2171 : }
  9292. ; 2172 :
  9293. ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
  9294. ; 2174 : { // assign _Count copies of _Ch beginning at _Off
  9295. ; 2175 : if (_Count == 1)
  9296. ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
  9297. ; 2177 : else
  9298. ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
  9299. ; 2179 : }
  9300. ; 2180 :
  9301. ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
  9302. ; 2182 : { // copy _Oldlen elements to newly allocated buffer
  9303. ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
  9304. ; 2184 : if (max_size() < _Newres)
  9305. ; 2185 : _Newres = _Newsize; // undo roundup if too big
  9306. ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
  9307. ; 2187 : ;
  9308. ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
  9309. ; 2189 : _Newres = this->_Myres
  9310. ; 2190 : + this->_Myres / 2; // grow exponentially if possible
  9311. ; 2191 : else
  9312. ; 2192 : _Newres = max_size(); // settle for max_size()
  9313. ; 2193 :
  9314. ; 2194 : _Elem *_Ptr;
  9315. ; 2195 : _TRY_BEGIN
  9316. ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
  9317. ; 2197 : _CATCH_ALL
  9318. ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
  9319. ; 2199 : _TRY_BEGIN
  9320. ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
  9321. ; 2201 : _CATCH_ALL
  9322. ; 2202 : _Tidy(true); // failed again, discard storage and reraise
  9323. ; 2203 : _RERAISE;
  9324. ; 2204 : _CATCH_END
  9325. ; 2205 : _CATCH_END
  9326. ; 2206 :
  9327. ; 2207 : if (0 < _Oldlen)
  9328. ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
  9329. ; 2209 : _Oldlen); // copy existing elements
  9330. ; 2210 : _Tidy(true);
  9331. ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  9332. ; 2212 : this->_Myres = _Newres;
  9333. ; 2213 : _Eos(_Oldlen);
  9334. ; 2214 : }
  9335. ; 2215 :
  9336. ; 2216 : void _Eos(size_type _Newsize)
  9337. ; 2217 : { // set new length and null terminator
  9338. ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
  9339.  
  9340. mov DWORD PTR [esi+16], 0
  9341.  
  9342. ; 517 : : this->_Bx._Buf);
  9343.  
  9344. jb SHORT $LN14@erase
  9345. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  9346.  
  9347. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  9348.  
  9349. mov eax, DWORD PTR [esi]
  9350. pop edi
  9351. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  9352.  
  9353. ; 564 : _Left = _Right;
  9354.  
  9355. mov BYTE PTR [eax], 0
  9356. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  9357.  
  9358. ; 1329 : return (*this);
  9359.  
  9360. mov eax, esi
  9361. pop esi
  9362.  
  9363. ; 1330 : }
  9364.  
  9365. pop ebp
  9366. ret 8
  9367. $LN14@erase:
  9368.  
  9369. ; 517 : : this->_Bx._Buf);
  9370.  
  9371. mov eax, esi
  9372. pop edi
  9373. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  9374.  
  9375. ; 564 : _Left = _Right;
  9376.  
  9377. mov BYTE PTR [eax], 0
  9378. pop esi
  9379. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  9380.  
  9381. ; 1330 : }
  9382.  
  9383. pop ebp
  9384. ret 8
  9385. $LN3@erase:
  9386.  
  9387. ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
  9388. ; 1322 : else if (0 < _Count)
  9389.  
  9390. test eax, eax
  9391. je SHORT $LN40@erase
  9392.  
  9393. ; 517 : : this->_Bx._Buf);
  9394.  
  9395. cmp DWORD PTR [esi+20], 16 ; 00000010H
  9396. jb SHORT $LN23@erase
  9397. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  9398.  
  9399. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  9400.  
  9401. mov ecx, DWORD PTR [esi]
  9402. $LN23@erase:
  9403. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  9404.  
  9405. ; 1325 : size_type _Newsize = this->_Mysize - _Count;
  9406.  
  9407. sub edi, eax
  9408. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  9409.  
  9410. ; 553 : : (_Elem *)_CSTD memmove(_First1, _First2, _Count));
  9411.  
  9412. je SHORT $LN29@erase
  9413. push edi
  9414. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  9415.  
  9416. ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
  9417.  
  9418. add eax, ecx
  9419. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  9420.  
  9421. ; 553 : : (_Elem *)_CSTD memmove(_First1, _First2, _Count));
  9422.  
  9423. push eax
  9424. push ecx
  9425. call DWORD PTR __imp__memmove
  9426. add esp, 12 ; 0000000cH
  9427. $LN29@erase:
  9428. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  9429.  
  9430. ; 517 : : this->_Bx._Buf);
  9431.  
  9432. cmp DWORD PTR [esi+20], 16 ; 00000010H
  9433.  
  9434. ; 1331 :
  9435. ; 1332 : iterator erase(const_iterator _Where)
  9436. ; 1333 : { // erase element at _Where
  9437. ; 1334 : size_type _Count = _Pdif(_Where, begin());
  9438. ; 1335 : erase(_Count, 1);
  9439. ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  9440. ; 1337 : }
  9441. ; 1338 :
  9442. ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
  9443. ; 1340 : { // erase substring [_First, _Last)
  9444. ; 1341 : _DEBUG_RANGE(_First, _Last);
  9445. ; 1342 : size_type _Count = _Pdif(_First, begin());
  9446. ; 1343 : erase(_Count, _Pdif(_Last, _First));
  9447. ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  9448. ; 1345 : }
  9449. ; 1346 :
  9450. ; 1347 : void clear() _NOEXCEPT
  9451. ; 1348 : { // erase all
  9452. ; 1349 : _Eos(0);
  9453. ; 1350 : }
  9454. ; 1351 :
  9455. ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
  9456. ; 1353 : { // replace [_Off, _Off + _N0) with _Right
  9457. ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
  9458. ; 1355 : }
  9459. ; 1356 :
  9460. ; 1357 : _Myt& replace(size_type _Off,
  9461. ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
  9462. ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  9463. ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
  9464. ; 1361 : _Xran(); // _Off or _Roff off end
  9465. ; 1362 : if (this->_Mysize - _Off < _N0)
  9466. ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  9467. ; 1364 : size_type _Num = _Right.size() - _Roff;
  9468. ; 1365 : if (_Num < _Count)
  9469. ; 1366 : _Count = _Num; // trim _Count to size
  9470. ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
  9471. ; 1368 : _Xlen(); // result too long
  9472. ; 1369 :
  9473. ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
  9474. ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
  9475. ; 1372 : if (this->_Mysize < _Newsize)
  9476. ; 1373 : _Grow(_Newsize);
  9477. ; 1374 :
  9478. ; 1375 : if (this != &_Right)
  9479. ; 1376 : { // no overlap, just move down and copy in new stuff
  9480. ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
  9481. ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
  9482. ; 1379 : _Traits::copy(this->_Myptr() + _Off,
  9483. ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
  9484. ; 1381 : }
  9485. ; 1382 : else if (_Count <= _N0)
  9486. ; 1383 : { // hole doesn't get larger, just copy in substring
  9487. ; 1384 : _Traits::move(this->_Myptr() + _Off,
  9488. ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
  9489. ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
  9490. ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  9491. ; 1388 : }
  9492. ; 1389 : else if (_Roff <= _Off)
  9493. ; 1390 : { // hole gets larger, substring begins before hole
  9494. ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
  9495. ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  9496. ; 1393 : _Traits::move(this->_Myptr() + _Off,
  9497. ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
  9498. ; 1395 : }
  9499. ; 1396 : else if (_Off + _N0 <= _Roff)
  9500. ; 1397 : { // hole gets larger, substring begins after hole
  9501. ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
  9502. ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  9503. ; 1400 : _Traits::move(this->_Myptr() + _Off,
  9504. ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
  9505. ; 1402 : _Count); // fill hole
  9506. ; 1403 : }
  9507. ; 1404 : else
  9508. ; 1405 : { // hole gets larger, substring begins in hole
  9509. ; 1406 : _Traits::move(this->_Myptr() + _Off,
  9510. ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
  9511. ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
  9512. ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  9513. ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
  9514. ; 1411 : this->_Myptr() + _Roff + _Count,
  9515. ; 1412 : _Count - _N0); // fill rest of new hole
  9516. ; 1413 : }
  9517. ; 1414 :
  9518. ; 1415 : _Eos(_Newsize);
  9519. ; 1416 : return (*this);
  9520. ; 1417 : }
  9521. ; 1418 :
  9522. ; 1419 : _Myt& replace(size_type _Off,
  9523. ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
  9524. ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  9525. ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
  9526. ; 1423 : if (_Count != 0)
  9527. ; 1424 : _DEBUG_POINTER(_Ptr);
  9528. ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9529. ; 1426 :
  9530. ; 1427 : if (_Inside(_Ptr))
  9531. ; 1428 : return (replace(_Off, _N0, *this,
  9532. ; 1429 : _Ptr - this->_Myptr(),
  9533. ; 1430 : _Count)); // substring, replace carefully
  9534. ; 1431 : if (this->_Mysize < _Off)
  9535. ; 1432 : _Xran(); // _Off off end
  9536. ; 1433 : if (this->_Mysize - _Off < _N0)
  9537. ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  9538. ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
  9539. ; 1436 : _Xlen(); // result too long
  9540. ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
  9541. ; 1438 :
  9542. ; 1439 : if (_Count < _N0)
  9543. ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
  9544. ; 1441 : this->_Myptr() + _Off + _N0,
  9545. ; 1442 : _Nm); // smaller hole, move tail up
  9546. ; 1443 : size_type _Num;
  9547. ; 1444 : if ((0 < _Count || 0 < _N0)
  9548. ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  9549. ; 1446 : { // make room and rearrange
  9550. ; 1447 : if (_N0 < _Count)
  9551. ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
  9552. ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  9553. ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
  9554. ; 1451 : _Eos(_Num);
  9555. ; 1452 : }
  9556. ; 1453 : return (*this);
  9557. ; 1454 : }
  9558. ; 1455 :
  9559. ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
  9560. ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
  9561. ; 1458 : _DEBUG_POINTER(_Ptr);
  9562. ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  9563. ; 1460 : }
  9564. ; 1461 :
  9565. ; 1462 : _Myt& replace(size_type _Off,
  9566. ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
  9567. ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
  9568. ; 1465 : if (this->_Mysize < _Off)
  9569. ; 1466 : _Xran(); // _Off off end
  9570. ; 1467 : if (this->_Mysize - _Off < _N0)
  9571. ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  9572. ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
  9573. ; 1470 : _Xlen(); // result too long
  9574. ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
  9575. ; 1472 :
  9576. ; 1473 : if (_Count < _N0)
  9577. ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
  9578. ; 1475 : this->_Myptr() + _Off + _N0,
  9579. ; 1476 : _Nm); // smaller hole, move tail up
  9580. ; 1477 : size_type _Num;
  9581. ; 1478 : if ((0 < _Count || 0 < _N0)
  9582. ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  9583. ; 1480 : { // make room and rearrange
  9584. ; 1481 : if (_N0 < _Count)
  9585. ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
  9586. ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  9587. ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
  9588. ; 1485 : _Eos(_Num);
  9589. ; 1486 : }
  9590. ; 1487 : return (*this);
  9591. ; 1488 : }
  9592. ; 1489 :
  9593. ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
  9594. ; 1491 : const _Myt& _Right)
  9595. ; 1492 : { // replace [_First, _Last) with _Right
  9596. ; 1493 : return (replace(
  9597. ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
  9598. ; 1495 : }
  9599. ; 1496 :
  9600. ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
  9601. ; 1498 : const _Elem *_Ptr, size_type _Count)
  9602. ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
  9603. ; 1500 : return (replace(
  9604. ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
  9605. ; 1502 : }
  9606. ; 1503 :
  9607. ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
  9608. ; 1505 : const _Elem *_Ptr)
  9609. ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
  9610. ; 1507 : return (replace(
  9611. ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
  9612. ; 1509 : }
  9613. ; 1510 :
  9614. ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
  9615. ; 1512 : size_type _Count, _Elem _Ch)
  9616. ; 1513 : { // replace [_First, _Last) with _Count * _Ch
  9617. ; 1514 : return (replace(
  9618. ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
  9619. ; 1516 : }
  9620. ; 1517 :
  9621. ; 1518 : template<class _Iter>
  9622. ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
  9623. ; 1520 : _Myt&>::type
  9624. ; 1521 : replace(const_iterator _First, const_iterator _Last,
  9625. ; 1522 : _Iter _First2, _Iter _Last2)
  9626. ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
  9627. ; 1524 : _Myt _Right(_First2, _Last2);
  9628. ; 1525 : replace(_First, _Last, _Right);
  9629. ; 1526 : return (*this);
  9630. ; 1527 : }
  9631. ; 1528 :
  9632. ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
  9633. ; 1530 : const_pointer _First2, const_pointer _Last2)
  9634. ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  9635. ; 1532 : if (_First2 == _Last2)
  9636. ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  9637. ; 1534 : else
  9638. ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  9639. ; 1536 : &*_First2, _Last2 - _First2);
  9640. ; 1537 : return (*this);
  9641. ; 1538 : }
  9642. ; 1539 :
  9643. ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
  9644. ; 1541 : pointer _First2, pointer _Last2)
  9645. ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  9646. ; 1543 : if (_First2 == _Last2)
  9647. ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  9648. ; 1545 : else
  9649. ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  9650. ; 1547 : &*_First2, _Last2 - _First2);
  9651. ; 1548 : return (*this);
  9652. ; 1549 : }
  9653. ; 1550 :
  9654. ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
  9655. ; 1552 : const_iterator _First2, const_iterator _Last2)
  9656. ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  9657. ; 1554 : if (_First2 == _Last2)
  9658. ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  9659. ; 1556 : else
  9660. ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  9661. ; 1558 : &*_First2, _Last2 - _First2);
  9662. ; 1559 : return (*this);
  9663. ; 1560 : }
  9664. ; 1561 :
  9665. ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
  9666. ; 1563 : iterator _First2, iterator _Last2)
  9667. ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  9668. ; 1565 : if (_First2 == _Last2)
  9669. ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  9670. ; 1567 : else
  9671. ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  9672. ; 1569 : &*_First2, _Last2 - _First2);
  9673. ; 1570 : return (*this);
  9674. ; 1571 : }
  9675. ; 1572 :
  9676. ; 1573 : iterator begin() _NOEXCEPT
  9677. ; 1574 : { // return iterator for beginning of mutable sequence
  9678. ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
  9679. ; 1576 : }
  9680. ; 1577 :
  9681. ; 1578 : const_iterator begin() const _NOEXCEPT
  9682. ; 1579 : { // return iterator for beginning of nonmutable sequence
  9683. ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
  9684. ; 1581 : }
  9685. ; 1582 :
  9686. ; 1583 : iterator end() _NOEXCEPT
  9687. ; 1584 : { // return iterator for end of mutable sequence
  9688. ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
  9689. ; 1586 : }
  9690. ; 1587 :
  9691. ; 1588 : const_iterator end() const _NOEXCEPT
  9692. ; 1589 : { // return iterator for end of nonmutable sequence
  9693. ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
  9694. ; 1591 : }
  9695. ; 1592 :
  9696. ; 1593 : reverse_iterator rbegin() _NOEXCEPT
  9697. ; 1594 : { // return iterator for beginning of reversed mutable sequence
  9698. ; 1595 : return (reverse_iterator(end()));
  9699. ; 1596 : }
  9700. ; 1597 :
  9701. ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
  9702. ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
  9703. ; 1600 : return (const_reverse_iterator(end()));
  9704. ; 1601 : }
  9705. ; 1602 :
  9706. ; 1603 : reverse_iterator rend() _NOEXCEPT
  9707. ; 1604 : { // return iterator for end of reversed mutable sequence
  9708. ; 1605 : return (reverse_iterator(begin()));
  9709. ; 1606 : }
  9710. ; 1607 :
  9711. ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
  9712. ; 1609 : { // return iterator for end of reversed nonmutable sequence
  9713. ; 1610 : return (const_reverse_iterator(begin()));
  9714. ; 1611 : }
  9715. ; 1612 :
  9716. ; 1613 : #if _HAS_CPP0X
  9717. ; 1614 : const_iterator cbegin() const _NOEXCEPT
  9718. ; 1615 : { // return iterator for beginning of nonmutable sequence
  9719. ; 1616 : return (((const _Myt *)this)->begin());
  9720. ; 1617 : }
  9721. ; 1618 :
  9722. ; 1619 : const_iterator cend() const _NOEXCEPT
  9723. ; 1620 : { // return iterator for end of nonmutable sequence
  9724. ; 1621 : return (((const _Myt *)this)->end());
  9725. ; 1622 : }
  9726. ; 1623 :
  9727. ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
  9728. ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
  9729. ; 1626 : return (((const _Myt *)this)->rbegin());
  9730. ; 1627 : }
  9731. ; 1628 :
  9732. ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
  9733. ; 1630 : { // return iterator for end of reversed nonmutable sequence
  9734. ; 1631 : return (((const _Myt *)this)->rend());
  9735. ; 1632 : }
  9736. ; 1633 :
  9737. ; 1634 : void shrink_to_fit()
  9738. ; 1635 : { // reduce capacity
  9739. ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
  9740. ; 1637 : { // worth shrinking, do it
  9741. ; 1638 : _Myt _Tmp(*this);
  9742. ; 1639 : swap(_Tmp);
  9743. ; 1640 : }
  9744. ; 1641 : }
  9745. ; 1642 : #endif /* _HAS_CPP0X */
  9746. ; 1643 :
  9747. ; 1644 : reference at(size_type _Off)
  9748. ; 1645 : { // subscript mutable sequence with checking
  9749. ; 1646 : if (this->_Mysize <= _Off)
  9750. ; 1647 : _Xran(); // _Off off end
  9751. ; 1648 : return (this->_Myptr()[_Off]);
  9752. ; 1649 : }
  9753. ; 1650 :
  9754. ; 1651 : const_reference at(size_type _Off) const
  9755. ; 1652 : { // subscript nonmutable sequence with checking
  9756. ; 1653 : if (this->_Mysize <= _Off)
  9757. ; 1654 : _Xran(); // _Off off end
  9758. ; 1655 : return (this->_Myptr()[_Off]);
  9759. ; 1656 : }
  9760. ; 1657 :
  9761. ; 1658 : reference operator[](size_type _Off)
  9762. ; 1659 : { // subscript mutable sequence
  9763. ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
  9764. ; 1661 : if (this->_Mysize < _Off) // sic
  9765. ; 1662 : _DEBUG_ERROR("string subscript out of range");
  9766. ; 1663 :
  9767. ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
  9768. ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  9769. ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9770. ; 1667 :
  9771. ; 1668 : return (this->_Myptr()[_Off]);
  9772. ; 1669 : }
  9773. ; 1670 :
  9774. ; 1671 : const_reference operator[](size_type _Off) const
  9775. ; 1672 : { // subscript nonmutable sequence
  9776. ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
  9777. ; 1674 : if (this->_Mysize < _Off) // sic
  9778. ; 1675 : _DEBUG_ERROR("string subscript out of range");
  9779. ; 1676 :
  9780. ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
  9781. ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  9782. ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9783. ; 1680 :
  9784. ; 1681 : return (this->_Myptr()[_Off]);
  9785. ; 1682 : }
  9786. ; 1683 :
  9787. ; 1684 : void push_back(_Elem _Ch)
  9788. ; 1685 : { // insert element at end
  9789. ; 1686 : insert(end(), _Ch);
  9790. ; 1687 : }
  9791. ; 1688 :
  9792. ; 1689 : #if _HAS_CPP0X
  9793. ; 1690 : void pop_back()
  9794. ; 1691 : { // erase element at end
  9795. ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
  9796. ; 1693 : }
  9797. ; 1694 :
  9798. ; 1695 : reference front()
  9799. ; 1696 : { // return first element of mutable sequence
  9800. ; 1697 : return (*begin());
  9801. ; 1698 : }
  9802. ; 1699 :
  9803. ; 1700 : const_reference front() const
  9804. ; 1701 : { // return first element of nonmutable sequence
  9805. ; 1702 : return (*begin());
  9806. ; 1703 : }
  9807. ; 1704 :
  9808. ; 1705 : reference back()
  9809. ; 1706 : { // return last element of mutable sequence
  9810. ; 1707 : return (*(end() - 1));
  9811. ; 1708 : }
  9812. ; 1709 :
  9813. ; 1710 : const_reference back() const
  9814. ; 1711 : { // return last element of nonmutable sequence
  9815. ; 1712 : return (*(end() - 1));
  9816. ; 1713 : }
  9817. ; 1714 : #endif /* _HAS_CPP0X */
  9818. ; 1715 :
  9819. ; 1716 : const _Elem *c_str() const _NOEXCEPT
  9820. ; 1717 : { // return pointer to null-terminated nonmutable array
  9821. ; 1718 : return (this->_Myptr());
  9822. ; 1719 : }
  9823. ; 1720 :
  9824. ; 1721 : const _Elem *data() const _NOEXCEPT
  9825. ; 1722 : { // return pointer to nonmutable array
  9826. ; 1723 : return (c_str());
  9827. ; 1724 : }
  9828. ; 1725 :
  9829. ; 1726 : size_type length() const _NOEXCEPT
  9830. ; 1727 : { // return length of sequence
  9831. ; 1728 : return (this->_Mysize);
  9832. ; 1729 : }
  9833. ; 1730 :
  9834. ; 1731 : size_type size() const _NOEXCEPT
  9835. ; 1732 : { // return length of sequence
  9836. ; 1733 : return (this->_Mysize);
  9837. ; 1734 : }
  9838. ; 1735 :
  9839. ; 1736 : size_type max_size() const _NOEXCEPT
  9840. ; 1737 : { // return maximum possible length of sequence
  9841. ; 1738 : size_type _Num = this->_Getal().max_size();
  9842. ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
  9843. ; 1740 : }
  9844. ; 1741 :
  9845. ; 1742 : void resize(size_type _Newsize)
  9846. ; 1743 : { // determine new length, padding with null elements as needed
  9847. ; 1744 : resize(_Newsize, _Elem());
  9848. ; 1745 : }
  9849. ; 1746 :
  9850. ; 1747 : void resize(size_type _Newsize, _Elem _Ch)
  9851. ; 1748 : { // determine new length, padding with _Ch elements as needed
  9852. ; 1749 : if (_Newsize <= this->_Mysize)
  9853. ; 1750 : _Eos(_Newsize);
  9854. ; 1751 : else
  9855. ; 1752 : append(_Newsize - this->_Mysize, _Ch);
  9856. ; 1753 : }
  9857. ; 1754 :
  9858. ; 1755 : size_type capacity() const _NOEXCEPT
  9859. ; 1756 : { // return current length of allocated storage
  9860. ; 1757 : return (this->_Myres);
  9861. ; 1758 : }
  9862. ; 1759 :
  9863. ; 1760 : void reserve(size_type _Newcap = 0)
  9864. ; 1761 : { // determine new minimum length of allocated storage
  9865. ; 1762 : if (this->_Mysize <= _Newcap && this->_Myres != _Newcap)
  9866. ; 1763 : { // change reservation
  9867. ; 1764 : size_type _Size = this->_Mysize;
  9868. ; 1765 : if (_Grow(_Newcap, true))
  9869. ; 1766 : _Eos(_Size);
  9870. ; 1767 : }
  9871. ; 1768 : }
  9872. ; 1769 :
  9873. ; 1770 : bool empty() const _NOEXCEPT
  9874. ; 1771 : { // test if sequence is empty
  9875. ; 1772 : return (this->_Mysize == 0);
  9876. ; 1773 : }
  9877. ; 1774 :
  9878. ; 1775 : _SCL_INSECURE_DEPRECATE
  9879. ; 1776 :
  9880. ; 1777 : size_type copy(_Elem *_Ptr,
  9881. ; 1778 : size_type _Count, size_type _Off = 0) const
  9882. ; 1779 : { // copy [_Off, _Off + _Count) to [_Ptr, _Ptr + _Count)
  9883. ; 1780 : #if _ITERATOR_DEBUG_LEVEL == 2
  9884. ; 1781 : if (_Count != 0)
  9885. ; 1782 : _DEBUG_POINTER(_Ptr);
  9886. ; 1783 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9887. ; 1784 :
  9888. ; 1785 : if (this->_Mysize < _Off)
  9889. ; 1786 : _Xran(); // _Off off end
  9890. ; 1787 : if (this->_Mysize - _Off < _Count)
  9891. ; 1788 : _Count = this->_Mysize - _Off;
  9892. ; 1789 : _Traits::copy(_Ptr, this->_Myptr() + _Off, _Count);
  9893. ; 1790 : return (_Count);
  9894. ; 1791 : }
  9895. ; 1792 :
  9896. ; 1793 : size_type _Copy_s(_Elem *_Dest, size_type _Dest_size,
  9897. ; 1794 : size_type _Count, size_type _Off = 0) const
  9898. ; 1795 : { // copy [_Off, _Off + _Count) to [_Dest, _Dest + _Count)
  9899. ; 1796 : #if _ITERATOR_DEBUG_LEVEL == 2
  9900. ; 1797 : if (_Count != 0)
  9901. ; 1798 : _DEBUG_POINTER(_Dest);
  9902. ; 1799 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9903. ; 1800 :
  9904. ; 1801 : if (this->_Mysize < _Off)
  9905. ; 1802 : _Xran(); // _Off off end
  9906. ; 1803 : if (this->_Mysize - _Off < _Count)
  9907. ; 1804 : _Count = this->_Mysize - _Off;
  9908. ; 1805 : _Traits::_Copy_s(_Dest, _Dest_size, this->_Myptr() + _Off, _Count);
  9909. ; 1806 : return (_Count);
  9910. ; 1807 : }
  9911. ; 1808 :
  9912. ; 1809 : void _Swap_bx(_Myt& _Right)
  9913. ; 1810 : { // exchange _Bx with _Right._Bx
  9914. ; 1811 : if (this->_BUF_SIZE <= this->_Myres)
  9915. ; 1812 : if (this->_BUF_SIZE <= _Right._Myres)
  9916. ; 1813 : _Swap_adl(this->_Bx._Ptr, _Right._Bx._Ptr);
  9917. ; 1814 : else
  9918. ; 1815 : { // swap large with small
  9919. ; 1816 : pointer _Ptr = this->_Bx._Ptr;
  9920. ; 1817 : this->_Getal().destroy(&this->_Bx._Ptr);
  9921. ; 1818 : _Traits::copy(this->_Bx._Buf,
  9922. ; 1819 : _Right._Bx._Buf, _Right._Mysize + 1);
  9923. ; 1820 : this->_Getal().construct(&_Right._Bx._Ptr, _Ptr);
  9924. ; 1821 : }
  9925. ; 1822 : else
  9926. ; 1823 : if (_Right._Myres < this->_BUF_SIZE)
  9927. ; 1824 : _STD swap(this->_Bx._Buf, _Right._Bx._Buf);
  9928. ; 1825 : else
  9929. ; 1826 : { // swap small with large
  9930. ; 1827 : pointer _Ptr = _Right._Bx._Ptr;
  9931. ; 1828 : this->_Getal().destroy(&_Right._Bx._Ptr);
  9932. ; 1829 : _Traits::copy(_Right._Bx._Buf,
  9933. ; 1830 : this->_Bx._Buf, this->_Mysize + 1);
  9934. ; 1831 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  9935. ; 1832 : }
  9936. ; 1833 : }
  9937. ; 1834 :
  9938. ; 1835 : void swap(_Myt& _Right)
  9939. ; 1836 : { // exchange contents with _Right
  9940. ; 1837 : if (this == &_Right)
  9941. ; 1838 : ; // same object, do nothing
  9942. ; 1839 : else if (this->_Getal() == _Right._Getal())
  9943. ; 1840 : { // same allocator, swap control information
  9944. ; 1841 : this->_Swap_all(_Right);
  9945. ; 1842 : _Swap_bx(_Right);
  9946. ; 1843 : _STD swap(this->_Mysize, _Right._Mysize);
  9947. ; 1844 : _STD swap(this->_Myres, _Right._Myres);
  9948. ; 1845 : }
  9949. ; 1846 :
  9950. ; 1847 : #if _HAS_CPP0X
  9951. ; 1848 : else if (_Alty::propagate_on_container_swap::value)
  9952. ; 1849 : { // swap allocators and control information
  9953. ; 1850 : this->_Swap_alloc(_Right);
  9954. ; 1851 : _Swap_bx(_Right);
  9955. ; 1852 : _STD swap(this->_Bx, _Right._Bx); // pointer bitwise copyable?
  9956. ; 1853 : _STD swap(this->_Mysize, _Right._Mysize);
  9957. ; 1854 : _STD swap(this->_Myres, _Right._Myres);
  9958. ; 1855 : }
  9959. ; 1856 : #endif /* _HAS_CPP0X */
  9960. ; 1857 :
  9961. ; 1858 : else
  9962. ; 1859 : { // different allocator, do multiple assigns
  9963. ; 1860 : _Myt _Tmp = *this;
  9964. ; 1861 :
  9965. ; 1862 : *this = _Right;
  9966. ; 1863 : _Right = _Tmp;
  9967. ; 1864 : }
  9968. ; 1865 : }
  9969. ; 1866 :
  9970. ; 1867 : size_type find(const _Myt& _Right, size_type _Off = 0) const _NOEXCEPT
  9971. ; 1868 : { // look for _Right beginning at or after _Off
  9972. ; 1869 : return (find(_Right._Myptr(), _Off, _Right.size()));
  9973. ; 1870 : }
  9974. ; 1871 :
  9975. ; 1872 : size_type find(const _Elem *_Ptr,
  9976. ; 1873 : size_type _Off, size_type _Count) const
  9977. ; 1874 : { // look for [_Ptr, _Ptr + _Count) beginning at or after _Off
  9978. ; 1875 : #if _ITERATOR_DEBUG_LEVEL == 2
  9979. ; 1876 : if (_Count != 0)
  9980. ; 1877 : _DEBUG_POINTER(_Ptr);
  9981. ; 1878 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  9982. ; 1879 :
  9983. ; 1880 : if (_Count == 0 && _Off <= this->_Mysize)
  9984. ; 1881 : return (_Off); // null string always matches (if inside string)
  9985. ; 1882 :
  9986. ; 1883 : size_type _Nm;
  9987. ; 1884 : if (_Off < this->_Mysize && _Count <= (_Nm = this->_Mysize - _Off))
  9988. ; 1885 : { // room for match, look for it
  9989. ; 1886 : const _Elem *_Uptr, *_Vptr;
  9990. ; 1887 : for (_Nm -= _Count - 1, _Vptr = this->_Myptr() + _Off;
  9991. ; 1888 : (_Uptr = _Traits::find(_Vptr, _Nm, *_Ptr)) != 0;
  9992. ; 1889 : _Nm -= _Uptr - _Vptr + 1, _Vptr = _Uptr + 1)
  9993. ; 1890 : if (_Traits::compare(_Uptr, _Ptr, _Count) == 0)
  9994. ; 1891 : return (_Uptr - this->_Myptr()); // found a match
  9995. ; 1892 : }
  9996. ; 1893 :
  9997. ; 1894 : return (npos); // no match
  9998. ; 1895 : }
  9999. ; 1896 :
  10000. ; 1897 : size_type find(const _Elem *_Ptr, size_type _Off = 0) const
  10001. ; 1898 : { // look for [_Ptr, <null>) beginning at or after _Off
  10002. ; 1899 : _DEBUG_POINTER(_Ptr);
  10003. ; 1900 : return (find(_Ptr, _Off, _Traits::length(_Ptr)));
  10004. ; 1901 : }
  10005. ; 1902 :
  10006. ; 1903 : size_type find(_Elem _Ch, size_type _Off = 0) const
  10007. ; 1904 : { // look for _Ch at or after _Off
  10008. ; 1905 : return (find((const _Elem *)&_Ch, _Off, 1));
  10009. ; 1906 : }
  10010. ; 1907 :
  10011. ; 1908 : size_type rfind(const _Myt& _Right, size_type _Off = npos) const _NOEXCEPT
  10012. ; 1909 : { // look for _Right beginning before _Off
  10013. ; 1910 : return (rfind(_Right._Myptr(), _Off, _Right.size()));
  10014. ; 1911 : }
  10015. ; 1912 :
  10016. ; 1913 : size_type rfind(const _Elem *_Ptr,
  10017. ; 1914 : size_type _Off, size_type _Count) const
  10018. ; 1915 : { // look for [_Ptr, _Ptr + _Count) beginning before _Off
  10019. ; 1916 : #if _ITERATOR_DEBUG_LEVEL == 2
  10020. ; 1917 : if (_Count != 0)
  10021. ; 1918 : _DEBUG_POINTER(_Ptr);
  10022. ; 1919 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  10023. ; 1920 :
  10024. ; 1921 : if (_Count == 0)
  10025. ; 1922 : return (_Off < this->_Mysize ? _Off
  10026. ; 1923 : : this->_Mysize); // null always matches
  10027. ; 1924 : if (_Count <= this->_Mysize)
  10028. ; 1925 : { // room for match, look for it
  10029. ; 1926 : const _Elem *_Uptr = this->_Myptr() +
  10030. ; 1927 : (_Off < this->_Mysize - _Count ? _Off
  10031. ; 1928 : : this->_Mysize - _Count);
  10032. ; 1929 : for (; ; --_Uptr)
  10033. ; 1930 : if (_Traits::eq(*_Uptr, *_Ptr)
  10034. ; 1931 : && _Traits::compare(_Uptr, _Ptr, _Count) == 0)
  10035. ; 1932 : return (_Uptr - this->_Myptr()); // found a match
  10036. ; 1933 : else if (_Uptr == this->_Myptr())
  10037. ; 1934 : break; // at beginning, no more chance for match
  10038. ; 1935 : }
  10039. ; 1936 :
  10040. ; 1937 : return (npos); // no match
  10041. ; 1938 : }
  10042. ; 1939 :
  10043. ; 1940 : size_type rfind(const _Elem *_Ptr, size_type _Off = npos) const
  10044. ; 1941 : { // look for [_Ptr, <null>) beginning before _Off
  10045. ; 1942 : _DEBUG_POINTER(_Ptr);
  10046. ; 1943 : return (rfind(_Ptr, _Off, _Traits::length(_Ptr)));
  10047. ; 1944 : }
  10048. ; 1945 :
  10049. ; 1946 : size_type rfind(_Elem _Ch, size_type _Off = npos) const
  10050. ; 1947 : { // look for _Ch before _Off
  10051. ; 1948 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  10052. ; 1949 : }
  10053. ; 1950 :
  10054. ; 1951 : size_type find_first_of(const _Myt& _Right,
  10055. ; 1952 : size_type _Off = 0) const _NOEXCEPT
  10056. ; 1953 : { // look for one of _Right at or after _Off
  10057. ; 1954 : return (find_first_of(_Right._Myptr(), _Off, _Right.size()));
  10058. ; 1955 : }
  10059. ; 1956 :
  10060. ; 1957 : size_type find_first_of(const _Elem *_Ptr,
  10061. ; 1958 : size_type _Off, size_type _Count) const
  10062. ; 1959 : { // look for one of [_Ptr, _Ptr + _Count) at or after _Off
  10063. ; 1960 : #if _ITERATOR_DEBUG_LEVEL == 2
  10064. ; 1961 : if (_Count != 0)
  10065. ; 1962 : _DEBUG_POINTER(_Ptr);
  10066. ; 1963 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  10067. ; 1964 :
  10068. ; 1965 : if (0 < _Count && _Off < this->_Mysize)
  10069. ; 1966 : { // room for match, look for it
  10070. ; 1967 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  10071. ; 1968 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  10072. ; 1969 : _Uptr < _Vptr; ++_Uptr)
  10073. ; 1970 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  10074. ; 1971 : return (_Uptr - this->_Myptr()); // found a match
  10075. ; 1972 : }
  10076. ; 1973 :
  10077. ; 1974 : return (npos); // no match
  10078. ; 1975 : }
  10079. ; 1976 :
  10080. ; 1977 : size_type find_first_of(const _Elem *_Ptr,
  10081. ; 1978 : size_type _Off = 0) const
  10082. ; 1979 : { // look for one of [_Ptr, <null>) at or after _Off
  10083. ; 1980 : _DEBUG_POINTER(_Ptr);
  10084. ; 1981 : return (find_first_of(_Ptr, _Off, _Traits::length(_Ptr)));
  10085. ; 1982 : }
  10086. ; 1983 :
  10087. ; 1984 : size_type find_first_of(_Elem _Ch,
  10088. ; 1985 : size_type _Off = 0) const
  10089. ; 1986 : { // look for _Ch at or after _Off
  10090. ; 1987 : return (find((const _Elem *)&_Ch, _Off, 1));
  10091. ; 1988 : }
  10092. ; 1989 :
  10093. ; 1990 : size_type find_last_of(const _Myt& _Right,
  10094. ; 1991 : size_type _Off = npos) const _NOEXCEPT
  10095. ; 1992 : { // look for one of _Right before _Off
  10096. ; 1993 : return (find_last_of(_Right._Myptr(), _Off, _Right.size()));
  10097. ; 1994 : }
  10098. ; 1995 :
  10099. ; 1996 : size_type find_last_of(const _Elem *_Ptr,
  10100. ; 1997 : size_type _Off, size_type _Count) const
  10101. ; 1998 : { // look for one of [_Ptr, _Ptr + _Count) before _Off
  10102. ; 1999 : #if _ITERATOR_DEBUG_LEVEL == 2
  10103. ; 2000 : if (_Count != 0)
  10104. ; 2001 : _DEBUG_POINTER(_Ptr);
  10105. ; 2002 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  10106. ; 2003 :
  10107. ; 2004 : if (0 < _Count && 0 < this->_Mysize)
  10108. ; 2005 : { // worth searching, do it
  10109. ; 2006 : const _Elem *_Uptr = this->_Myptr()
  10110. ; 2007 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  10111. ; 2008 : for (; ; --_Uptr)
  10112. ; 2009 : if (_Traits::find(_Ptr, _Count, *_Uptr) != 0)
  10113. ; 2010 : return (_Uptr - this->_Myptr()); // found a match
  10114. ; 2011 : else if (_Uptr == this->_Myptr())
  10115. ; 2012 : break; // at beginning, no more chance for match
  10116. ; 2013 : }
  10117. ; 2014 :
  10118. ; 2015 : return (npos); // no match
  10119. ; 2016 : }
  10120. ; 2017 :
  10121. ; 2018 : size_type find_last_of(const _Elem *_Ptr,
  10122. ; 2019 : size_type _Off = npos) const
  10123. ; 2020 : { // look for one of [_Ptr, <null>) before _Off
  10124. ; 2021 : _DEBUG_POINTER(_Ptr);
  10125. ; 2022 : return (find_last_of(_Ptr, _Off, _Traits::length(_Ptr)));
  10126. ; 2023 : }
  10127. ; 2024 :
  10128. ; 2025 : size_type find_last_of(_Elem _Ch,
  10129. ; 2026 : size_type _Off = npos) const
  10130. ; 2027 : { // look for _Ch before _Off
  10131. ; 2028 : return (rfind((const _Elem *)&_Ch, _Off, 1));
  10132. ; 2029 : }
  10133. ; 2030 :
  10134. ; 2031 : size_type find_first_not_of(const _Myt& _Right,
  10135. ; 2032 : size_type _Off = 0) const _NOEXCEPT
  10136. ; 2033 : { // look for none of _Right at or after _Off
  10137. ; 2034 : return (find_first_not_of(_Right._Myptr(), _Off,
  10138. ; 2035 : _Right.size()));
  10139. ; 2036 : }
  10140. ; 2037 :
  10141. ; 2038 : size_type find_first_not_of(const _Elem *_Ptr,
  10142. ; 2039 : size_type _Off, size_type _Count) const
  10143. ; 2040 : { // look for none of [_Ptr, _Ptr + _Count) at or after _Off
  10144. ; 2041 : #if _ITERATOR_DEBUG_LEVEL == 2
  10145. ; 2042 : if (_Count != 0)
  10146. ; 2043 : _DEBUG_POINTER(_Ptr);
  10147. ; 2044 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  10148. ; 2045 :
  10149. ; 2046 : if (_Off < this->_Mysize)
  10150. ; 2047 : { // room for match, look for it
  10151. ; 2048 : const _Elem *const _Vptr = this->_Myptr() + this->_Mysize;
  10152. ; 2049 : for (const _Elem *_Uptr = this->_Myptr() + _Off;
  10153. ; 2050 : _Uptr < _Vptr; ++_Uptr)
  10154. ; 2051 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  10155. ; 2052 : return (_Uptr - this->_Myptr());
  10156. ; 2053 : }
  10157. ; 2054 : return (npos);
  10158. ; 2055 : }
  10159. ; 2056 :
  10160. ; 2057 : size_type find_first_not_of(const _Elem *_Ptr,
  10161. ; 2058 : size_type _Off = 0) const
  10162. ; 2059 : { // look for one of [_Ptr, <null>) at or after _Off
  10163. ; 2060 : _DEBUG_POINTER(_Ptr);
  10164. ; 2061 : return (find_first_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  10165. ; 2062 : }
  10166. ; 2063 :
  10167. ; 2064 : size_type find_first_not_of(_Elem _Ch,
  10168. ; 2065 : size_type _Off = 0) const
  10169. ; 2066 : { // look for non _Ch at or after _Off
  10170. ; 2067 : return (find_first_not_of((const _Elem *)&_Ch, _Off, 1));
  10171. ; 2068 : }
  10172. ; 2069 :
  10173. ; 2070 : size_type find_last_not_of(const _Myt& _Right,
  10174. ; 2071 : size_type _Off = npos) const _NOEXCEPT
  10175. ; 2072 : { // look for none of _Right before _Off
  10176. ; 2073 : return (find_last_not_of(_Right._Myptr(), _Off, _Right.size()));
  10177. ; 2074 : }
  10178. ; 2075 :
  10179. ; 2076 : size_type find_last_not_of(const _Elem *_Ptr,
  10180. ; 2077 : size_type _Off, size_type _Count) const
  10181. ; 2078 : { // look for none of [_Ptr, _Ptr + _Count) before _Off
  10182. ; 2079 : #if _ITERATOR_DEBUG_LEVEL == 2
  10183. ; 2080 : if (_Count != 0)
  10184. ; 2081 : _DEBUG_POINTER(_Ptr);
  10185. ; 2082 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  10186. ; 2083 :
  10187. ; 2084 : if (0 < this->_Mysize)
  10188. ; 2085 : { // worth searching, do it
  10189. ; 2086 : const _Elem *_Uptr = this->_Myptr()
  10190. ; 2087 : + (_Off < this->_Mysize ? _Off : this->_Mysize - 1);
  10191. ; 2088 : for (; ; --_Uptr)
  10192. ; 2089 : if (_Traits::find(_Ptr, _Count, *_Uptr) == 0)
  10193. ; 2090 : return (_Uptr - this->_Myptr());
  10194. ; 2091 : else if (_Uptr == this->_Myptr())
  10195. ; 2092 : break;
  10196. ; 2093 : }
  10197. ; 2094 : return (npos);
  10198. ; 2095 : }
  10199. ; 2096 :
  10200. ; 2097 : size_type find_last_not_of(const _Elem *_Ptr,
  10201. ; 2098 : size_type _Off = npos) const
  10202. ; 2099 : { // look for none of [_Ptr, <null>) before _Off
  10203. ; 2100 : _DEBUG_POINTER(_Ptr);
  10204. ; 2101 : return (find_last_not_of(_Ptr, _Off, _Traits::length(_Ptr)));
  10205. ; 2102 : }
  10206. ; 2103 :
  10207. ; 2104 : size_type find_last_not_of(_Elem _Ch,
  10208. ; 2105 : size_type _Off = npos) const
  10209. ; 2106 : { // look for non _Ch before _Off
  10210. ; 2107 : return (find_last_not_of((const _Elem *)&_Ch, _Off, 1));
  10211. ; 2108 : }
  10212. ; 2109 :
  10213. ; 2110 : _Myt substr(size_type _Off = 0, size_type _Count = npos) const
  10214. ; 2111 : { // return [_Off, _Off + _Count) as new string
  10215. ; 2112 : return (_Myt(*this, _Off, _Count, get_allocator()));
  10216. ; 2113 : }
  10217. ; 2114 :
  10218. ; 2115 : int compare(const _Myt& _Right) const _NOEXCEPT
  10219. ; 2116 : { // compare [0, _Mysize) with _Right
  10220. ; 2117 : return (compare(0, this->_Mysize, _Right._Myptr(), _Right.size()));
  10221. ; 2118 : }
  10222. ; 2119 :
  10223. ; 2120 : int compare(size_type _Off, size_type _N0,
  10224. ; 2121 : const _Myt& _Right) const
  10225. ; 2122 : { // compare [_Off, _Off + _N0) with _Right
  10226. ; 2123 : return (compare(_Off, _N0, _Right, 0, npos));
  10227. ; 2124 : }
  10228. ; 2125 :
  10229. ; 2126 : int compare(size_type _Off,
  10230. ; 2127 : size_type _N0, const _Myt& _Right,
  10231. ; 2128 : size_type _Roff, size_type _Count) const
  10232. ; 2129 : { // compare [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  10233. ; 2130 : if (_Right.size() < _Roff)
  10234. ; 2131 : _Xran(); // _Off off end
  10235. ; 2132 : if (_Right._Mysize - _Roff < _Count)
  10236. ; 2133 : _Count = _Right._Mysize - _Roff; // trim _Count to size
  10237. ; 2134 : return (compare(_Off, _N0, _Right._Myptr() + _Roff, _Count));
  10238. ; 2135 : }
  10239. ; 2136 :
  10240. ; 2137 : int compare(const _Elem *_Ptr) const
  10241. ; 2138 : { // compare [0, _Mysize) with [_Ptr, <null>)
  10242. ; 2139 : _DEBUG_POINTER(_Ptr);
  10243. ; 2140 : return (compare(0, this->_Mysize, _Ptr, _Traits::length(_Ptr)));
  10244. ; 2141 : }
  10245. ; 2142 :
  10246. ; 2143 : int compare(size_type _Off, size_type _N0, const _Elem *_Ptr) const
  10247. ; 2144 : { // compare [_Off, _Off + _N0) with [_Ptr, <null>)
  10248. ; 2145 : _DEBUG_POINTER(_Ptr);
  10249. ; 2146 : return (compare(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  10250. ; 2147 : }
  10251. ; 2148 :
  10252. ; 2149 : int compare(size_type _Off,
  10253. ; 2150 : size_type _N0, const _Elem *_Ptr, size_type _Count) const
  10254. ; 2151 : { // compare [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  10255. ; 2152 : #if _ITERATOR_DEBUG_LEVEL == 2
  10256. ; 2153 : if (_Count != 0)
  10257. ; 2154 : _DEBUG_POINTER(_Ptr);
  10258. ; 2155 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  10259. ; 2156 :
  10260. ; 2157 : if (this->_Mysize < _Off)
  10261. ; 2158 : _Xran(); // _Off off end
  10262. ; 2159 : if (this->_Mysize - _Off < _N0)
  10263. ; 2160 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  10264. ; 2161 :
  10265. ; 2162 : size_type _Ans = _Traits::compare(this->_Myptr() + _Off, _Ptr,
  10266. ; 2163 : _N0 < _Count ? _N0 : _Count);
  10267. ; 2164 : return (_Ans != 0 ? (int)_Ans : _N0 < _Count ? -1
  10268. ; 2165 : : _N0 == _Count ? 0 : +1);
  10269. ; 2166 : }
  10270. ; 2167 :
  10271. ; 2168 : allocator_type get_allocator() const _NOEXCEPT
  10272. ; 2169 : { // return allocator object for values
  10273. ; 2170 : return (this->_Getal());
  10274. ; 2171 : }
  10275. ; 2172 :
  10276. ; 2173 : void _Chassign(size_type _Off, size_type _Count, _Elem _Ch)
  10277. ; 2174 : { // assign _Count copies of _Ch beginning at _Off
  10278. ; 2175 : if (_Count == 1)
  10279. ; 2176 : _Traits::assign(*(this->_Myptr() + _Off), _Ch);
  10280. ; 2177 : else
  10281. ; 2178 : _Traits::assign(this->_Myptr() + _Off, _Count, _Ch);
  10282. ; 2179 : }
  10283. ; 2180 :
  10284. ; 2181 : void _Copy(size_type _Newsize, size_type _Oldlen)
  10285. ; 2182 : { // copy _Oldlen elements to newly allocated buffer
  10286. ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
  10287. ; 2184 : if (max_size() < _Newres)
  10288. ; 2185 : _Newres = _Newsize; // undo roundup if too big
  10289. ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
  10290. ; 2187 : ;
  10291. ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
  10292. ; 2189 : _Newres = this->_Myres
  10293. ; 2190 : + this->_Myres / 2; // grow exponentially if possible
  10294. ; 2191 : else
  10295. ; 2192 : _Newres = max_size(); // settle for max_size()
  10296. ; 2193 :
  10297. ; 2194 : _Elem *_Ptr;
  10298. ; 2195 : _TRY_BEGIN
  10299. ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
  10300. ; 2197 : _CATCH_ALL
  10301. ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
  10302. ; 2199 : _TRY_BEGIN
  10303. ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
  10304. ; 2201 : _CATCH_ALL
  10305. ; 2202 : _Tidy(true); // failed again, discard storage and reraise
  10306. ; 2203 : _RERAISE;
  10307. ; 2204 : _CATCH_END
  10308. ; 2205 : _CATCH_END
  10309. ; 2206 :
  10310. ; 2207 : if (0 < _Oldlen)
  10311. ; 2208 : _Traits::copy(_Ptr, this->_Myptr(),
  10312. ; 2209 : _Oldlen); // copy existing elements
  10313. ; 2210 : _Tidy(true);
  10314. ; 2211 : this->_Getal().construct(&this->_Bx._Ptr, _Ptr);
  10315. ; 2212 : this->_Myres = _Newres;
  10316. ; 2213 : _Eos(_Oldlen);
  10317. ; 2214 : }
  10318. ; 2215 :
  10319. ; 2216 : void _Eos(size_type _Newsize)
  10320. ; 2217 : { // set new length and null terminator
  10321. ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
  10322.  
  10323. mov DWORD PTR [esi+16], edi
  10324.  
  10325. ; 517 : : this->_Bx._Buf);
  10326.  
  10327. jb SHORT $LN34@erase
  10328. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  10329.  
  10330. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  10331.  
  10332. mov eax, DWORD PTR [esi]
  10333. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  10334.  
  10335. ; 564 : _Left = _Right;
  10336.  
  10337. mov BYTE PTR [eax+edi], 0
  10338. pop edi
  10339. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10340.  
  10341. ; 1329 : return (*this);
  10342.  
  10343. mov eax, esi
  10344. pop esi
  10345.  
  10346. ; 1330 : }
  10347.  
  10348. pop ebp
  10349. ret 8
  10350. $LN34@erase:
  10351.  
  10352. ; 517 : : this->_Bx._Buf);
  10353.  
  10354. mov eax, esi
  10355. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  10356.  
  10357. ; 564 : _Left = _Right;
  10358.  
  10359. mov BYTE PTR [eax+edi], 0
  10360. $LN40@erase:
  10361. pop edi
  10362. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10363.  
  10364. ; 1329 : return (*this);
  10365.  
  10366. mov eax, esi
  10367. pop esi
  10368.  
  10369. ; 1330 : }
  10370.  
  10371. pop ebp
  10372. ret 8
  10373. ?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
  10374. _TEXT ENDS
  10375. ; Function compile flags: /Ogtp
  10376. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10377. ; COMDAT ?max_size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ
  10378. _TEXT SEGMENT
  10379. ?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
  10380. ; _this$dead$ = ecx
  10381.  
  10382. ; 1738 : size_type _Num = this->_Getal().max_size();
  10383. ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
  10384.  
  10385. mov eax, -2 ; fffffffeH
  10386.  
  10387. ; 1740 : }
  10388.  
  10389. ret 0
  10390. ?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
  10391. _TEXT ENDS
  10392. ; Function compile flags: /Ogtp
  10393. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10394. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  10395. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10396. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  10397. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10398. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  10399. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10400. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  10401. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10402. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  10403. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10404. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  10405. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10406. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  10407. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  10408. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  10409. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10410. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  10411. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  10412. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  10413. ; COMDAT ?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z
  10414. _TEXT SEGMENT
  10415. _this$ = -24 ; size = 4
  10416. __Ptr$1$ = -20 ; size = 4
  10417. __Ptr$ = -20 ; size = 4
  10418. __$EHRec$ = -16 ; size = 16
  10419. __Newres$ = 8 ; size = 4
  10420. __Newsize$ = 8 ; size = 4
  10421. __Oldlen$ = 12 ; size = 4
  10422. ?_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
  10423. ; _this$ = ecx
  10424.  
  10425. ; 2182 : { // copy _Oldlen elements to newly allocated buffer
  10426.  
  10427. push ebp
  10428. mov ebp, esp
  10429. push -1
  10430. push __ehhandler$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z
  10431. mov eax, DWORD PTR fs:0
  10432. push eax
  10433. sub esp, 12 ; 0000000cH
  10434. push ebx
  10435. push esi
  10436. push edi
  10437. mov eax, DWORD PTR ___security_cookie
  10438. xor eax, ebp
  10439. push eax
  10440. lea eax, DWORD PTR __$EHRec$[ebp+4]
  10441. mov DWORD PTR fs:0, eax
  10442. mov DWORD PTR __$EHRec$[ebp], esp
  10443. mov esi, ecx
  10444. mov DWORD PTR _this$[ebp], esi
  10445.  
  10446. ; 2183 : size_type _Newres = _Newsize | this->_ALLOC_MASK;
  10447.  
  10448. mov eax, DWORD PTR __Newsize$[ebp]
  10449. mov edi, eax
  10450. or edi, 15 ; 0000000fH
  10451.  
  10452. ; 2184 : if (max_size() < _Newres)
  10453.  
  10454. cmp edi, -2 ; fffffffeH
  10455. jbe SHORT $LN9@Copy
  10456.  
  10457. ; 2185 : _Newres = _Newsize; // undo roundup if too big
  10458.  
  10459. mov edi, eax
  10460. jmp SHORT $LN47@Copy
  10461. $LN9@Copy:
  10462.  
  10463. ; 2186 : else if (this->_Myres / 2 <= _Newres / 3)
  10464.  
  10465. mov ebx, DWORD PTR [esi+20]
  10466. mov eax, -1431655765 ; aaaaaaabH
  10467. mul edi
  10468. mov ecx, ebx
  10469. shr ecx, 1
  10470. shr edx, 1
  10471. cmp ecx, edx
  10472. jbe SHORT $LN47@Copy
  10473.  
  10474. ; 2187 : ;
  10475. ; 2188 : else if (this->_Myres <= max_size() - this->_Myres / 2)
  10476.  
  10477. mov eax, -2 ; fffffffeH
  10478. sub eax, ecx
  10479.  
  10480. ; 2189 : _Newres = this->_Myres
  10481. ; 2190 : + this->_Myres / 2; // grow exponentially if possible
  10482.  
  10483. lea edi, DWORD PTR [ecx+ebx]
  10484. cmp ebx, eax
  10485. jbe SHORT $LN47@Copy
  10486.  
  10487. ; 518 : }
  10488. ; 519 :
  10489. ; 520 : const value_type *_Myptr() const
  10490. ; 521 : { // determine current pointer to buffer for nonmutable string
  10491. ; 522 : return (this->_BUF_SIZE <= this->_Myres
  10492. ; 523 : ? _STD addressof(*this->_Bx._Ptr)
  10493. ; 524 : : this->_Bx._Buf);
  10494. ; 525 : }
  10495. ; 526 :
  10496. ; 527 : union _Bxty
  10497. ; 528 : { // storage for small buffer or pointer to larger one
  10498. ; 529 : value_type _Buf[_BUF_SIZE];
  10499. ; 530 : pointer _Ptr;
  10500. ; 531 : char _Alias[_BUF_SIZE]; // to permit aliasing
  10501. ; 532 : } _Bx;
  10502. ; 533 :
  10503. ; 534 : size_type _Mysize; // current length of string
  10504. ; 535 : size_type _Myres; // current storage reserved for string
  10505. ; 536 : };
  10506. ; 537 :
  10507. ; 538 : // TEMPLATE CLASS _String_alloc
  10508. ; 539 : template<bool _Al_has_storage,
  10509. ; 540 : class _Alloc_types>
  10510. ; 541 : class _String_alloc
  10511. ; 542 : : public _String_val<typename _Alloc_types::_Val_types>
  10512. ; 543 : { // base class for basic_string to hold allocator with storage
  10513. ; 544 : public:
  10514. ; 545 : typedef _String_alloc<_Al_has_storage, _Alloc_types> _Myt;
  10515. ; 546 : typedef typename _Alloc_types::_Alloc _Alloc;
  10516. ; 547 :
  10517. ; 548 : typedef typename _Alloc_types::_Alty _Alty;
  10518. ; 549 :
  10519. ; 550 : #if _ITERATOR_DEBUG_LEVEL == 0
  10520. ; 551 : _String_alloc(const _Alloc& _Al = _Alloc())
  10521. ; 552 : : _Alval(_Al)
  10522. ; 553 : { // construct allocator from _Al
  10523. ; 554 : }
  10524. ; 555 :
  10525. ; 556 : void _Change_alloc(const _Alty& _Al)
  10526. ; 557 : { // replace old allocator
  10527. ; 558 : _Alval = _Al;
  10528. ; 559 : }
  10529. ; 560 :
  10530. ; 561 : void _Swap_alloc(_Myt& _Right)
  10531. ; 562 : { // swap allocators
  10532. ; 563 : _Swap_adl(this->_Alval, _Right._Alval);
  10533. ; 564 : }
  10534. ; 565 :
  10535. ; 566 : #else /* _ITERATOR_DEBUG_LEVEL == 0 */
  10536. ; 567 : _String_alloc(const _Alloc& _Al = _Alloc())
  10537. ; 568 : : _Alval(_Al)
  10538. ; 569 : { // construct allocator from _Al
  10539. ; 570 : _Alloc_proxy();
  10540. ; 571 : }
  10541. ; 572 :
  10542. ; 573 : ~_String_alloc() _NOEXCEPT
  10543. ; 574 : { // destroy the object
  10544. ; 575 : _Free_proxy();
  10545. ; 576 : }
  10546. ; 577 :
  10547. ; 578 : void _Change_alloc(const _Alty& _Al)
  10548. ; 579 : { // replace old allocator
  10549. ; 580 : _Free_proxy();
  10550. ; 581 : _Alval = _Al;
  10551. ; 582 : _Alloc_proxy();
  10552. ; 583 : }
  10553. ; 584 :
  10554. ; 585 : void _Swap_alloc(_Myt& _Right)
  10555. ; 586 : { // swap allocators
  10556. ; 587 : _Swap_adl(_Alval, _Right._Alval);
  10557. ; 588 : _Swap_adl(this->_Myproxy, _Right._Myproxy);
  10558. ; 589 : }
  10559. ; 590 :
  10560. ; 591 : void _Alloc_proxy()
  10561. ; 592 : { // construct proxy from _Alval
  10562. ; 593 : typename _Alloc::template rebind<_Container_proxy>::other
  10563. ; 594 : _Alproxy(_Alval);
  10564. ; 595 : this->_Myproxy = _Alproxy.allocate(1);
  10565. ; 596 : _Alproxy.construct(this->_Myproxy, _Container_proxy());
  10566. ; 597 : this->_Myproxy->_Mycont = this;
  10567. ; 598 : }
  10568. ; 599 :
  10569. ; 600 : void _Free_proxy()
  10570. ; 601 : { // destroy proxy
  10571. ; 602 : typename _Alloc::template rebind<_Container_proxy>::other
  10572. ; 603 : _Alproxy(_Alval);
  10573. ; 604 : this->_Orphan_all();
  10574. ; 605 : _Alproxy.destroy(this->_Myproxy);
  10575. ; 606 : _Alproxy.deallocate(this->_Myproxy, 1);
  10576. ; 607 : this->_Myproxy = 0;
  10577. ; 608 : }
  10578. ; 609 : #endif /* _ITERATOR_DEBUG_LEVEL == 0 */
  10579. ; 610 :
  10580. ; 611 : _Alty& _Getal()
  10581. ; 612 : { // get reference to allocator
  10582. ; 613 : return (_Alval);
  10583. ; 614 : }
  10584. ; 615 :
  10585. ; 616 : const _Alty& _Getal() const
  10586. ; 617 : { // get reference to allocator
  10587. ; 618 : return (_Alval);
  10588. ; 619 : }
  10589. ; 620 :
  10590. ; 621 : _Alty _Alval; // allocator object for strings
  10591. ; 622 : };
  10592. ; 623 :
  10593. ; 624 : template<class _Alloc_types>
  10594. ; 625 : class _String_alloc<false, _Alloc_types>
  10595. ; 626 : : public _String_val<typename _Alloc_types::_Val_types>
  10596. ; 627 : { // base class for basic_string to hold allocator with no storage
  10597. ; 628 : public:
  10598. ; 629 : typedef _String_alloc<false, _Alloc_types> _Myt;
  10599. ; 630 : typedef typename _Alloc_types::_Alloc _Alloc;
  10600. ; 631 :
  10601. ; 632 : typedef typename _Alloc_types::_Alty _Alty;
  10602. ; 633 :
  10603. ; 634 : #if _ITERATOR_DEBUG_LEVEL == 0
  10604. ; 635 : _String_alloc(const _Alloc& = _Alloc())
  10605. ; 636 : { // construct allocator from _Al
  10606. ; 637 : }
  10607. ; 638 :
  10608. ; 639 : void _Change_alloc(const _Alty&)
  10609. ; 640 : { // replace old allocator
  10610. ; 641 : }
  10611. ; 642 :
  10612. ; 643 : void _Swap_alloc(_Myt&)
  10613. ; 644 : { // swap allocators
  10614. ; 645 : }
  10615. ; 646 :
  10616. ; 647 : #else /* _ITERATOR_DEBUG_LEVEL == 0 */
  10617. ; 648 : _String_alloc(const _Alloc& = _Alloc())
  10618. ; 649 : { // construct allocator from _Al
  10619. ; 650 : _Alloc_proxy();
  10620. ; 651 : }
  10621. ; 652 :
  10622. ; 653 : ~_String_alloc() _NOEXCEPT
  10623. ; 654 : { // destroy the object
  10624. ; 655 : _Free_proxy();
  10625. ; 656 : }
  10626. ; 657 :
  10627. ; 658 : void _Change_alloc(const _Alty&)
  10628. ; 659 : { // replace old allocator
  10629. ; 660 : }
  10630. ; 661 :
  10631. ; 662 : void _Swap_alloc(_Myt& _Right)
  10632. ; 663 : { // swap allocators
  10633. ; 664 : _Swap_adl(this->_Myproxy, _Right._Myproxy);
  10634. ; 665 : }
  10635. ; 666 :
  10636. ; 667 : void _Alloc_proxy()
  10637. ; 668 : { // construct proxy from _Alval
  10638. ; 669 : typename _Alloc::template rebind<_Container_proxy>::other
  10639. ; 670 : _Alproxy;
  10640. ; 671 : this->_Myproxy = _Alproxy.allocate(1);
  10641. ; 672 : _Alproxy.construct(this->_Myproxy, _Container_proxy());
  10642. ; 673 : this->_Myproxy->_Mycont = this;
  10643. ; 674 : }
  10644. ; 675 :
  10645. ; 676 : void _Free_proxy()
  10646. ; 677 : { // destroy proxy
  10647. ; 678 : typename _Alloc::template rebind<_Container_proxy>::other
  10648. ; 679 : _Alproxy;
  10649. ; 680 : this->_Orphan_all();
  10650. ; 681 : _Alproxy.destroy(this->_Myproxy);
  10651. ; 682 : _Alproxy.deallocate(this->_Myproxy, 1);
  10652. ; 683 : this->_Myproxy = 0;
  10653. ; 684 : }
  10654. ; 685 : #endif /* _ITERATOR_DEBUG_LEVEL == 0 */
  10655. ; 686 :
  10656. ; 687 : _Alty _Getal() const
  10657. ; 688 : { // get reference to allocator
  10658. ; 689 : return (_Alty());
  10659. ; 690 : }
  10660. ; 691 : };
  10661. ; 692 :
  10662. ; 693 : // TEMPLATE CLASS basic_string
  10663. ; 694 : template<class _Elem,
  10664. ; 695 : class _Traits,
  10665. ; 696 : class _Alloc>
  10666. ; 697 : class basic_string
  10667. ; 698 : : public _String_alloc<!is_empty<_Alloc>::value,
  10668. ; 699 : _String_base_types<_Elem, _Alloc> >
  10669. ; 700 : { // null-terminated transparent array of elements
  10670. ; 701 : public:
  10671. ; 702 : typedef basic_string<_Elem, _Traits, _Alloc> _Myt;
  10672. ; 703 : typedef _String_alloc<!is_empty<_Alloc>::value,
  10673. ; 704 : _String_base_types<_Elem, _Alloc> > _Mybase;
  10674. ; 705 : typedef _Traits traits_type;
  10675. ; 706 : typedef _Alloc allocator_type;
  10676. ; 707 :
  10677. ; 708 : typedef typename _Mybase::_Alty _Alty;
  10678. ; 709 :
  10679. ; 710 : typedef typename _Mybase::value_type value_type;
  10680. ; 711 : typedef typename _Mybase::size_type size_type;
  10681. ; 712 : typedef typename _Mybase::difference_type difference_type;
  10682. ; 713 : typedef typename _Mybase::pointer pointer;
  10683. ; 714 : typedef typename _Mybase::const_pointer const_pointer;
  10684. ; 715 : typedef typename _Mybase::reference reference;
  10685. ; 716 : typedef typename _Mybase::const_reference const_reference;
  10686. ; 717 :
  10687. ; 718 : typedef typename _Mybase::iterator iterator;
  10688. ; 719 : typedef typename _Mybase::const_iterator const_iterator;
  10689. ; 720 :
  10690. ; 721 : typedef _STD reverse_iterator<iterator> reverse_iterator;
  10691. ; 722 : typedef _STD reverse_iterator<const_iterator> const_reverse_iterator;
  10692. ; 723 :
  10693. ; 724 : basic_string(const _Myt& _Right)
  10694. ; 725 :
  10695. ; 726 : #if _HAS_CPP0X
  10696. ; 727 : : _Mybase(_Right._Getal().select_on_container_copy_construction())
  10697. ; 728 :
  10698. ; 729 : #else /* _HAS_CPP0X */
  10699. ; 730 : : _Mybase(_Right._Getal())
  10700. ; 731 : #endif /* _HAS_CPP0X */
  10701. ; 732 :
  10702. ; 733 : { // construct by copying _Right
  10703. ; 734 : _Tidy();
  10704. ; 735 : assign(_Right, 0, npos);
  10705. ; 736 : }
  10706. ; 737 :
  10707. ; 738 : #if _HAS_CPP0X
  10708. ; 739 : basic_string(const _Myt& _Right, const _Alloc& _Al)
  10709. ; 740 : : _Mybase(_Al)
  10710. ; 741 : { // construct by copying with allocator
  10711. ; 742 : _Tidy();
  10712. ; 743 : assign(_Right, 0, npos);
  10713. ; 744 : }
  10714. ; 745 : #endif /* _HAS_CPP0X */
  10715. ; 746 :
  10716. ; 747 : basic_string()
  10717. ; 748 : : _Mybase()
  10718. ; 749 : { // construct empty string
  10719. ; 750 : _Tidy();
  10720. ; 751 : }
  10721. ; 752 :
  10722. ; 753 : explicit basic_string(const _Alloc& _Al)
  10723. ; 754 : : _Mybase(_Al)
  10724. ; 755 : { // construct empty string with allocator
  10725. ; 756 : _Tidy();
  10726. ; 757 : }
  10727. ; 758 :
  10728. ; 759 : basic_string(const _Myt& _Right, size_type _Roff,
  10729. ; 760 : size_type _Count = npos)
  10730. ; 761 : : _Mybase(_Right._Getal())
  10731. ; 762 : { // construct from _Right [_Roff, _Roff + _Count)
  10732. ; 763 : _Tidy();
  10733. ; 764 : assign(_Right, _Roff, _Count);
  10734. ; 765 : }
  10735. ; 766 :
  10736. ; 767 : basic_string(const _Myt& _Right, size_type _Roff, size_type _Count,
  10737. ; 768 : const _Alloc& _Al)
  10738. ; 769 : : _Mybase(_Al)
  10739. ; 770 : { // construct from _Right [_Roff, _Roff + _Count) with allocator
  10740. ; 771 : _Tidy();
  10741. ; 772 : assign(_Right, _Roff, _Count);
  10742. ; 773 : }
  10743. ; 774 :
  10744. ; 775 : basic_string(const _Elem *_Ptr, size_type _Count)
  10745. ; 776 : : _Mybase()
  10746. ; 777 : { // construct from [_Ptr, _Ptr + _Count)
  10747. ; 778 : _Tidy();
  10748. ; 779 : assign(_Ptr, _Count);
  10749. ; 780 : }
  10750. ; 781 :
  10751. ; 782 : basic_string(const _Elem *_Ptr, size_type _Count, const _Alloc& _Al)
  10752. ; 783 : : _Mybase(_Al)
  10753. ; 784 : { // construct from [_Ptr, _Ptr + _Count) with allocator
  10754. ; 785 : _Tidy();
  10755. ; 786 : assign(_Ptr, _Count);
  10756. ; 787 : }
  10757. ; 788 :
  10758. ; 789 : basic_string(const _Elem *_Ptr)
  10759. ; 790 : : _Mybase()
  10760. ; 791 : { // construct from [_Ptr, <null>)
  10761. ; 792 : _Tidy();
  10762. ; 793 : assign(_Ptr);
  10763. ; 794 : }
  10764. ; 795 :
  10765. ; 796 : basic_string(const _Elem *_Ptr, const _Alloc& _Al)
  10766. ; 797 : : _Mybase(_Al)
  10767. ; 798 : { // construct from [_Ptr, <null>) with allocator
  10768. ; 799 : _Tidy();
  10769. ; 800 : assign(_Ptr);
  10770. ; 801 : }
  10771. ; 802 :
  10772. ; 803 : basic_string(size_type _Count, _Elem _Ch)
  10773. ; 804 : : _Mybase()
  10774. ; 805 : { // construct from _Count * _Ch
  10775. ; 806 : _Tidy();
  10776. ; 807 : assign(_Count, _Ch);
  10777. ; 808 : }
  10778. ; 809 :
  10779. ; 810 : basic_string(size_type _Count, _Elem _Ch, const _Alloc& _Al)
  10780. ; 811 : : _Mybase(_Al)
  10781. ; 812 : { // construct from _Count * _Ch with allocator
  10782. ; 813 : _Tidy();
  10783. ; 814 : assign(_Count, _Ch);
  10784. ; 815 : }
  10785. ; 816 :
  10786. ; 817 : template<class _Iter>
  10787. ; 818 : basic_string(_Iter _First, _Iter _Last,
  10788. ; 819 : typename enable_if<_Is_iterator<_Iter>::value,
  10789. ; 820 : void>::type ** = 0)
  10790. ; 821 : : _Mybase()
  10791. ; 822 : { // construct from [_First, _Last)
  10792. ; 823 : _Tidy();
  10793. ; 824 : _Construct(_First, _Last, _Iter_cat(_First));
  10794. ; 825 : }
  10795. ; 826 :
  10796. ; 827 : template<class _Iter>
  10797. ; 828 : basic_string(_Iter _First, _Iter _Last, const _Alloc& _Al,
  10798. ; 829 : typename enable_if<_Is_iterator<_Iter>::value,
  10799. ; 830 : void>::type ** = 0)
  10800. ; 831 : : _Mybase(_Al)
  10801. ; 832 : { // construct from [_First, _Last) with allocator
  10802. ; 833 : _Tidy();
  10803. ; 834 : _Construct(_First, _Last, _Iter_cat(_First));
  10804. ; 835 : }
  10805. ; 836 :
  10806. ; 837 : template<class _Iter>
  10807. ; 838 : void _Construct(_Iter _First,
  10808. ; 839 : _Iter _Last, input_iterator_tag)
  10809. ; 840 : { // initialize from [_First, _Last), input iterators
  10810. ; 841 : _TRY_BEGIN
  10811. ; 842 : for (; _First != _Last; ++_First)
  10812. ; 843 : append((size_type)1, (_Elem)*_First);
  10813. ; 844 : _CATCH_ALL
  10814. ; 845 : _Tidy(true);
  10815. ; 846 : _RERAISE;
  10816. ; 847 : _CATCH_END
  10817. ; 848 : }
  10818. ; 849 :
  10819. ; 850 : template<class _Iter>
  10820. ; 851 : void _Construct(_Iter _First,
  10821. ; 852 : _Iter _Last, forward_iterator_tag)
  10822. ; 853 : { // initialize from [_First, _Last), forward iterators
  10823. ; 854 : _DEBUG_RANGE(_First, _Last);
  10824. ; 855 : size_type _Count = 0;
  10825. ; 856 : _Distance(_First, _Last, _Count);
  10826. ; 857 : reserve(_Count);
  10827. ; 858 :
  10828. ; 859 : _TRY_BEGIN
  10829. ; 860 : for (; _First != _Last; ++_First)
  10830. ; 861 : append((size_type)1, (_Elem)*_First);
  10831. ; 862 : _CATCH_ALL
  10832. ; 863 : _Tidy(true);
  10833. ; 864 : _RERAISE;
  10834. ; 865 : _CATCH_END
  10835. ; 866 : }
  10836. ; 867 :
  10837. ; 868 : basic_string(const_pointer _First, const_pointer _Last)
  10838. ; 869 : : _Mybase()
  10839. ; 870 : { // construct from [_First, _Last), const pointers
  10840. ; 871 : _DEBUG_RANGE(_First, _Last);
  10841. ; 872 : _Tidy();
  10842. ; 873 : if (_First != _Last)
  10843. ; 874 : assign(&*_First, _Last - _First);
  10844. ; 875 : }
  10845. ; 876 :
  10846. ; 877 : basic_string(const_pointer _First, const_pointer _Last,
  10847. ; 878 : const _Alloc& _Al)
  10848. ; 879 : : _Mybase(_Al)
  10849. ; 880 : { // construct from [_First, _Last), const pointers
  10850. ; 881 : _DEBUG_RANGE(_First, _Last);
  10851. ; 882 : _Tidy();
  10852. ; 883 : if (_First != _Last)
  10853. ; 884 : assign(&*_First, _Last - _First);
  10854. ; 885 : }
  10855. ; 886 :
  10856. ; 887 : basic_string(const_iterator _First, const_iterator _Last)
  10857. ; 888 : : _Mybase()
  10858. ; 889 : { // construct from [_First, _Last), const_iterators
  10859. ; 890 : _DEBUG_RANGE(_First, _Last);
  10860. ; 891 : _Tidy();
  10861. ; 892 : if (_First != _Last)
  10862. ; 893 : assign(&*_First, _Last - _First);
  10863. ; 894 : }
  10864. ; 895 :
  10865. ; 896 : basic_string(_Myt&& _Right) _NOEXCEPT
  10866. ; 897 : : _Mybase(_Right._Getal())
  10867. ; 898 : { // construct by moving _Right
  10868. ; 899 : _Tidy();
  10869. ; 900 : _Assign_rv(_STD forward<_Myt>(_Right));
  10870. ; 901 : }
  10871. ; 902 :
  10872. ; 903 : basic_string(_Myt&& _Right, const _Alloc& _Al)
  10873. ; 904 : : _Mybase(_Al)
  10874. ; 905 : { // construct by moving _Right, allocator
  10875. ; 906 : if (this->_Getal() != _Right._Getal())
  10876. ; 907 : assign(_Right.begin(), _Right.end());
  10877. ; 908 : else
  10878. ; 909 : _Assign_rv(_STD forward<_Myt>(_Right));
  10879. ; 910 : }
  10880. ; 911 :
  10881. ; 912 : _Myt& operator=(_Myt&& _Right) _NOEXCEPT
  10882. ; 913 : { // assign by moving _Right
  10883. ; 914 : if (this != &_Right)
  10884. ; 915 : { // different, assign it
  10885. ; 916 : _Tidy(true);
  10886. ; 917 :
  10887. ; 918 : #if _HAS_CPP0X
  10888. ; 919 : if (this->_Getal() != _Right._Getal()
  10889. ; 920 : && _Alty::propagate_on_container_move_assignment::value)
  10890. ; 921 : this->_Change_alloc(_Right._Getal());
  10891. ; 922 : #endif /* _HAS_CPP0X */
  10892. ; 923 :
  10893. ; 924 : if (this->_Getal() != _Right._Getal())
  10894. ; 925 : assign(_Right.begin(), _Right.end());
  10895. ; 926 : else
  10896. ; 927 : _Assign_rv(_STD forward<_Myt>(_Right));
  10897. ; 928 : }
  10898. ; 929 : return (*this);
  10899. ; 930 : }
  10900. ; 931 :
  10901. ; 932 : _Myt& assign(_Myt&& _Right) _NOEXCEPT
  10902. ; 933 : { // assign by moving _Right
  10903. ; 934 : if (this == &_Right)
  10904. ; 935 : ;
  10905. ; 936 : else if (get_allocator() != _Right.get_allocator()
  10906. ; 937 : && this->_BUF_SIZE <= _Right._Myres)
  10907. ; 938 : *this = _Right;
  10908. ; 939 : else
  10909. ; 940 : { // not same, clear this and steal from _Right
  10910. ; 941 : _Tidy(true);
  10911. ; 942 : _Assign_rv(_STD forward<_Myt>(_Right));
  10912. ; 943 : }
  10913. ; 944 : return (*this);
  10914. ; 945 : }
  10915. ; 946 :
  10916. ; 947 : void _Assign_rv(_Myt&& _Right)
  10917. ; 948 : { // assign by moving _Right
  10918. ; 949 : if (_Right._Myres < this->_BUF_SIZE)
  10919. ; 950 : _Traits::move(this->_Bx._Buf, _Right._Bx._Buf,
  10920. ; 951 : _Right._Mysize + 1);
  10921. ; 952 : else
  10922. ; 953 : { // copy pointer
  10923. ; 954 : this->_Getal().construct(&this->_Bx._Ptr, _Right._Bx._Ptr);
  10924. ; 955 : _Right._Bx._Ptr = pointer();
  10925. ; 956 : }
  10926. ; 957 : this->_Mysize = _Right._Mysize;
  10927. ; 958 : this->_Myres = _Right._Myres;
  10928. ; 959 : _Right._Tidy();
  10929. ; 960 : }
  10930. ; 961 :
  10931. ; 962 : ~basic_string() _NOEXCEPT
  10932. ; 963 : { // destroy the string
  10933. ; 964 : _Tidy(true);
  10934. ; 965 : }
  10935. ; 966 :
  10936. ; 967 : _PGLOBAL static const size_type npos; // bad/missing length/position
  10937. ; 968 :
  10938. ; 969 : _Myt& operator=(const _Myt& _Right)
  10939. ; 970 : { // assign _Right
  10940. ; 971 : if (this != &_Right)
  10941. ; 972 : { // different, assign it
  10942. ; 973 : #if _HAS_CPP0X
  10943. ; 974 : if (this->_Getal() != _Right._Getal()
  10944. ; 975 : && _Alty::propagate_on_container_copy_assignment::value)
  10945. ; 976 : { // change allocator before copying
  10946. ; 977 : _Tidy(true);
  10947. ; 978 : this->_Change_alloc(_Right._Getal());
  10948. ; 979 : }
  10949. ; 980 : #endif /* _HAS_CPP0X */
  10950. ; 981 :
  10951. ; 982 : assign(_Right);
  10952. ; 983 : }
  10953. ; 984 : return (*this);
  10954. ; 985 : }
  10955. ; 986 :
  10956. ; 987 : _Myt& operator=(const _Elem *_Ptr)
  10957. ; 988 : { // assign [_Ptr, <null>)
  10958. ; 989 : return (assign(_Ptr));
  10959. ; 990 : }
  10960. ; 991 :
  10961. ; 992 : _Myt& operator=(_Elem _Ch)
  10962. ; 993 : { // assign 1 * _Ch
  10963. ; 994 : return (assign(1, _Ch));
  10964. ; 995 : }
  10965. ; 996 :
  10966. ; 997 : _Myt& operator+=(const _Myt& _Right)
  10967. ; 998 : { // append _Right
  10968. ; 999 : return (append(_Right));
  10969. ; 1000 : }
  10970. ; 1001 :
  10971. ; 1002 : _Myt& operator+=(const _Elem *_Ptr)
  10972. ; 1003 : { // append [_Ptr, <null>)
  10973. ; 1004 : return (append(_Ptr));
  10974. ; 1005 : }
  10975. ; 1006 :
  10976. ; 1007 : _Myt& operator+=(_Elem _Ch)
  10977. ; 1008 : { // append 1 * _Ch
  10978. ; 1009 : return (append((size_type)1, _Ch));
  10979. ; 1010 : }
  10980. ; 1011 :
  10981. ; 1012 : _Myt& append(const _Myt& _Right)
  10982. ; 1013 : { // append _Right
  10983. ; 1014 : return (append(_Right, 0, npos));
  10984. ; 1015 : }
  10985. ; 1016 :
  10986. ; 1017 : _Myt& append(const _Myt& _Right,
  10987. ; 1018 : size_type _Roff, size_type _Count)
  10988. ; 1019 : { // append _Right [_Roff, _Roff + _Count)
  10989. ; 1020 : if (_Right.size() < _Roff)
  10990. ; 1021 : _Xran(); // _Roff off end
  10991. ; 1022 : size_type _Num = _Right.size() - _Roff;
  10992. ; 1023 : if (_Num < _Count)
  10993. ; 1024 : _Count = _Num; // trim _Count to size
  10994. ; 1025 : if (npos - this->_Mysize <= _Count)
  10995. ; 1026 : _Xlen(); // result too long
  10996. ; 1027 :
  10997. ; 1028 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  10998. ; 1029 : { // make room and append new stuff
  10999. ; 1030 : _Traits::copy(this->_Myptr() + this->_Mysize,
  11000. ; 1031 : _Right._Myptr() + _Roff, _Count);
  11001. ; 1032 : _Eos(_Num);
  11002. ; 1033 : }
  11003. ; 1034 : return (*this);
  11004. ; 1035 : }
  11005. ; 1036 :
  11006. ; 1037 : _Myt& append(const _Elem *_Ptr, size_type _Count)
  11007. ; 1038 : { // append [_Ptr, _Ptr + _Count)
  11008. ; 1039 : #if _ITERATOR_DEBUG_LEVEL == 2
  11009. ; 1040 : if (_Count != 0)
  11010. ; 1041 : _DEBUG_POINTER(_Ptr);
  11011. ; 1042 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  11012. ; 1043 :
  11013. ; 1044 : if (_Inside(_Ptr))
  11014. ; 1045 : return (append(*this,
  11015. ; 1046 : _Ptr - this->_Myptr(), _Count)); // substring
  11016. ; 1047 : if (npos - this->_Mysize <= _Count)
  11017. ; 1048 : _Xlen(); // result too long
  11018. ; 1049 :
  11019. ; 1050 : size_type _Num;
  11020. ; 1051 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  11021. ; 1052 : { // make room and append new stuff
  11022. ; 1053 : _Traits::copy(this->_Myptr() + this->_Mysize, _Ptr, _Count);
  11023. ; 1054 : _Eos(_Num);
  11024. ; 1055 : }
  11025. ; 1056 : return (*this);
  11026. ; 1057 : }
  11027. ; 1058 :
  11028. ; 1059 : _Myt& append(const _Elem *_Ptr)
  11029. ; 1060 : { // append [_Ptr, <null>)
  11030. ; 1061 : _DEBUG_POINTER(_Ptr);
  11031. ; 1062 : return (append(_Ptr, _Traits::length(_Ptr)));
  11032. ; 1063 : }
  11033. ; 1064 :
  11034. ; 1065 : _Myt& append(size_type _Count, _Elem _Ch)
  11035. ; 1066 : { // append _Count * _Ch
  11036. ; 1067 : if (npos - this->_Mysize <= _Count)
  11037. ; 1068 : _Xlen(); // result too long
  11038. ; 1069 :
  11039. ; 1070 : size_type _Num;
  11040. ; 1071 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  11041. ; 1072 : { // make room and append new stuff using assign
  11042. ; 1073 : _Chassign(this->_Mysize, _Count, _Ch);
  11043. ; 1074 : _Eos(_Num);
  11044. ; 1075 : }
  11045. ; 1076 : return (*this);
  11046. ; 1077 : }
  11047. ; 1078 :
  11048. ; 1079 : template<class _Iter>
  11049. ; 1080 : typename enable_if<_Is_iterator<_Iter>::value,
  11050. ; 1081 : _Myt&>::type
  11051. ; 1082 : append(_Iter _First, _Iter _Last)
  11052. ; 1083 : { // append [_First, _Last), input iterators
  11053. ; 1084 : return (replace(end(), end(), _First, _Last));
  11054. ; 1085 : }
  11055. ; 1086 :
  11056. ; 1087 : _Myt& append(const_pointer _First, const_pointer _Last)
  11057. ; 1088 : { // append [_First, _Last), const pointers
  11058. ; 1089 : return (replace(end(), end(), _First, _Last));
  11059. ; 1090 : }
  11060. ; 1091 :
  11061. ; 1092 : _Myt& append(const_iterator _First, const_iterator _Last)
  11062. ; 1093 : { // append [_First, _Last), const_iterators
  11063. ; 1094 : return (replace(end(), end(), _First, _Last));
  11064. ; 1095 : }
  11065. ; 1096 :
  11066. ; 1097 : _Myt& assign(const _Myt& _Right)
  11067. ; 1098 : { // assign _Right
  11068. ; 1099 : return (assign(_Right, 0, npos));
  11069. ; 1100 : }
  11070. ; 1101 :
  11071. ; 1102 : _Myt& assign(const _Myt& _Right,
  11072. ; 1103 : size_type _Roff, size_type _Count)
  11073. ; 1104 : { // assign _Right [_Roff, _Roff + _Count)
  11074. ; 1105 : if (_Right.size() < _Roff)
  11075. ; 1106 : _Xran(); // _Roff off end
  11076. ; 1107 : size_type _Num = _Right.size() - _Roff;
  11077. ; 1108 : if (_Count < _Num)
  11078. ; 1109 : _Num = _Count; // trim _Num to size
  11079. ; 1110 :
  11080. ; 1111 : if (this == &_Right)
  11081. ; 1112 : erase((size_type)(_Roff + _Num)), erase(0, _Roff); // substring
  11082. ; 1113 : else if (_Grow(_Num))
  11083. ; 1114 : { // make room and assign new stuff
  11084. ; 1115 : _Traits::copy(this->_Myptr(),
  11085. ; 1116 : _Right._Myptr() + _Roff, _Num);
  11086. ; 1117 : _Eos(_Num);
  11087. ; 1118 : }
  11088. ; 1119 : return (*this);
  11089. ; 1120 : }
  11090. ; 1121 :
  11091. ; 1122 : _Myt& assign(const _Elem *_Ptr, size_type _Count)
  11092. ; 1123 : { // assign [_Ptr, _Ptr + _Count)
  11093. ; 1124 : #if _ITERATOR_DEBUG_LEVEL == 2
  11094. ; 1125 : if (_Count != 0)
  11095. ; 1126 : _DEBUG_POINTER(_Ptr);
  11096. ; 1127 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  11097. ; 1128 :
  11098. ; 1129 : if (_Inside(_Ptr))
  11099. ; 1130 : return (assign(*this,
  11100. ; 1131 : _Ptr - this->_Myptr(), _Count)); // substring
  11101. ; 1132 :
  11102. ; 1133 : if (_Grow(_Count))
  11103. ; 1134 : { // make room and assign new stuff
  11104. ; 1135 : _Traits::copy(this->_Myptr(), _Ptr, _Count);
  11105. ; 1136 : _Eos(_Count);
  11106. ; 1137 : }
  11107. ; 1138 : return (*this);
  11108. ; 1139 : }
  11109. ; 1140 :
  11110. ; 1141 : _Myt& assign(const _Elem *_Ptr)
  11111. ; 1142 : { // assign [_Ptr, <null>)
  11112. ; 1143 : _DEBUG_POINTER(_Ptr);
  11113. ; 1144 : return (assign(_Ptr, _Traits::length(_Ptr)));
  11114. ; 1145 : }
  11115. ; 1146 :
  11116. ; 1147 : _Myt& assign(size_type _Count, _Elem _Ch)
  11117. ; 1148 : { // assign _Count * _Ch
  11118. ; 1149 : if (_Count == npos)
  11119. ; 1150 : _Xlen(); // result too long
  11120. ; 1151 :
  11121. ; 1152 : if (_Grow(_Count))
  11122. ; 1153 : { // make room and assign new stuff
  11123. ; 1154 : _Chassign(0, _Count, _Ch);
  11124. ; 1155 : _Eos(_Count);
  11125. ; 1156 : }
  11126. ; 1157 : return (*this);
  11127. ; 1158 : }
  11128. ; 1159 :
  11129. ; 1160 : template<class _Iter>
  11130. ; 1161 : typename enable_if<_Is_iterator<_Iter>::value,
  11131. ; 1162 : _Myt&>::type
  11132. ; 1163 : assign(_Iter _First, _Iter _Last)
  11133. ; 1164 : { // assign [First, _Last), input iterators
  11134. ; 1165 : return (replace(begin(), end(), _First, _Last));
  11135. ; 1166 : }
  11136. ; 1167 :
  11137. ; 1168 : _Myt& assign(const_pointer _First, const_pointer _Last)
  11138. ; 1169 : { // assign [First, _Last), const pointers
  11139. ; 1170 : return (replace(begin(), end(), _First, _Last));
  11140. ; 1171 : }
  11141. ; 1172 :
  11142. ; 1173 : _Myt& assign(const_iterator _First, const_iterator _Last)
  11143. ; 1174 : { // assign [First, _Last), const_iterators
  11144. ; 1175 : return (replace(begin(), end(), _First, _Last));
  11145. ; 1176 : }
  11146. ; 1177 :
  11147. ; 1178 : _Myt& insert(size_type _Off, const _Myt& _Right)
  11148. ; 1179 : { // insert _Right at _Off
  11149. ; 1180 : return (insert(_Off, _Right, 0, npos));
  11150. ; 1181 : }
  11151. ; 1182 :
  11152. ; 1183 : _Myt& insert(size_type _Off,
  11153. ; 1184 : const _Myt& _Right, size_type _Roff, size_type _Count)
  11154. ; 1185 : { // insert _Right [_Roff, _Roff + _Count) at _Off
  11155. ; 1186 : if (this->_Mysize < _Off || _Right.size() < _Roff)
  11156. ; 1187 : _Xran(); // _Off or _Roff off end
  11157. ; 1188 : size_type _Num = _Right.size() - _Roff;
  11158. ; 1189 : if (_Num < _Count)
  11159. ; 1190 : _Count = _Num; // trim _Count to size
  11160. ; 1191 : if (npos - this->_Mysize <= _Count)
  11161. ; 1192 : _Xlen(); // result too long
  11162. ; 1193 :
  11163. ; 1194 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  11164. ; 1195 : { // make room and insert new stuff
  11165. ; 1196 : _Traits::move(this->_Myptr() + _Off + _Count,
  11166. ; 1197 : this->_Myptr() + _Off,
  11167. ; 1198 : this->_Mysize - _Off); // empty out hole
  11168. ; 1199 : if (this == &_Right)
  11169. ; 1200 : _Traits::move(this->_Myptr() + _Off,
  11170. ; 1201 : this->_Myptr() + (_Off < _Roff ? _Roff + _Count : _Roff),
  11171. ; 1202 : _Count); // substring
  11172. ; 1203 : else
  11173. ; 1204 : _Traits::copy(this->_Myptr() + _Off,
  11174. ; 1205 : _Right._Myptr() + _Roff, _Count); // fill hole
  11175. ; 1206 : _Eos(_Num);
  11176. ; 1207 : }
  11177. ; 1208 : return (*this);
  11178. ; 1209 : }
  11179. ; 1210 :
  11180. ; 1211 : _Myt& insert(size_type _Off,
  11181. ; 1212 : const _Elem *_Ptr, size_type _Count)
  11182. ; 1213 : { // insert [_Ptr, _Ptr + _Count) at _Off
  11183. ; 1214 : #if _ITERATOR_DEBUG_LEVEL == 2
  11184. ; 1215 : if (_Count != 0)
  11185. ; 1216 : _DEBUG_POINTER(_Ptr);
  11186. ; 1217 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  11187. ; 1218 :
  11188. ; 1219 : if (_Inside(_Ptr))
  11189. ; 1220 : return (insert(_Off, *this,
  11190. ; 1221 : _Ptr - this->_Myptr(), _Count)); // substring
  11191. ; 1222 : if (this->_Mysize < _Off)
  11192. ; 1223 : _Xran(); // _Off off end
  11193. ; 1224 : if (npos - this->_Mysize <= _Count)
  11194. ; 1225 : _Xlen(); // result too long
  11195. ; 1226 : size_type _Num;
  11196. ; 1227 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  11197. ; 1228 : { // make room and insert new stuff
  11198. ; 1229 : _Traits::move(this->_Myptr() + _Off + _Count,
  11199. ; 1230 : this->_Myptr() + _Off,
  11200. ; 1231 : this->_Mysize - _Off); // empty out hole
  11201. ; 1232 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
  11202. ; 1233 : _Eos(_Num);
  11203. ; 1234 : }
  11204. ; 1235 : return (*this);
  11205. ; 1236 : }
  11206. ; 1237 :
  11207. ; 1238 : _Myt& insert(size_type _Off, const _Elem *_Ptr)
  11208. ; 1239 : { // insert [_Ptr, <null>) at _Off
  11209. ; 1240 : _DEBUG_POINTER(_Ptr);
  11210. ; 1241 : return (insert(_Off, _Ptr, _Traits::length(_Ptr)));
  11211. ; 1242 : }
  11212. ; 1243 :
  11213. ; 1244 : _Myt& insert(size_type _Off,
  11214. ; 1245 : size_type _Count, _Elem _Ch)
  11215. ; 1246 : { // insert _Count * _Ch at _Off
  11216. ; 1247 : if (this->_Mysize < _Off)
  11217. ; 1248 : _Xran(); // _Off off end
  11218. ; 1249 : if (npos - this->_Mysize <= _Count)
  11219. ; 1250 : _Xlen(); // result too long
  11220. ; 1251 : size_type _Num;
  11221. ; 1252 : if (0 < _Count && _Grow(_Num = this->_Mysize + _Count))
  11222. ; 1253 : { // make room and insert new stuff
  11223. ; 1254 : _Traits::move(this->_Myptr() + _Off + _Count,
  11224. ; 1255 : this->_Myptr() + _Off,
  11225. ; 1256 : this->_Mysize - _Off); // empty out hole
  11226. ; 1257 : _Chassign(_Off, _Count, _Ch); // fill hole
  11227. ; 1258 : _Eos(_Num);
  11228. ; 1259 : }
  11229. ; 1260 : return (*this);
  11230. ; 1261 : }
  11231. ; 1262 :
  11232. ; 1263 : iterator insert(const_iterator _Where)
  11233. ; 1264 : { // insert <null> at _Where
  11234. ; 1265 : return (insert(_Where, _Elem()));
  11235. ; 1266 : }
  11236. ; 1267 :
  11237. ; 1268 : iterator insert(const_iterator _Where, _Elem _Ch)
  11238. ; 1269 : { // insert _Ch at _Where
  11239. ; 1270 : size_type _Off = _Pdif(_Where, begin());
  11240. ; 1271 : insert(_Off, 1, _Ch);
  11241. ; 1272 : return (begin() + _Off);
  11242. ; 1273 : }
  11243. ; 1274 :
  11244. ; 1275 : iterator insert(const_iterator _Where, size_type _Count, _Elem _Ch)
  11245. ; 1276 : { // insert _Count * _Elem at _Where
  11246. ; 1277 : size_type _Off = _Pdif(_Where, begin());
  11247. ; 1278 : insert(_Off, _Count, _Ch);
  11248. ; 1279 : return (begin() + _Off);
  11249. ; 1280 : }
  11250. ; 1281 :
  11251. ; 1282 : template<class _Iter>
  11252. ; 1283 : typename enable_if<_Is_iterator<_Iter>::value,
  11253. ; 1284 : iterator>::type
  11254. ; 1285 : insert(const_iterator _Where, _Iter _First, _Iter _Last)
  11255. ; 1286 : { // insert [_First, _Last) at _Where, input iterators
  11256. ; 1287 : size_type _Off = _Pdif(_Where, begin());
  11257. ; 1288 : replace(_Where, _Where, _First, _Last);
  11258. ; 1289 : return (begin() + _Off);
  11259. ; 1290 : }
  11260. ; 1291 :
  11261. ; 1292 : iterator insert(const_iterator _Where,
  11262. ; 1293 : const_pointer _First, const_pointer _Last)
  11263. ; 1294 : { // insert [_First, _Last) at _Where, const pointers
  11264. ; 1295 : size_type _Off = _Pdif(_Where, begin());
  11265. ; 1296 : replace(_Where, _Where, _First, _Last);
  11266. ; 1297 : return (begin() + _Off);
  11267. ; 1298 : }
  11268. ; 1299 :
  11269. ; 1300 : iterator insert(const_iterator _Where,
  11270. ; 1301 : const_iterator _First, const_iterator _Last)
  11271. ; 1302 : { // insert [_First, _Last) at _Where, const_iterators
  11272. ; 1303 : size_type _Off = _Pdif(_Where, begin());
  11273. ; 1304 : replace(_Where, _Where, _First, _Last);
  11274. ; 1305 : return (begin() + _Off);
  11275. ; 1306 : }
  11276. ; 1307 :
  11277. ; 1308 : _Myt& erase(size_type _Off = 0)
  11278. ; 1309 : { // erase elements [_Off, ...)
  11279. ; 1310 : if (this->_Mysize < _Off)
  11280. ; 1311 : _Xran(); // _Off off end
  11281. ; 1312 : _Eos(_Off);
  11282. ; 1313 : return (*this);
  11283. ; 1314 : }
  11284. ; 1315 :
  11285. ; 1316 : _Myt& erase(size_type _Off, size_type _Count)
  11286. ; 1317 : { // erase elements [_Off, _Off + _Count)
  11287. ; 1318 : if (this->_Mysize < _Off)
  11288. ; 1319 : _Xran(); // _Off off end
  11289. ; 1320 : if (this->_Mysize - _Off <= _Count)
  11290. ; 1321 : _Eos(_Off); // erase elements [_Off, ...)
  11291. ; 1322 : else if (0 < _Count)
  11292. ; 1323 : { // move elements down
  11293. ; 1324 : value_type *_Ptr = this->_Myptr() + _Off;
  11294. ; 1325 : size_type _Newsize = this->_Mysize - _Count;
  11295. ; 1326 : _Traits::move(_Ptr, _Ptr + _Count, _Newsize - _Off);
  11296. ; 1327 : _Eos(_Newsize);
  11297. ; 1328 : }
  11298. ; 1329 : return (*this);
  11299. ; 1330 : }
  11300. ; 1331 :
  11301. ; 1332 : iterator erase(const_iterator _Where)
  11302. ; 1333 : { // erase element at _Where
  11303. ; 1334 : size_type _Count = _Pdif(_Where, begin());
  11304. ; 1335 : erase(_Count, 1);
  11305. ; 1336 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  11306. ; 1337 : }
  11307. ; 1338 :
  11308. ; 1339 : iterator erase(const_iterator _First, const_iterator _Last)
  11309. ; 1340 : { // erase substring [_First, _Last)
  11310. ; 1341 : _DEBUG_RANGE(_First, _Last);
  11311. ; 1342 : size_type _Count = _Pdif(_First, begin());
  11312. ; 1343 : erase(_Count, _Pdif(_Last, _First));
  11313. ; 1344 : return (_STRING_ITERATOR(this->_Myptr() + _Count));
  11314. ; 1345 : }
  11315. ; 1346 :
  11316. ; 1347 : void clear() _NOEXCEPT
  11317. ; 1348 : { // erase all
  11318. ; 1349 : _Eos(0);
  11319. ; 1350 : }
  11320. ; 1351 :
  11321. ; 1352 : _Myt& replace(size_type _Off, size_type _N0, const _Myt& _Right)
  11322. ; 1353 : { // replace [_Off, _Off + _N0) with _Right
  11323. ; 1354 : return (replace(_Off, _N0, _Right, 0, npos));
  11324. ; 1355 : }
  11325. ; 1356 :
  11326. ; 1357 : _Myt& replace(size_type _Off,
  11327. ; 1358 : size_type _N0, const _Myt& _Right, size_type _Roff, size_type _Count)
  11328. ; 1359 : { // replace [_Off, _Off + _N0) with _Right [_Roff, _Roff + _Count)
  11329. ; 1360 : if (this->_Mysize < _Off || _Right.size() < _Roff)
  11330. ; 1361 : _Xran(); // _Off or _Roff off end
  11331. ; 1362 : if (this->_Mysize - _Off < _N0)
  11332. ; 1363 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  11333. ; 1364 : size_type _Num = _Right.size() - _Roff;
  11334. ; 1365 : if (_Num < _Count)
  11335. ; 1366 : _Count = _Num; // trim _Count to size
  11336. ; 1367 : if (npos - _Count <= this->_Mysize - _N0)
  11337. ; 1368 : _Xlen(); // result too long
  11338. ; 1369 :
  11339. ; 1370 : size_type _Nm = this->_Mysize - _N0 - _Off; // length of kept tail
  11340. ; 1371 : size_type _Newsize = this->_Mysize + _Count - _N0;
  11341. ; 1372 : if (this->_Mysize < _Newsize)
  11342. ; 1373 : _Grow(_Newsize);
  11343. ; 1374 :
  11344. ; 1375 : if (this != &_Right)
  11345. ; 1376 : { // no overlap, just move down and copy in new stuff
  11346. ; 1377 : _Traits::move(this->_Myptr() + _Off + _Count,
  11347. ; 1378 : this->_Myptr() + _Off + _N0, _Nm); // empty hole
  11348. ; 1379 : _Traits::copy(this->_Myptr() + _Off,
  11349. ; 1380 : _Right._Myptr() + _Roff, _Count); // fill hole
  11350. ; 1381 : }
  11351. ; 1382 : else if (_Count <= _N0)
  11352. ; 1383 : { // hole doesn't get larger, just copy in substring
  11353. ; 1384 : _Traits::move(this->_Myptr() + _Off,
  11354. ; 1385 : this->_Myptr() + _Roff, _Count); // fill hole
  11355. ; 1386 : _Traits::move(this->_Myptr() + _Off + _Count,
  11356. ; 1387 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  11357. ; 1388 : }
  11358. ; 1389 : else if (_Roff <= _Off)
  11359. ; 1390 : { // hole gets larger, substring begins before hole
  11360. ; 1391 : _Traits::move(this->_Myptr() + _Off + _Count,
  11361. ; 1392 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  11362. ; 1393 : _Traits::move(this->_Myptr() + _Off,
  11363. ; 1394 : this->_Myptr() + _Roff, _Count); // fill hole
  11364. ; 1395 : }
  11365. ; 1396 : else if (_Off + _N0 <= _Roff)
  11366. ; 1397 : { // hole gets larger, substring begins after hole
  11367. ; 1398 : _Traits::move(this->_Myptr() + _Off + _Count,
  11368. ; 1399 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  11369. ; 1400 : _Traits::move(this->_Myptr() + _Off,
  11370. ; 1401 : this->_Myptr() + (_Roff + _Count - _N0),
  11371. ; 1402 : _Count); // fill hole
  11372. ; 1403 : }
  11373. ; 1404 : else
  11374. ; 1405 : { // hole gets larger, substring begins in hole
  11375. ; 1406 : _Traits::move(this->_Myptr() + _Off,
  11376. ; 1407 : this->_Myptr() + _Roff, _N0); // fill old hole
  11377. ; 1408 : _Traits::move(this->_Myptr() + _Off + _Count,
  11378. ; 1409 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  11379. ; 1410 : _Traits::move(this->_Myptr() + _Off + _N0,
  11380. ; 1411 : this->_Myptr() + _Roff + _Count,
  11381. ; 1412 : _Count - _N0); // fill rest of new hole
  11382. ; 1413 : }
  11383. ; 1414 :
  11384. ; 1415 : _Eos(_Newsize);
  11385. ; 1416 : return (*this);
  11386. ; 1417 : }
  11387. ; 1418 :
  11388. ; 1419 : _Myt& replace(size_type _Off,
  11389. ; 1420 : size_type _N0, const _Elem *_Ptr, size_type _Count)
  11390. ; 1421 : { // replace [_Off, _Off + _N0) with [_Ptr, _Ptr + _Count)
  11391. ; 1422 : #if _ITERATOR_DEBUG_LEVEL == 2
  11392. ; 1423 : if (_Count != 0)
  11393. ; 1424 : _DEBUG_POINTER(_Ptr);
  11394. ; 1425 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  11395. ; 1426 :
  11396. ; 1427 : if (_Inside(_Ptr))
  11397. ; 1428 : return (replace(_Off, _N0, *this,
  11398. ; 1429 : _Ptr - this->_Myptr(),
  11399. ; 1430 : _Count)); // substring, replace carefully
  11400. ; 1431 : if (this->_Mysize < _Off)
  11401. ; 1432 : _Xran(); // _Off off end
  11402. ; 1433 : if (this->_Mysize - _Off < _N0)
  11403. ; 1434 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  11404. ; 1435 : if (npos - _Count <= this->_Mysize - _N0)
  11405. ; 1436 : _Xlen(); // result too long
  11406. ; 1437 : size_type _Nm = this->_Mysize - _N0 - _Off;
  11407. ; 1438 :
  11408. ; 1439 : if (_Count < _N0)
  11409. ; 1440 : _Traits::move(this->_Myptr() + _Off + _Count,
  11410. ; 1441 : this->_Myptr() + _Off + _N0,
  11411. ; 1442 : _Nm); // smaller hole, move tail up
  11412. ; 1443 : size_type _Num;
  11413. ; 1444 : if ((0 < _Count || 0 < _N0)
  11414. ; 1445 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  11415. ; 1446 : { // make room and rearrange
  11416. ; 1447 : if (_N0 < _Count)
  11417. ; 1448 : _Traits::move(this->_Myptr() + _Off + _Count,
  11418. ; 1449 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  11419. ; 1450 : _Traits::copy(this->_Myptr() + _Off, _Ptr, _Count); // fill hole
  11420. ; 1451 : _Eos(_Num);
  11421. ; 1452 : }
  11422. ; 1453 : return (*this);
  11423. ; 1454 : }
  11424. ; 1455 :
  11425. ; 1456 : _Myt& replace(size_type _Off, size_type _N0, const _Elem *_Ptr)
  11426. ; 1457 : { // replace [_Off, _Off + _N0) with [_Ptr, <null>)
  11427. ; 1458 : _DEBUG_POINTER(_Ptr);
  11428. ; 1459 : return (replace(_Off, _N0, _Ptr, _Traits::length(_Ptr)));
  11429. ; 1460 : }
  11430. ; 1461 :
  11431. ; 1462 : _Myt& replace(size_type _Off,
  11432. ; 1463 : size_type _N0, size_type _Count, _Elem _Ch)
  11433. ; 1464 : { // replace [_Off, _Off + _N0) with _Count * _Ch
  11434. ; 1465 : if (this->_Mysize < _Off)
  11435. ; 1466 : _Xran(); // _Off off end
  11436. ; 1467 : if (this->_Mysize - _Off < _N0)
  11437. ; 1468 : _N0 = this->_Mysize - _Off; // trim _N0 to size
  11438. ; 1469 : if (npos - _Count <= this->_Mysize - _N0)
  11439. ; 1470 : _Xlen(); // result too long
  11440. ; 1471 : size_type _Nm = this->_Mysize - _N0 - _Off;
  11441. ; 1472 :
  11442. ; 1473 : if (_Count < _N0)
  11443. ; 1474 : _Traits::move(this->_Myptr() + _Off + _Count,
  11444. ; 1475 : this->_Myptr() + _Off + _N0,
  11445. ; 1476 : _Nm); // smaller hole, move tail up
  11446. ; 1477 : size_type _Num;
  11447. ; 1478 : if ((0 < _Count || 0 < _N0)
  11448. ; 1479 : && _Grow(_Num = this->_Mysize + _Count - _N0))
  11449. ; 1480 : { // make room and rearrange
  11450. ; 1481 : if (_N0 < _Count)
  11451. ; 1482 : _Traits::move(this->_Myptr() + _Off + _Count,
  11452. ; 1483 : this->_Myptr() + _Off + _N0, _Nm); // move tail down
  11453. ; 1484 : _Chassign(_Off, _Count, _Ch); // fill hole
  11454. ; 1485 : _Eos(_Num);
  11455. ; 1486 : }
  11456. ; 1487 : return (*this);
  11457. ; 1488 : }
  11458. ; 1489 :
  11459. ; 1490 : _Myt& replace(const_iterator _First, const_iterator _Last,
  11460. ; 1491 : const _Myt& _Right)
  11461. ; 1492 : { // replace [_First, _Last) with _Right
  11462. ; 1493 : return (replace(
  11463. ; 1494 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Right));
  11464. ; 1495 : }
  11465. ; 1496 :
  11466. ; 1497 : _Myt& replace(const_iterator _First, const_iterator _Last,
  11467. ; 1498 : const _Elem *_Ptr, size_type _Count)
  11468. ; 1499 : { // replace [_First, _Last) with [_Ptr, _Ptr + _Count)
  11469. ; 1500 : return (replace(
  11470. ; 1501 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr, _Count));
  11471. ; 1502 : }
  11472. ; 1503 :
  11473. ; 1504 : _Myt& replace(const_iterator _First, const_iterator _Last,
  11474. ; 1505 : const _Elem *_Ptr)
  11475. ; 1506 : { // replace [_First, _Last) with [_Ptr, <null>)
  11476. ; 1507 : return (replace(
  11477. ; 1508 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Ptr));
  11478. ; 1509 : }
  11479. ; 1510 :
  11480. ; 1511 : _Myt& replace(const_iterator _First, const_iterator _Last,
  11481. ; 1512 : size_type _Count, _Elem _Ch)
  11482. ; 1513 : { // replace [_First, _Last) with _Count * _Ch
  11483. ; 1514 : return (replace(
  11484. ; 1515 : _Pdif(_First, begin()), _Pdif(_Last, _First), _Count, _Ch));
  11485. ; 1516 : }
  11486. ; 1517 :
  11487. ; 1518 : template<class _Iter>
  11488. ; 1519 : typename enable_if<_Is_iterator<_Iter>::value,
  11489. ; 1520 : _Myt&>::type
  11490. ; 1521 : replace(const_iterator _First, const_iterator _Last,
  11491. ; 1522 : _Iter _First2, _Iter _Last2)
  11492. ; 1523 : { // replace [_First, _Last) with [_First2, _Last2), input iterators
  11493. ; 1524 : _Myt _Right(_First2, _Last2);
  11494. ; 1525 : replace(_First, _Last, _Right);
  11495. ; 1526 : return (*this);
  11496. ; 1527 : }
  11497. ; 1528 :
  11498. ; 1529 : _Myt& replace(const_iterator _First, const_iterator _Last,
  11499. ; 1530 : const_pointer _First2, const_pointer _Last2)
  11500. ; 1531 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  11501. ; 1532 : if (_First2 == _Last2)
  11502. ; 1533 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  11503. ; 1534 : else
  11504. ; 1535 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  11505. ; 1536 : &*_First2, _Last2 - _First2);
  11506. ; 1537 : return (*this);
  11507. ; 1538 : }
  11508. ; 1539 :
  11509. ; 1540 : _Myt& replace(const_iterator _First, const_iterator _Last,
  11510. ; 1541 : pointer _First2, pointer _Last2)
  11511. ; 1542 : { // replace [_First, _Last) with [_First2, _Last2), const pointers
  11512. ; 1543 : if (_First2 == _Last2)
  11513. ; 1544 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  11514. ; 1545 : else
  11515. ; 1546 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  11516. ; 1547 : &*_First2, _Last2 - _First2);
  11517. ; 1548 : return (*this);
  11518. ; 1549 : }
  11519. ; 1550 :
  11520. ; 1551 : _Myt& replace(const_iterator _First, const_iterator _Last,
  11521. ; 1552 : const_iterator _First2, const_iterator _Last2)
  11522. ; 1553 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  11523. ; 1554 : if (_First2 == _Last2)
  11524. ; 1555 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  11525. ; 1556 : else
  11526. ; 1557 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  11527. ; 1558 : &*_First2, _Last2 - _First2);
  11528. ; 1559 : return (*this);
  11529. ; 1560 : }
  11530. ; 1561 :
  11531. ; 1562 : _Myt& replace(const_iterator _First, const_iterator _Last,
  11532. ; 1563 : iterator _First2, iterator _Last2)
  11533. ; 1564 : { // replace [_First, _Last) with [_First2, _Last2), const_iterators
  11534. ; 1565 : if (_First2 == _Last2)
  11535. ; 1566 : erase(_Pdif(_First, begin()), _Pdif(_Last, _First));
  11536. ; 1567 : else
  11537. ; 1568 : replace(_Pdif(_First, begin()), _Pdif(_Last, _First),
  11538. ; 1569 : &*_First2, _Last2 - _First2);
  11539. ; 1570 : return (*this);
  11540. ; 1571 : }
  11541. ; 1572 :
  11542. ; 1573 : iterator begin() _NOEXCEPT
  11543. ; 1574 : { // return iterator for beginning of mutable sequence
  11544. ; 1575 : return (_STRING_ITERATOR(this->_Myptr()));
  11545. ; 1576 : }
  11546. ; 1577 :
  11547. ; 1578 : const_iterator begin() const _NOEXCEPT
  11548. ; 1579 : { // return iterator for beginning of nonmutable sequence
  11549. ; 1580 : return (_STRING_CONST_ITERATOR(this->_Myptr()));
  11550. ; 1581 : }
  11551. ; 1582 :
  11552. ; 1583 : iterator end() _NOEXCEPT
  11553. ; 1584 : { // return iterator for end of mutable sequence
  11554. ; 1585 : return (_STRING_ITERATOR(this->_Myptr() + this->_Mysize));
  11555. ; 1586 : }
  11556. ; 1587 :
  11557. ; 1588 : const_iterator end() const _NOEXCEPT
  11558. ; 1589 : { // return iterator for end of nonmutable sequence
  11559. ; 1590 : return (_STRING_CONST_ITERATOR(this->_Myptr() + this->_Mysize));
  11560. ; 1591 : }
  11561. ; 1592 :
  11562. ; 1593 : reverse_iterator rbegin() _NOEXCEPT
  11563. ; 1594 : { // return iterator for beginning of reversed mutable sequence
  11564. ; 1595 : return (reverse_iterator(end()));
  11565. ; 1596 : }
  11566. ; 1597 :
  11567. ; 1598 : const_reverse_iterator rbegin() const _NOEXCEPT
  11568. ; 1599 : { // return iterator for beginning of reversed nonmutable sequence
  11569. ; 1600 : return (const_reverse_iterator(end()));
  11570. ; 1601 : }
  11571. ; 1602 :
  11572. ; 1603 : reverse_iterator rend() _NOEXCEPT
  11573. ; 1604 : { // return iterator for end of reversed mutable sequence
  11574. ; 1605 : return (reverse_iterator(begin()));
  11575. ; 1606 : }
  11576. ; 1607 :
  11577. ; 1608 : const_reverse_iterator rend() const _NOEXCEPT
  11578. ; 1609 : { // return iterator for end of reversed nonmutable sequence
  11579. ; 1610 : return (const_reverse_iterator(begin()));
  11580. ; 1611 : }
  11581. ; 1612 :
  11582. ; 1613 : #if _HAS_CPP0X
  11583. ; 1614 : const_iterator cbegin() const _NOEXCEPT
  11584. ; 1615 : { // return iterator for beginning of nonmutable sequence
  11585. ; 1616 : return (((const _Myt *)this)->begin());
  11586. ; 1617 : }
  11587. ; 1618 :
  11588. ; 1619 : const_iterator cend() const _NOEXCEPT
  11589. ; 1620 : { // return iterator for end of nonmutable sequence
  11590. ; 1621 : return (((const _Myt *)this)->end());
  11591. ; 1622 : }
  11592. ; 1623 :
  11593. ; 1624 : const_reverse_iterator crbegin() const _NOEXCEPT
  11594. ; 1625 : { // return iterator for beginning of reversed nonmutable sequence
  11595. ; 1626 : return (((const _Myt *)this)->rbegin());
  11596. ; 1627 : }
  11597. ; 1628 :
  11598. ; 1629 : const_reverse_iterator crend() const _NOEXCEPT
  11599. ; 1630 : { // return iterator for end of reversed nonmutable sequence
  11600. ; 1631 : return (((const _Myt *)this)->rend());
  11601. ; 1632 : }
  11602. ; 1633 :
  11603. ; 1634 : void shrink_to_fit()
  11604. ; 1635 : { // reduce capacity
  11605. ; 1636 : if ((size() | this->_ALLOC_MASK) < capacity())
  11606. ; 1637 : { // worth shrinking, do it
  11607. ; 1638 : _Myt _Tmp(*this);
  11608. ; 1639 : swap(_Tmp);
  11609. ; 1640 : }
  11610. ; 1641 : }
  11611. ; 1642 : #endif /* _HAS_CPP0X */
  11612. ; 1643 :
  11613. ; 1644 : reference at(size_type _Off)
  11614. ; 1645 : { // subscript mutable sequence with checking
  11615. ; 1646 : if (this->_Mysize <= _Off)
  11616. ; 1647 : _Xran(); // _Off off end
  11617. ; 1648 : return (this->_Myptr()[_Off]);
  11618. ; 1649 : }
  11619. ; 1650 :
  11620. ; 1651 : const_reference at(size_type _Off) const
  11621. ; 1652 : { // subscript nonmutable sequence with checking
  11622. ; 1653 : if (this->_Mysize <= _Off)
  11623. ; 1654 : _Xran(); // _Off off end
  11624. ; 1655 : return (this->_Myptr()[_Off]);
  11625. ; 1656 : }
  11626. ; 1657 :
  11627. ; 1658 : reference operator[](size_type _Off)
  11628. ; 1659 : { // subscript mutable sequence
  11629. ; 1660 : #if _ITERATOR_DEBUG_LEVEL == 2
  11630. ; 1661 : if (this->_Mysize < _Off) // sic
  11631. ; 1662 : _DEBUG_ERROR("string subscript out of range");
  11632. ; 1663 :
  11633. ; 1664 : #elif _ITERATOR_DEBUG_LEVEL == 1
  11634. ; 1665 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  11635. ; 1666 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  11636. ; 1667 :
  11637. ; 1668 : return (this->_Myptr()[_Off]);
  11638. ; 1669 : }
  11639. ; 1670 :
  11640. ; 1671 : const_reference operator[](size_type _Off) const
  11641. ; 1672 : { // subscript nonmutable sequence
  11642. ; 1673 : #if _ITERATOR_DEBUG_LEVEL == 2
  11643. ; 1674 : if (this->_Mysize < _Off) // sic
  11644. ; 1675 : _DEBUG_ERROR("string subscript out of range");
  11645. ; 1676 :
  11646. ; 1677 : #elif _ITERATOR_DEBUG_LEVEL == 1
  11647. ; 1678 : _SCL_SECURE_VALIDATE_RANGE(_Off <= this->_Mysize); // sic
  11648. ; 1679 : #endif /* _ITERATOR_DEBUG_LEVEL == 2 */
  11649. ; 1680 :
  11650. ; 1681 : return (this->_Myptr()[_Off]);
  11651. ; 1682 : }
  11652. ; 1683 :
  11653. ; 1684 : void push_back(_Elem _Ch)
  11654. ; 1685 : { // insert element at end
  11655. ; 1686 : insert(end(), _Ch);
  11656. ; 1687 : }
  11657. ; 1688 :
  11658. ; 1689 : #if _HAS_CPP0X
  11659. ; 1690 : void pop_back()
  11660. ; 1691 : { // erase element at end
  11661. ; 1692 : erase(this->_Mysize - 1); // throws if _Mysize == 0
  11662. ; 1693 : }
  11663. ; 1694 :
  11664. ; 1695 : reference front()
  11665. ; 1696 : { // return first element of mutable sequence
  11666. ; 1697 : return (*begin());
  11667. ; 1698 : }
  11668. ; 1699 :
  11669. ; 1700 : const_reference front() const
  11670. ; 1701 : { // return first element of nonmutable sequence
  11671. ; 1702 : return (*begin());
  11672. ; 1703 : }
  11673. ; 1704 :
  11674. ; 1705 : reference back()
  11675. ; 1706 : { // return last element of mutable sequence
  11676. ; 1707 : return (*(end() - 1));
  11677. ; 1708 : }
  11678. ; 1709 :
  11679. ; 1710 : const_reference back() const
  11680. ; 1711 : { // return last element of nonmutable sequence
  11681. ; 1712 : return (*(end() - 1));
  11682. ; 1713 : }
  11683. ; 1714 : #endif /* _HAS_CPP0X */
  11684. ; 1715 :
  11685. ; 1716 : const _Elem *c_str() const _NOEXCEPT
  11686. ; 1717 : { // return pointer to null-terminated nonmutable array
  11687. ; 1718 : return (this->_Myptr());
  11688. ; 1719 : }
  11689. ; 1720 :
  11690. ; 1721 : const _Elem *data() const _NOEXCEPT
  11691. ; 1722 : { // return pointer to nonmutable array
  11692. ; 1723 : return (c_str());
  11693. ; 1724 : }
  11694. ; 1725 :
  11695. ; 1726 : size_type length() const _NOEXCEPT
  11696. ; 1727 : { // return length of sequence
  11697. ; 1728 : return (this->_Mysize);
  11698. ; 1729 : }
  11699. ; 1730 :
  11700. ; 1731 : size_type size() const _NOEXCEPT
  11701. ; 1732 : { // return length of sequence
  11702. ; 1733 : return (this->_Mysize);
  11703. ; 1734 : }
  11704. ; 1735 :
  11705. ; 1736 : size_type max_size() const _NOEXCEPT
  11706. ; 1737 : { // return maximum possible length of sequence
  11707. ; 1738 : size_type _Num = this->_Getal().max_size();
  11708. ; 1739 : return (_Num <= 1 ? 1 : _Num - 1);
  11709.  
  11710. mov edi, -2 ; fffffffeH
  11711. $LN47@Copy:
  11712.  
  11713. ; 2196 : _Ptr = this->_Getal().allocate(_Newres + 1);
  11714.  
  11715. lea ecx, DWORD PTR [edi+1]
  11716. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  11717.  
  11718. ; 23 : void *_Ptr = 0;
  11719.  
  11720. xor eax, eax
  11721. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  11722.  
  11723. ; 2195 : _TRY_BEGIN
  11724.  
  11725. mov DWORD PTR __$EHRec$[ebp+12], 0
  11726. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  11727.  
  11728. ; 23 : void *_Ptr = 0;
  11729.  
  11730. mov DWORD PTR __Ptr$1$[ebp], eax
  11731.  
  11732. ; 24 :
  11733. ; 25 : if (_Count == 0)
  11734.  
  11735. test ecx, ecx
  11736. je SHORT $LN19@Copy
  11737.  
  11738. ; 26 : ;
  11739. ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
  11740. ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
  11741.  
  11742. cmp ecx, -1
  11743. ja SHORT $LN62@Copy
  11744. push ecx
  11745. call DWORD PTR __imp_??2@YAPAXI@Z
  11746. add esp, 4
  11747. mov DWORD PTR __Ptr$1$[ebp], eax
  11748. test eax, eax
  11749. jne SHORT $LN19@Copy
  11750. $LN62@Copy:
  11751.  
  11752. ; 29 : _Xbad_alloc(); // report no memory
  11753.  
  11754. call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
  11755. $LN174@Copy:
  11756. __catch$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z$0:
  11757. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  11758.  
  11759. ; 2198 : _Newres = _Newsize; // allocation failed, undo roundup and retry
  11760.  
  11761. mov eax, DWORD PTR __Newsize$[ebp]
  11762. mov DWORD PTR __Newres$[ebp], eax
  11763.  
  11764. ; 2199 : _TRY_BEGIN
  11765. ; 2200 : _Ptr = this->_Getal().allocate(_Newres + 1);
  11766.  
  11767. inc eax
  11768. mov DWORD PTR __$EHRec$[ebp], esp
  11769. push eax
  11770. mov BYTE PTR __$EHRec$[ebp+12], 2
  11771. call ?allocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEPADI@Z ; std::_Wrap_alloc<std::allocator<char> >::allocate
  11772. mov DWORD PTR __Ptr$[ebp], eax
  11773.  
  11774. ; 2204 : _CATCH_END
  11775. ; 2205 : _CATCH_END
  11776.  
  11777. mov eax, $LN171@Copy
  11778. ret 0
  11779. $LN171@Copy:
  11780. mov eax, DWORD PTR __Ptr$[ebp]
  11781. mov esi, DWORD PTR _this$[ebp]
  11782. mov edi, DWORD PTR __Newres$[ebp]
  11783. mov DWORD PTR __Ptr$1$[ebp], eax
  11784. $LN19@Copy:
  11785.  
  11786. ; 2206 :
  11787. ; 2207 : if (0 < _Oldlen)
  11788.  
  11789. mov ebx, DWORD PTR __Oldlen$[ebp]
  11790. test ebx, ebx
  11791. je SHORT $LN112@Copy
  11792.  
  11793. ; 517 : : this->_Bx._Buf);
  11794.  
  11795. cmp DWORD PTR [esi+20], 16 ; 00000010H
  11796. jb SHORT $LN105@Copy
  11797. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  11798.  
  11799. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  11800.  
  11801. mov ecx, DWORD PTR [esi]
  11802. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  11803.  
  11804. ; 517 : : this->_Bx._Buf);
  11805.  
  11806. jmp SHORT $LN106@Copy
  11807. __catch$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z$1:
  11808.  
  11809. ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
  11810.  
  11811. mov esi, DWORD PTR _this$[ebp]
  11812. cmp DWORD PTR [esi+20], 16 ; 00000010H
  11813. jb SHORT $LN91@Copy
  11814. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  11815.  
  11816. ; 586 : ::operator delete(_Ptr);
  11817.  
  11818. push DWORD PTR [esi]
  11819. call DWORD PTR __imp_??3@YAXPAX@Z
  11820. add esp, 4
  11821. $LN91@Copy:
  11822. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  11823.  
  11824. ; 2203 : _RERAISE;
  11825.  
  11826. push 0
  11827.  
  11828. ; 2257 : { // copy any leftovers to small buffer and deallocate
  11829. ; 2258 : pointer _Ptr = this->_Bx._Ptr;
  11830. ; 2259 : this->_Getal().destroy(&this->_Bx._Ptr);
  11831. ; 2260 : if (0 < _Newsize)
  11832. ; 2261 : _Traits::copy(this->_Bx._Buf,
  11833. ; 2262 : _STD addressof(*_Ptr), _Newsize);
  11834. ; 2263 : this->_Getal().deallocate(_Ptr, this->_Myres + 1);
  11835. ; 2264 : }
  11836. ; 2265 : this->_Myres = this->_BUF_SIZE - 1;
  11837.  
  11838. mov DWORD PTR [esi+20], 15 ; 0000000fH
  11839.  
  11840. ; 2215 :
  11841. ; 2216 : void _Eos(size_type _Newsize)
  11842. ; 2217 : { // set new length and null terminator
  11843. ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
  11844.  
  11845. mov DWORD PTR [esi+16], 0
  11846.  
  11847. ; 2203 : _RERAISE;
  11848.  
  11849. push 0
  11850. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  11851.  
  11852. ; 564 : _Left = _Right;
  11853.  
  11854. mov BYTE PTR [esi], 0
  11855. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  11856.  
  11857. ; 2203 : _RERAISE;
  11858.  
  11859. call __CxxThrowException@8
  11860. $LN175@Copy:
  11861. $LN105@Copy:
  11862.  
  11863. ; 517 : : this->_Bx._Buf);
  11864.  
  11865. mov ecx, esi
  11866. $LN106@Copy:
  11867. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  11868.  
  11869. ; 530 : : (_Elem *)_CSTD memcpy(_First1, _First2, _Count));
  11870.  
  11871. test ebx, ebx
  11872. je SHORT $LN112@Copy
  11873. push ebx
  11874. push ecx
  11875. push eax
  11876. call _memcpy
  11877. add esp, 12 ; 0000000cH
  11878. $LN112@Copy:
  11879. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  11880.  
  11881. ; 2256 : else if (this->_BUF_SIZE <= this->_Myres)
  11882.  
  11883. cmp DWORD PTR [esi+20], 16 ; 00000010H
  11884. jb SHORT $LN131@Copy
  11885. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  11886.  
  11887. ; 586 : ::operator delete(_Ptr);
  11888.  
  11889. push DWORD PTR [esi]
  11890. call DWORD PTR __imp_??3@YAXPAX@Z
  11891. add esp, 4
  11892. $LN131@Copy:
  11893.  
  11894. ; 617 : _VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
  11895.  
  11896. mov eax, DWORD PTR __Ptr$1$[ebp]
  11897. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  11898.  
  11899. ; 564 : _Left = _Right;
  11900.  
  11901. mov BYTE PTR [esi], 0
  11902. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  11903.  
  11904. ; 617 : _VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
  11905.  
  11906. mov DWORD PTR [esi], eax
  11907. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  11908.  
  11909. ; 2212 : this->_Myres = _Newres;
  11910.  
  11911. mov DWORD PTR [esi+20], edi
  11912.  
  11913. ; 2215 :
  11914. ; 2216 : void _Eos(size_type _Newsize)
  11915. ; 2217 : { // set new length and null terminator
  11916. ; 2218 : _Traits::assign(this->_Myptr()[this->_Mysize = _Newsize], _Elem());
  11917.  
  11918. mov DWORD PTR [esi+16], ebx
  11919.  
  11920. ; 517 : : this->_Bx._Buf);
  11921.  
  11922. cmp edi, 16 ; 00000010H
  11923. jb SHORT $LN166@Copy
  11924. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  11925.  
  11926. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  11927.  
  11928. mov esi, eax
  11929. $LN166@Copy:
  11930. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\iosfwd
  11931.  
  11932. ; 564 : _Left = _Right;
  11933.  
  11934. mov BYTE PTR [esi+ebx], 0
  11935. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstring
  11936.  
  11937. ; 2214 : }
  11938.  
  11939. mov ecx, DWORD PTR __$EHRec$[ebp+4]
  11940. mov DWORD PTR fs:0, ecx
  11941. pop ecx
  11942. pop edi
  11943. pop esi
  11944. pop ebx
  11945. mov esp, ebp
  11946. pop ebp
  11947. ret 8
  11948. $LN173@Copy:
  11949. _TEXT ENDS
  11950. ; COMDAT text$x
  11951. text$x SEGMENT
  11952. __ehhandler$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z:
  11953. mov edx, DWORD PTR [esp+8]
  11954. lea eax, DWORD PTR [edx+12]
  11955. mov ecx, DWORD PTR [edx-28]
  11956. xor ecx, eax
  11957. call @__security_check_cookie@4
  11958. mov eax, OFFSET __ehfuncinfo$?_Copy@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAEXII@Z
  11959. jmp ___CxxFrameHandler3
  11960. text$x ENDS
  11961. ?_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
  11962. ; Function compile flags: /Ogtp
  11963. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  11964. ; COMDAT ?capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ
  11965. _TEXT SEGMENT
  11966. ?capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ PROC ; std::vector<double,std::allocator<double> >::capacity, COMDAT
  11967. ; _this$ = ecx
  11968.  
  11969. ; 967 : return (this->_Myend - this->_Myfirst);
  11970.  
  11971. mov eax, DWORD PTR [ecx+8]
  11972. sub eax, DWORD PTR [ecx]
  11973. sar eax, 3
  11974.  
  11975. ; 968 : }
  11976.  
  11977. ret 0
  11978. ?capacity@?$vector@NV?$allocator@N@std@@@std@@QBEIXZ ENDP ; std::vector<double,std::allocator<double> >::capacity
  11979. _TEXT ENDS
  11980. ; Function compile flags: /Ogtp
  11981. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  11982. ; COMDAT ?allocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEPANI@Z
  11983. _TEXT SEGMENT
  11984. __Count$ = 8 ; size = 4
  11985. ?allocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEPANI@Z PROC ; std::_Wrap_alloc<std::allocator<double> >::allocate, COMDAT
  11986. ; _this$dead$ = ecx
  11987.  
  11988. ; 875 : { // allocate array of _Count elements
  11989.  
  11990. push ebp
  11991. mov ebp, esp
  11992.  
  11993. ; 25 : if (_Count == 0)
  11994.  
  11995. mov eax, DWORD PTR __Count$[ebp]
  11996. xor ecx, ecx
  11997. test eax, eax
  11998. je SHORT $LN6@allocate
  11999.  
  12000. ; 26 : ;
  12001. ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
  12002. ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
  12003.  
  12004. cmp eax, 536870911 ; 1fffffffH
  12005. ja SHORT $LN5@allocate
  12006. shl eax, 3
  12007. push eax
  12008. call DWORD PTR __imp_??2@YAPAXI@Z
  12009. mov ecx, eax
  12010. add esp, 4
  12011. test ecx, ecx
  12012. jne SHORT $LN6@allocate
  12013. $LN5@allocate:
  12014.  
  12015. ; 29 : _Xbad_alloc(); // report no memory
  12016.  
  12017. call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
  12018. $LN15@allocate:
  12019. $LN6@allocate:
  12020.  
  12021. ; 876 : return (_Mybase::allocate(_Count));
  12022.  
  12023. mov eax, ecx
  12024.  
  12025. ; 877 : }
  12026.  
  12027. pop ebp
  12028. ret 4
  12029. $LN14@allocate:
  12030. ?allocate@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QAEPANI@Z ENDP ; std::_Wrap_alloc<std::allocator<double> >::allocate
  12031. _TEXT ENDS
  12032. ; Function compile flags: /Ogtp
  12033. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12034. ; COMDAT ?max_size@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QBEIXZ
  12035. _TEXT SEGMENT
  12036. ?max_size@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QBEIXZ PROC ; std::_Wrap_alloc<std::allocator<double> >::max_size, COMDAT
  12037. ; _this$dead$ = ecx
  12038.  
  12039. ; 914 : return (_Mytraits::max_size(*this));
  12040.  
  12041. mov eax, 536870911 ; 1fffffffH
  12042.  
  12043. ; 915 : }
  12044.  
  12045. ret 0
  12046. ?max_size@?$_Wrap_alloc@V?$allocator@N@std@@@std@@QBEIXZ ENDP ; std::_Wrap_alloc<std::allocator<double> >::max_size
  12047. _TEXT ENDS
  12048. ; Function compile flags: /Ogtp
  12049. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  12050. ; COMDAT ??0?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAE@PANPBU_Container_base0@1@@Z
  12051. _TEXT SEGMENT
  12052. __Parg$ = 8 ; size = 4
  12053. __Pvector$dead$ = 12 ; size = 4
  12054. ??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
  12055. ; _this$ = ecx
  12056.  
  12057. ; 47 : { // construct with pointer _Parg
  12058.  
  12059. push ebp
  12060. mov ebp, esp
  12061. mov eax, DWORD PTR __Parg$[ebp]
  12062. mov DWORD PTR [ecx], eax
  12063.  
  12064. ; 48 : this->_Adopt(_Pvector);
  12065. ; 49 : }
  12066.  
  12067. mov eax, ecx
  12068. pop ebp
  12069. ret 8
  12070. ??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> > >
  12071. _TEXT ENDS
  12072. ; Function compile flags: /Ogtp
  12073. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  12074. ; COMDAT ??Y?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QAEAAV01@H@Z
  12075. _TEXT SEGMENT
  12076. __Off$ = 8 ; size = 4
  12077. ??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
  12078. ; _this$ = ecx
  12079.  
  12080. ; 153 : { // increment by integer
  12081.  
  12082. push ebp
  12083. mov ebp, esp
  12084.  
  12085. ; 154 : #if _ITERATOR_DEBUG_LEVEL == 2
  12086. ; 155 : if (this->_Getcont() == 0
  12087. ; 156 : || this->_Ptr + _Off < ((_Myvec *)this->_Getcont())->_Myfirst
  12088. ; 157 : || ((_Myvec *)this->_Getcont())->_Mylast < this->_Ptr + _Off)
  12089. ; 158 : { // report error
  12090. ; 159 : _DEBUG_ERROR("vector iterator + offset out of range");
  12091. ; 160 : _SCL_SECURE_OUT_OF_RANGE;
  12092. ; 161 : }
  12093. ; 162 :
  12094. ; 163 : #elif _ITERATOR_DEBUG_LEVEL == 1
  12095. ; 164 : _SCL_SECURE_VALIDATE(this->_Getcont() != 0);
  12096. ; 165 : _SCL_SECURE_VALIDATE_RANGE(
  12097. ; 166 : ((_Myvec *)this->_Getcont())->_Myfirst <= this->_Ptr + _Off
  12098. ; 167 : && this->_Ptr + _Off <= ((_Myvec *)this->_Getcont())->_Mylast);
  12099. ; 168 : #endif /* _ITERATOR_DEBUG_LEVEL */
  12100. ; 169 :
  12101. ; 170 : _Ptr += _Off;
  12102.  
  12103. mov eax, DWORD PTR __Off$[ebp]
  12104. shl eax, 3
  12105. add DWORD PTR [ecx], eax
  12106.  
  12107. ; 171 : return (*this);
  12108.  
  12109. mov eax, ecx
  12110.  
  12111. ; 172 : }
  12112.  
  12113. pop ebp
  12114. ret 4
  12115. ??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+=
  12116. _TEXT ENDS
  12117. ; Function compile flags: /Ogtp
  12118. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  12119. ; COMDAT ?_Compat@?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@N@std@@@std@@@std@@QBEXABV12@@Z
  12120. _TEXT SEGMENT
  12121. ___formal$dead$ = 8 ; size = 4
  12122. ?_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
  12123. ; _this$dead$ = ecx
  12124.  
  12125. ; 255 : }
  12126.  
  12127. ret 4
  12128. ?_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
  12129. _TEXT ENDS
  12130. ; Function compile flags: /Ogtp
  12131. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12132. ; COMDAT ?allocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEPADI@Z
  12133. _TEXT SEGMENT
  12134. __Count$ = 8 ; size = 4
  12135. ?allocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEPADI@Z PROC ; std::_Wrap_alloc<std::allocator<char> >::allocate, COMDAT
  12136. ; _this$dead$ = ecx
  12137.  
  12138. ; 875 : { // allocate array of _Count elements
  12139.  
  12140. push ebp
  12141. mov ebp, esp
  12142.  
  12143. ; 25 : if (_Count == 0)
  12144.  
  12145. mov eax, DWORD PTR __Count$[ebp]
  12146. xor ecx, ecx
  12147. test eax, eax
  12148. je SHORT $LN6@allocate
  12149.  
  12150. ; 26 : ;
  12151. ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
  12152. ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
  12153.  
  12154. cmp eax, -1
  12155. ja SHORT $LN5@allocate
  12156. push eax
  12157. call DWORD PTR __imp_??2@YAPAXI@Z
  12158. mov ecx, eax
  12159. add esp, 4
  12160. test ecx, ecx
  12161. jne SHORT $LN6@allocate
  12162. $LN5@allocate:
  12163.  
  12164. ; 29 : _Xbad_alloc(); // report no memory
  12165.  
  12166. call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
  12167. $LN15@allocate:
  12168. $LN6@allocate:
  12169.  
  12170. ; 876 : return (_Mybase::allocate(_Count));
  12171.  
  12172. mov eax, ecx
  12173.  
  12174. ; 877 : }
  12175.  
  12176. pop ebp
  12177. ret 4
  12178. $LN14@allocate:
  12179. ?allocate@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEPADI@Z ENDP ; std::_Wrap_alloc<std::allocator<char> >::allocate
  12180. _TEXT ENDS
  12181. ; Function compile flags: /Ogtp
  12182. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12183. ; COMDAT ?max_size@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QBEIXZ
  12184. _TEXT SEGMENT
  12185. ?max_size@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QBEIXZ PROC ; std::_Wrap_alloc<std::allocator<char> >::max_size, COMDAT
  12186. ; _this$dead$ = ecx
  12187.  
  12188. ; 914 : return (_Mytraits::max_size(*this));
  12189.  
  12190. or eax, -1
  12191.  
  12192. ; 915 : }
  12193.  
  12194. ret 0
  12195. ?max_size@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QBEIXZ ENDP ; std::_Wrap_alloc<std::allocator<char> >::max_size
  12196. _TEXT ENDS
  12197. ; Function compile flags: /Ogtp
  12198. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12199. ; COMDAT ?allocate@?$allocator@N@std@@QAEPANI@Z
  12200. _TEXT SEGMENT
  12201. __Count$ = 8 ; size = 4
  12202. ?allocate@?$allocator@N@std@@QAEPANI@Z PROC ; std::allocator<double>::allocate, COMDAT
  12203. ; _this$dead$ = ecx
  12204.  
  12205. ; 590 : { // allocate array of _Count elements
  12206.  
  12207. push ebp
  12208. mov ebp, esp
  12209.  
  12210. ; 25 : if (_Count == 0)
  12211.  
  12212. mov eax, DWORD PTR __Count$[ebp]
  12213. xor ecx, ecx
  12214. test eax, eax
  12215. je SHORT $LN4@allocate
  12216.  
  12217. ; 26 : ;
  12218. ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
  12219. ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
  12220.  
  12221. cmp eax, 536870911 ; 1fffffffH
  12222. ja SHORT $LN3@allocate
  12223. shl eax, 3
  12224. push eax
  12225. call DWORD PTR __imp_??2@YAPAXI@Z
  12226. mov ecx, eax
  12227. add esp, 4
  12228. test ecx, ecx
  12229. jne SHORT $LN4@allocate
  12230. $LN3@allocate:
  12231.  
  12232. ; 29 : _Xbad_alloc(); // report no memory
  12233.  
  12234. call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
  12235. $LN12@allocate:
  12236. $LN4@allocate:
  12237.  
  12238. ; 591 : return (_Allocate(_Count, (pointer)0));
  12239.  
  12240. mov eax, ecx
  12241.  
  12242. ; 592 : }
  12243.  
  12244. pop ebp
  12245. ret 4
  12246. $LN11@allocate:
  12247. ?allocate@?$allocator@N@std@@QAEPANI@Z ENDP ; std::allocator<double>::allocate
  12248. _TEXT ENDS
  12249. ; Function compile flags: /Ogtp
  12250. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12251. ; COMDAT ?max_size@?$allocator_traits@V?$allocator@N@std@@@std@@SAIABV?$allocator@N@2@@Z
  12252. _TEXT SEGMENT
  12253. ?max_size@?$allocator_traits@V?$allocator@N@std@@@std@@SAIABV?$allocator@N@2@@Z PROC ; std::allocator_traits<std::allocator<double> >::max_size, COMDAT
  12254. ; __Al$dead$ = ecx
  12255.  
  12256. ; 762 : return (_Al.max_size());
  12257.  
  12258. mov eax, 536870911 ; 1fffffffH
  12259.  
  12260. ; 763 : }
  12261.  
  12262. ret 0
  12263. ?max_size@?$allocator_traits@V?$allocator@N@std@@@std@@SAIABV?$allocator@N@2@@Z ENDP ; std::allocator_traits<std::allocator<double> >::max_size
  12264. _TEXT ENDS
  12265. ; Function compile flags: /Ogtp
  12266. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12267. ; COMDAT ?allocate@?$allocator@D@std@@QAEPADI@Z
  12268. _TEXT SEGMENT
  12269. __Count$ = 8 ; size = 4
  12270. ?allocate@?$allocator@D@std@@QAEPADI@Z PROC ; std::allocator<char>::allocate, COMDAT
  12271. ; _this$dead$ = ecx
  12272.  
  12273. ; 590 : { // allocate array of _Count elements
  12274.  
  12275. push ebp
  12276. mov ebp, esp
  12277.  
  12278. ; 25 : if (_Count == 0)
  12279.  
  12280. mov eax, DWORD PTR __Count$[ebp]
  12281. xor ecx, ecx
  12282. test eax, eax
  12283. je SHORT $LN4@allocate
  12284.  
  12285. ; 26 : ;
  12286. ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
  12287. ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
  12288.  
  12289. cmp eax, -1
  12290. ja SHORT $LN3@allocate
  12291. push eax
  12292. call DWORD PTR __imp_??2@YAPAXI@Z
  12293. mov ecx, eax
  12294. add esp, 4
  12295. test ecx, ecx
  12296. jne SHORT $LN4@allocate
  12297. $LN3@allocate:
  12298.  
  12299. ; 29 : _Xbad_alloc(); // report no memory
  12300.  
  12301. call DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
  12302. $LN12@allocate:
  12303. $LN4@allocate:
  12304.  
  12305. ; 591 : return (_Allocate(_Count, (pointer)0));
  12306.  
  12307. mov eax, ecx
  12308.  
  12309. ; 592 : }
  12310.  
  12311. pop ebp
  12312. ret 4
  12313. $LN11@allocate:
  12314. ?allocate@?$allocator@D@std@@QAEPADI@Z ENDP ; std::allocator<char>::allocate
  12315. _TEXT ENDS
  12316. ; Function compile flags: /Ogtp
  12317. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12318. ; COMDAT ?max_size@?$allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z
  12319. _TEXT SEGMENT
  12320. ?max_size@?$allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z PROC ; std::allocator_traits<std::allocator<char> >::max_size, COMDAT
  12321. ; __Al$dead$ = ecx
  12322.  
  12323. ; 762 : return (_Al.max_size());
  12324.  
  12325. or eax, -1
  12326.  
  12327. ; 763 : }
  12328.  
  12329. ret 0
  12330. ?max_size@?$allocator_traits@V?$allocator@D@std@@@std@@SAIABV?$allocator@D@2@@Z ENDP ; std::allocator_traits<std::allocator<char> >::max_size
  12331. _TEXT ENDS
  12332. ; Function compile flags: /Ogtp
  12333. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12334. ; COMDAT ?max_size@?$allocator@N@std@@QBEIXZ
  12335. _TEXT SEGMENT
  12336. ?max_size@?$allocator@N@std@@QBEIXZ PROC ; std::allocator<double>::max_size, COMDAT
  12337. ; _this$dead$ = ecx
  12338.  
  12339. ; 628 : return ((size_t)(-1) / sizeof (_Ty));
  12340.  
  12341. mov eax, 536870911 ; 1fffffffH
  12342.  
  12343. ; 629 : }
  12344.  
  12345. ret 0
  12346. ?max_size@?$allocator@N@std@@QBEIXZ ENDP ; std::allocator<double>::max_size
  12347. _TEXT ENDS
  12348. ; Function compile flags: /Ogtp
  12349. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12350. ; COMDAT ?max_size@?$allocator@D@std@@QBEIXZ
  12351. _TEXT SEGMENT
  12352. ?max_size@?$allocator@D@std@@QBEIXZ PROC ; std::allocator<char>::max_size, COMDAT
  12353. ; _this$dead$ = ecx
  12354.  
  12355. ; 628 : return ((size_t)(-1) / sizeof (_Ty));
  12356.  
  12357. or eax, -1
  12358.  
  12359. ; 629 : }
  12360.  
  12361. ret 0
  12362. ?max_size@?$allocator@D@std@@QBEIXZ ENDP ; std::allocator<char>::max_size
  12363. _TEXT ENDS
  12364. ; Function compile flags: /Ogtp
  12365. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12366. ; COMDAT ??__E?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A@@YAXXZ
  12367. text$yc SEGMENT
  12368. ??__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
  12369.  
  12370. ; 627 : { // estimate maximum array size
  12371.  
  12372. 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''
  12373. call _atexit
  12374. pop ecx
  12375. ret 0
  12376. ??__E?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A@@YAXXZ ENDP ; `dynamic initializer for 'std::_Error_objects<int>::_Generic_object''
  12377. text$yc ENDS
  12378. ; Function compile flags: /Ogtp
  12379. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12380. ; COMDAT ??__E?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A@@YAXXZ
  12381. text$yc SEGMENT
  12382. ??__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
  12383.  
  12384. ; 627 : { // estimate maximum array size
  12385.  
  12386. 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''
  12387. call _atexit
  12388. pop ecx
  12389. ret 0
  12390. ??__E?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A@@YAXXZ ENDP ; `dynamic initializer for 'std::_Error_objects<int>::_Iostream_object''
  12391. text$yc ENDS
  12392. ; Function compile flags: /Ogtp
  12393. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12394. ; COMDAT ??__E?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A@@YAXXZ
  12395. text$yc SEGMENT
  12396. ??__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
  12397.  
  12398. ; 627 : { // estimate maximum array size
  12399.  
  12400. 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''
  12401. call _atexit
  12402. pop ecx
  12403. ret 0
  12404. ??__E?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A@@YAXXZ ENDP ; `dynamic initializer for 'std::_Error_objects<int>::_System_object''
  12405. text$yc ENDS
  12406. ; Function compile flags: /Ogtp
  12407. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12408. ; COMDAT ??$construct@PADAAPAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPADAAPAD@Z
  12409. _TEXT SEGMENT
  12410. __Ptr$ = 8 ; size = 4
  12411. __V0$ = 12 ; size = 4
  12412. ??$construct@PADAAPAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPADAAPAD@Z PROC ; std::_Wrap_alloc<std::allocator<char> >::construct<char *,char * &>, COMDAT
  12413. ; _this$dead$ = ecx
  12414.  
  12415. ; 903 : _VARIADIC_EXPAND_0X(_WRAP_ALLOC_CONSTRUCT, , , , )
  12416.  
  12417. push ebp
  12418. mov ebp, esp
  12419.  
  12420. ; 617 : _VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
  12421.  
  12422. mov ecx, DWORD PTR __Ptr$[ebp]
  12423. test ecx, ecx
  12424. je SHORT $LN11@construct
  12425. mov eax, DWORD PTR __V0$[ebp]
  12426. mov eax, DWORD PTR [eax]
  12427. mov DWORD PTR [ecx], eax
  12428. $LN11@construct:
  12429.  
  12430. ; 903 : _VARIADIC_EXPAND_0X(_WRAP_ALLOC_CONSTRUCT, , , , )
  12431.  
  12432. pop ebp
  12433. ret 8
  12434. ??$construct@PADAAPAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPADAAPAD@Z ENDP ; std::_Wrap_alloc<std::allocator<char> >::construct<char *,char * &>
  12435. _TEXT ENDS
  12436. ; Function compile flags: /Ogtp
  12437. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12438. ; COMDAT ??$destroy@PAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPAD@Z
  12439. _TEXT SEGMENT
  12440. __Ptr$dead$ = 8 ; size = 4
  12441. ??$destroy@PAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPAD@Z PROC ; std::_Wrap_alloc<std::allocator<char> >::destroy<char *>, COMDAT
  12442. ; _this$dead$ = ecx
  12443.  
  12444. ; 908 : { // destroy object at _Ptr
  12445. ; 909 : _Mytraits::destroy(*this, _Ptr);
  12446. ; 910 : }
  12447.  
  12448. ret 4
  12449. ??$destroy@PAD@?$_Wrap_alloc@V?$allocator@D@std@@@std@@QAEXPAPAD@Z ENDP ; std::_Wrap_alloc<std::allocator<char> >::destroy<char *>
  12450. _TEXT ENDS
  12451. ; Function compile flags: /Ogtp
  12452. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xstddef
  12453. ; COMDAT ??$addressof@D@std@@YAPADAAD@Z
  12454. _TEXT SEGMENT
  12455. ??$addressof@D@std@@YAPADAAD@Z PROC ; std::addressof<char>, COMDAT
  12456. ; __Val$ = ecx
  12457.  
  12458. ; 86 : return (reinterpret_cast<_Ty *>(
  12459. ; 87 : (&const_cast<char&>(
  12460. ; 88 : reinterpret_cast<const volatile char&>(_Val)))));
  12461.  
  12462. mov eax, ecx
  12463.  
  12464. ; 89 : }
  12465.  
  12466. ret 0
  12467. ??$addressof@D@std@@YAPADAAD@Z ENDP ; std::addressof<char>
  12468. _TEXT ENDS
  12469. ; Function compile flags: /Ogtp
  12470. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  12471. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  12472. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  12473. ; COMDAT ??$_Uninitialized_default_fill_n@PANIU?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPANIAAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z
  12474. _TEXT SEGMENT
  12475. __Al$dead$ = 8 ; size = 4
  12476. ??$_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
  12477. ; __First$ = ecx
  12478. ; __Count$ = edx
  12479.  
  12480. ; 668 : { // copy _Count * _Val_type(_First)() to raw _First, using _Al
  12481.  
  12482. push edi
  12483. mov edi, ecx
  12484. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  12485.  
  12486. ; 2678 : for (; 0 < _Count; --_Count, ++_Dest)
  12487.  
  12488. test edx, edx
  12489. je SHORT $LN11@Uninitiali
  12490. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  12491.  
  12492. ; 660 : _Fill_n(_First, _Count, (_Valty)0);
  12493.  
  12494. and edx, 536870911 ; 1fffffffH
  12495. add edx, edx
  12496. mov ecx, edx
  12497. xor eax, eax
  12498. rep stosd
  12499. $LN11@Uninitiali:
  12500. pop edi
  12501.  
  12502. ; 669 : _Uninit_def_fill_n(_First, _Count, _Al,
  12503. ; 670 : _Val_type(_First), _Ptr_cat(_First, _First));
  12504. ; 671 : }
  12505.  
  12506. ret 0
  12507. ??$_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> > >
  12508. _TEXT ENDS
  12509. ; Function compile flags: /Ogtp
  12510. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12511. ; COMDAT ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@H@std@@@std@@@std@@YAXPAH0AAU?$_Wrap_alloc@V?$allocator@H@std@@@0@@Z
  12512. _TEXT SEGMENT
  12513. __Al$dead$ = 8 ; size = 4
  12514. ??$_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
  12515. ; __First$dead$ = ecx
  12516. ; __Last$dead$ = edx
  12517.  
  12518. ; 80 : _Destroy_range(_First, _Last, _Al, _Ptr_cat(_First, _Last));
  12519. ; 81 : }
  12520.  
  12521. ret 0
  12522. ??$_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> > >
  12523. _TEXT ENDS
  12524. ; Function compile flags: /Ogtp
  12525. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  12526. ; COMDAT ??$_Move@PANPAN@std@@YAPANPAN00@Z
  12527. _TEXT SEGMENT
  12528. __Dest$ = 8 ; size = 4
  12529. ??$_Move@PANPAN@std@@YAPANPAN00@Z PROC ; std::_Move<double *,double *>, COMDAT
  12530. ; __First$ = ecx
  12531. ; __Last$ = edx
  12532.  
  12533. ; 2485 : { // move [_First, _Last) to [_Dest, ...), unchecked
  12534.  
  12535. push ebp
  12536. mov ebp, esp
  12537. push esi
  12538.  
  12539. ; 2476 : _CSTD memmove(&*_Dest, &*_First,
  12540. ; 2477 : _Count * sizeof (*_First));
  12541.  
  12542. mov esi, DWORD PTR __Dest$[ebp]
  12543. sub edx, ecx
  12544. push edi
  12545.  
  12546. ; 2475 : ptrdiff_t _Count = _Last - _First;
  12547.  
  12548. sar edx, 3
  12549.  
  12550. ; 2476 : _CSTD memmove(&*_Dest, &*_First,
  12551. ; 2477 : _Count * sizeof (*_First));
  12552.  
  12553. lea edi, DWORD PTR [edx*8]
  12554. push edi
  12555. push ecx
  12556. push esi
  12557. call DWORD PTR __imp__memmove
  12558. add esp, 12 ; 0000000cH
  12559.  
  12560. ; 2478 : return (_Dest + _Count);
  12561.  
  12562. lea eax, DWORD PTR [edi+esi]
  12563. pop edi
  12564. pop esi
  12565.  
  12566. ; 2486 : return (_Move(_First, _Last,
  12567. ; 2487 : _Dest, _Ptr_cat(_First, _Dest)));
  12568. ; 2488 : }
  12569.  
  12570. pop ebp
  12571. ret 0
  12572. ??$_Move@PANPAN@std@@YAPANPAN00@Z ENDP ; std::_Move<double *,double *>
  12573. _TEXT ENDS
  12574. ; Function compile flags: /Ogtp
  12575. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12576. ; COMDAT ??$_Destroy_range@U?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAXPAN0AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z
  12577. _TEXT SEGMENT
  12578. __Al$dead$ = 8 ; size = 4
  12579. ??$_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
  12580. ; __First$dead$ = ecx
  12581. ; __Last$dead$ = edx
  12582.  
  12583. ; 80 : _Destroy_range(_First, _Last, _Al, _Ptr_cat(_First, _Last));
  12584. ; 81 : }
  12585.  
  12586. ret 0
  12587. ??$_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> > >
  12588. _TEXT ENDS
  12589. ; Function compile flags: /Ogtp
  12590. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  12591. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  12592. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  12593. ; COMDAT ??$_Umove@PAN@?$vector@NV?$allocator@N@std@@@std@@IAEPANPAN00@Z
  12594. _TEXT SEGMENT
  12595. __First$ = 8 ; size = 4
  12596. __Last$ = 12 ; size = 4
  12597. __Ptr$ = 16 ; size = 4
  12598. ??$_Umove@PAN@?$vector@NV?$allocator@N@std@@@std@@IAEPANPAN00@Z PROC ; std::vector<double,std::allocator<double> >::_Umove<double *>, COMDAT
  12599. ; _this$dead$ = ecx
  12600.  
  12601. ; 1557 : pointer _Umove(_Iter _First, _Iter _Last, pointer _Ptr)
  12602.  
  12603. push ebp
  12604. mov ebp, esp
  12605. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  12606.  
  12607. ; 461 : size_t _Count = (size_t)(_Last - _First);
  12608.  
  12609. mov ecx, DWORD PTR __First$[ebp]
  12610. mov eax, DWORD PTR __Last$[ebp]
  12611. sub eax, ecx
  12612. push esi
  12613. sar eax, 3
  12614.  
  12615. ; 462 : return ((_Ty2 *)_CSTD memmove(&*_Dest, &*_First,
  12616. ; 463 : _Count * sizeof (*_First)) + _Count); // NB: non-overlapping move
  12617.  
  12618. lea esi, DWORD PTR [eax*8]
  12619. push esi
  12620. push ecx
  12621. push DWORD PTR __Ptr$[ebp]
  12622. call DWORD PTR __imp__memmove
  12623. add esp, 12 ; 0000000cH
  12624. add eax, esi
  12625. pop esi
  12626. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\vector
  12627.  
  12628. ; 1562 : }
  12629.  
  12630. pop ebp
  12631. ret 12 ; 0000000cH
  12632. ??$_Umove@PAN@?$vector@NV?$allocator@N@std@@@std@@IAEPANPAN00@Z ENDP ; std::vector<double,std::allocator<double> >::_Umove<double *>
  12633. _TEXT ENDS
  12634. ; Function compile flags: /Ogtp
  12635. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12636. ; COMDAT ??$_Allocate@N@std@@YAPANIPAN@Z
  12637. _TEXT SEGMENT
  12638. ??$_Allocate@N@std@@YAPANIPAN@Z PROC ; std::_Allocate<double>, COMDAT
  12639. ; __Count$ = ecx
  12640.  
  12641. ; 23 : void *_Ptr = 0;
  12642. ; 24 :
  12643. ; 25 : if (_Count == 0)
  12644. ; 26 : ;
  12645. ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
  12646. ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
  12647.  
  12648. cmp ecx, 536870911 ; 1fffffffH
  12649. ja SHORT $LN1@Allocate
  12650. lea eax, DWORD PTR [ecx*8]
  12651. push eax
  12652. call DWORD PTR __imp_??2@YAPAXI@Z
  12653. add esp, 4
  12654. test eax, eax
  12655. jne SHORT $LN7@Allocate
  12656. $LN1@Allocate:
  12657.  
  12658. ; 29 : _Xbad_alloc(); // report no memory
  12659.  
  12660. jmp DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
  12661. $LN7@Allocate:
  12662.  
  12663. ; 30 :
  12664. ; 31 : return ((_Ty *)_Ptr);
  12665. ; 32 : }
  12666.  
  12667. ret 0
  12668. ??$_Allocate@N@std@@YAPANIPAN@Z ENDP ; std::_Allocate<double>
  12669. _TEXT ENDS
  12670. ; Function compile flags: /Ogtp
  12671. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12672. ; COMDAT ??$_Allocate@D@std@@YAPADIPAD@Z
  12673. _TEXT SEGMENT
  12674. ??$_Allocate@D@std@@YAPADIPAD@Z PROC ; std::_Allocate<char>, COMDAT
  12675. ; __Count$ = ecx
  12676.  
  12677. ; 23 : void *_Ptr = 0;
  12678. ; 24 :
  12679. ; 25 : if (_Count == 0)
  12680. ; 26 : ;
  12681. ; 27 : else if (((size_t)(-1) / sizeof (_Ty) < _Count)
  12682. ; 28 : || (_Ptr = ::operator new(_Count * sizeof (_Ty))) == 0)
  12683.  
  12684. cmp ecx, -1
  12685. ja SHORT $LN1@Allocate
  12686. push ecx
  12687. call DWORD PTR __imp_??2@YAPAXI@Z
  12688. add esp, 4
  12689. test eax, eax
  12690. jne SHORT $LN7@Allocate
  12691. $LN1@Allocate:
  12692.  
  12693. ; 29 : _Xbad_alloc(); // report no memory
  12694.  
  12695. jmp DWORD PTR __imp_?_Xbad_alloc@std@@YAXXZ
  12696. $LN7@Allocate:
  12697.  
  12698. ; 30 :
  12699. ; 31 : return ((_Ty *)_Ptr);
  12700. ; 32 : }
  12701.  
  12702. ret 0
  12703. ??$_Allocate@D@std@@YAPADIPAD@Z ENDP ; std::_Allocate<char>
  12704. _TEXT ENDS
  12705. ; Function compile flags: /Ogtp
  12706. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\system_error
  12707. ; COMDAT ??__F?_System_object@?$_Error_objects@H@std@@2V_System_error_category@2@A@@YAXXZ
  12708. text$yd SEGMENT
  12709. ??__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
  12710.  
  12711. ; 167 : { // destroy the object
  12712.  
  12713. 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
  12714. ret 0
  12715. ??__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''
  12716. text$yd ENDS
  12717. ; Function compile flags: /Ogtp
  12718. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\system_error
  12719. ; COMDAT ??__F?_Iostream_object@?$_Error_objects@H@std@@2V_Iostream_error_category@2@A@@YAXXZ
  12720. text$yd SEGMENT
  12721. ??__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
  12722.  
  12723. ; 167 : { // destroy the object
  12724.  
  12725. 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
  12726. ret 0
  12727. ??__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''
  12728. text$yd ENDS
  12729. ; Function compile flags: /Ogtp
  12730. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\system_error
  12731. ; COMDAT ??__F?_Generic_object@?$_Error_objects@H@std@@2V_Generic_error_category@2@A@@YAXXZ
  12732. text$yd SEGMENT
  12733. ??__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
  12734.  
  12735. ; 167 : { // destroy the object
  12736.  
  12737. 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
  12738. ret 0
  12739. ??__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''
  12740. text$yd ENDS
  12741. ; Function compile flags: /Ogtp
  12742. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\type_traits
  12743. ; COMDAT ??$forward@AAPAD@std@@YAAAPADAAPAD@Z
  12744. _TEXT SEGMENT
  12745. ??$forward@AAPAD@std@@YAAAPADAAPAD@Z PROC ; std::forward<char * &>, COMDAT
  12746. ; __Arg$ = ecx
  12747.  
  12748. ; 1776 : return (static_cast<_Ty&&>(_Arg));
  12749.  
  12750. mov eax, ecx
  12751.  
  12752. ; 1777 : }
  12753.  
  12754. ret 0
  12755. ??$forward@AAPAD@std@@YAAAPADAAPAD@Z ENDP ; std::forward<char * &>
  12756. _TEXT ENDS
  12757. ; Function compile flags: /Ogtp
  12758. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12759. ; COMDAT ??$construct@PADAAPAD@?$allocator_traits@V?$allocator@D@std@@@std@@SAXAAV?$allocator@D@1@PAPADAAPAD@Z
  12760. _TEXT SEGMENT
  12761. __V0$ = 8 ; size = 4
  12762. ??$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
  12763. ; __Al$dead$ = ecx
  12764. ; __Ptr$ = edx
  12765.  
  12766. ; 751 : _VARIADIC_EXPAND_0X(_ALLOC_TRAITS_SPECIAL_CONSTRUCT, , , , )
  12767.  
  12768. push ebp
  12769. mov ebp, esp
  12770.  
  12771. ; 617 : _VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
  12772.  
  12773. test edx, edx
  12774. je SHORT $LN7@construct
  12775. mov eax, DWORD PTR __V0$[ebp]
  12776. mov eax, DWORD PTR [eax]
  12777. mov DWORD PTR [edx], eax
  12778. $LN7@construct:
  12779.  
  12780. ; 751 : _VARIADIC_EXPAND_0X(_ALLOC_TRAITS_SPECIAL_CONSTRUCT, , , , )
  12781.  
  12782. pop ebp
  12783. ret 0
  12784. ??$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 * &>
  12785. _TEXT ENDS
  12786. ; Function compile flags: /Ogtp
  12787. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12788. ; COMDAT ??$destroy@PAD@?$allocator_traits@V?$allocator@D@std@@@std@@SAXAAV?$allocator@D@1@PAPAD@Z
  12789. _TEXT SEGMENT
  12790. ??$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
  12791. ; __Al$dead$ = ecx
  12792. ; __Ptr$dead$ = edx
  12793.  
  12794. ; 756 : { // destroy object at _Ptr
  12795. ; 757 : _Al.destroy(_Ptr);
  12796. ; 758 : }
  12797.  
  12798. ret 0
  12799. ??$destroy@PAD@?$allocator_traits@V?$allocator@D@std@@@std@@SAXAAV?$allocator@D@1@PAPAD@Z ENDP ; std::allocator_traits<std::allocator<char> >::destroy<char *>
  12800. _TEXT ENDS
  12801. ; Function compile flags: /Ogtp
  12802. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  12803. ; COMDAT ??$_Val_type@PAN@std@@YAPANPAN@Z
  12804. _TEXT SEGMENT
  12805. ??$_Val_type@PAN@std@@YAPANPAN@Z PROC ; std::_Val_type<double *>, COMDAT
  12806. ; ___formal$dead$ = ecx
  12807.  
  12808. ; 711 : return (0);
  12809.  
  12810. xor eax, eax
  12811.  
  12812. ; 712 : }
  12813.  
  12814. ret 0
  12815. ??$_Val_type@PAN@std@@YAPANPAN@Z ENDP ; std::_Val_type<double *>
  12816. _TEXT ENDS
  12817. ; Function compile flags: /Ogtp
  12818. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  12819. ; COMDAT ??$_Ptr_cat@NN@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAN0@Z
  12820. _TEXT SEGMENT
  12821. __Cat$ = -1 ; size = 1
  12822. ??$_Ptr_cat@NN@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAN0@Z PROC ; std::_Ptr_cat<double,double>, COMDAT
  12823. ; ___formal$dead$ = ecx
  12824. ; ___formal$dead$ = edx
  12825.  
  12826. ; 437 : { // return pointer category from pointers
  12827.  
  12828. push ebp
  12829. mov ebp, esp
  12830. push ecx
  12831.  
  12832. ; 438 : typename _Ptr_cat_helper<_Elem1, _Elem2>::type _Cat;
  12833. ; 439 : return (_Cat);
  12834.  
  12835. mov al, BYTE PTR __Cat$[ebp]
  12836.  
  12837. ; 440 : }
  12838.  
  12839. mov esp, ebp
  12840. pop ebp
  12841. ret 0
  12842. ??$_Ptr_cat@NN@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAN0@Z ENDP ; std::_Ptr_cat<double,double>
  12843. _TEXT ENDS
  12844. ; Function compile flags: /Ogtp
  12845. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  12846. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  12847. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  12848. ; COMDAT ??$_Uninit_def_fill_n@NIN@std@@YAXPANIAAU?$_Wrap_alloc@V?$allocator@N@std@@@0@0U_Scalar_ptr_iterator_tag@0@@Z
  12849. _TEXT SEGMENT
  12850. ___formal$dead$ = 8 ; size = 4
  12851. ___formal$dead$ = 12 ; size = 4
  12852. ___formal$ = 16 ; size = 1
  12853. ??$_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
  12854. ; __First$ = ecx
  12855. ; __Count$ = edx
  12856.  
  12857. ; 659 : { // copy _Count * _Valty() to raw _First, using _Al, scalar type
  12858.  
  12859. push edi
  12860. mov edi, ecx
  12861. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  12862.  
  12863. ; 2678 : for (; 0 < _Count; --_Count, ++_Dest)
  12864.  
  12865. test edx, edx
  12866. je SHORT $LN5@Uninit_def
  12867. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  12868.  
  12869. ; 660 : _Fill_n(_First, _Count, (_Valty)0);
  12870.  
  12871. and edx, 536870911 ; 1fffffffH
  12872. add edx, edx
  12873. mov ecx, edx
  12874. xor eax, eax
  12875. rep stosd
  12876. $LN5@Uninit_def:
  12877. pop edi
  12878.  
  12879. ; 661 : }
  12880.  
  12881. ret 0
  12882. ??$_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>
  12883. _TEXT ENDS
  12884. ; Function compile flags: /Ogtp
  12885. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  12886. ; COMDAT ??$_Ptr_cat@HH@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAH0@Z
  12887. _TEXT SEGMENT
  12888. __Cat$ = -1 ; size = 1
  12889. ??$_Ptr_cat@HH@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAH0@Z PROC ; std::_Ptr_cat<int,int>, COMDAT
  12890. ; ___formal$dead$ = ecx
  12891. ; ___formal$dead$ = edx
  12892.  
  12893. ; 437 : { // return pointer category from pointers
  12894.  
  12895. push ebp
  12896. mov ebp, esp
  12897. push ecx
  12898.  
  12899. ; 438 : typename _Ptr_cat_helper<_Elem1, _Elem2>::type _Cat;
  12900. ; 439 : return (_Cat);
  12901.  
  12902. mov al, BYTE PTR __Cat$[ebp]
  12903.  
  12904. ; 440 : }
  12905.  
  12906. mov esp, ebp
  12907. pop ebp
  12908. ret 0
  12909. ??$_Ptr_cat@HH@std@@YA?AU_Scalar_ptr_iterator_tag@0@PAH0@Z ENDP ; std::_Ptr_cat<int,int>
  12910. _TEXT ENDS
  12911. ; Function compile flags: /Ogtp
  12912. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12913. ; 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
  12914. _TEXT SEGMENT
  12915. __Al$dead$ = 8 ; size = 4
  12916. ___formal$ = 12 ; size = 1
  12917. ??$_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
  12918. ; __First$dead$ = ecx
  12919. ; __Last$dead$ = edx
  12920.  
  12921. ; 97 : }
  12922.  
  12923. ret 0
  12924. ??$_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> > >
  12925. _TEXT ENDS
  12926. ; Function compile flags: /Ogtp
  12927. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  12928. ; COMDAT ??$_Move@PANPAN@std@@YAPANPAN00U_Scalar_ptr_iterator_tag@0@@Z
  12929. _TEXT SEGMENT
  12930. __Dest$ = 8 ; size = 4
  12931. ___formal$ = 12 ; size = 1
  12932. ??$_Move@PANPAN@std@@YAPANPAN00U_Scalar_ptr_iterator_tag@0@@Z PROC ; std::_Move<double *,double *>, COMDAT
  12933. ; __First$ = ecx
  12934. ; __Last$ = edx
  12935.  
  12936. ; 2474 : { // move [_First, _Last) to [_Dest, ...), pointers to scalars
  12937.  
  12938. push ebp
  12939. mov ebp, esp
  12940. push esi
  12941.  
  12942. ; 2475 : ptrdiff_t _Count = _Last - _First;
  12943. ; 2476 : _CSTD memmove(&*_Dest, &*_First,
  12944. ; 2477 : _Count * sizeof (*_First));
  12945.  
  12946. mov esi, DWORD PTR __Dest$[ebp]
  12947. sub edx, ecx
  12948. push edi
  12949. sar edx, 3
  12950. lea edi, DWORD PTR [edx*8]
  12951. push edi
  12952. push ecx
  12953. push esi
  12954. call DWORD PTR __imp__memmove
  12955. add esp, 12 ; 0000000cH
  12956.  
  12957. ; 2478 : return (_Dest + _Count);
  12958.  
  12959. lea eax, DWORD PTR [edi+esi]
  12960. pop edi
  12961. pop esi
  12962.  
  12963. ; 2479 : }
  12964.  
  12965. pop ebp
  12966. ret 0
  12967. ??$_Move@PANPAN@std@@YAPANPAN00U_Scalar_ptr_iterator_tag@0@@Z ENDP ; std::_Move<double *,double *>
  12968. _TEXT ENDS
  12969. ; Function compile flags: /Ogtp
  12970. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  12971. ; 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
  12972. _TEXT SEGMENT
  12973. __Al$dead$ = 8 ; size = 4
  12974. ___formal$ = 12 ; size = 1
  12975. ??$_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
  12976. ; __First$dead$ = ecx
  12977. ; __Last$dead$ = edx
  12978.  
  12979. ; 97 : }
  12980.  
  12981. ret 0
  12982. ??$_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> > >
  12983. _TEXT ENDS
  12984. ; Function compile flags: /Ogtp
  12985. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  12986. ; COMDAT ??$_Uninitialized_move@PANPANU?$_Wrap_alloc@V?$allocator@N@std@@@std@@@std@@YAPANPAN00AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@@Z
  12987. _TEXT SEGMENT
  12988. __Dest$ = 8 ; size = 4
  12989. __Al$dead$ = 12 ; size = 4
  12990. ??$_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
  12991. ; __First$ = ecx
  12992. ; __Last$ = edx
  12993.  
  12994. ; 471 : { // move [_First, _Last) to raw _Dest, using _Al
  12995.  
  12996. push ebp
  12997. mov ebp, esp
  12998.  
  12999. ; 461 : size_t _Count = (size_t)(_Last - _First);
  13000.  
  13001. sub edx, ecx
  13002. push esi
  13003. sar edx, 3
  13004.  
  13005. ; 462 : return ((_Ty2 *)_CSTD memmove(&*_Dest, &*_First,
  13006. ; 463 : _Count * sizeof (*_First)) + _Count); // NB: non-overlapping move
  13007.  
  13008. lea esi, DWORD PTR [edx*8]
  13009. push esi
  13010. push ecx
  13011. push DWORD PTR __Dest$[ebp]
  13012. call DWORD PTR __imp__memmove
  13013. add esp, 12 ; 0000000cH
  13014. add eax, esi
  13015. pop esi
  13016.  
  13017. ; 472 : return (_Uninit_move(_First, _Last, _Dest, _Al,
  13018. ; 473 : _Val_type(_First), _Ptr_cat(_First, _Dest)));
  13019. ; 474 : }
  13020.  
  13021. pop ebp
  13022. ret 0
  13023. ??$_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> > >
  13024. _TEXT ENDS
  13025. ; Function compile flags: /Ogtp
  13026. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  13027. ; COMDAT ??$construct@PADAAPAD@?$allocator@D@std@@QAEXPAPADAAPAD@Z
  13028. _TEXT SEGMENT
  13029. __Ptr$ = 8 ; size = 4
  13030. __V0$ = 12 ; size = 4
  13031. ??$construct@PADAAPAD@?$allocator@D@std@@QAEXPAPADAAPAD@Z PROC ; std::allocator<char>::construct<char *,char * &>, COMDAT
  13032. ; _this$dead$ = ecx
  13033.  
  13034. ; 617 : _VARIADIC_EXPAND_0X(_ALLOC_MEMBER_CONSTRUCT, , , , )
  13035.  
  13036. push ebp
  13037. mov ebp, esp
  13038. mov ecx, DWORD PTR __Ptr$[ebp]
  13039. test ecx, ecx
  13040. je SHORT $LN3@construct
  13041. mov eax, DWORD PTR __V0$[ebp]
  13042. mov eax, DWORD PTR [eax]
  13043. mov DWORD PTR [ecx], eax
  13044. $LN3@construct:
  13045. pop ebp
  13046. ret 8
  13047. ??$construct@PADAAPAD@?$allocator@D@std@@QAEXPAPADAAPAD@Z ENDP ; std::allocator<char>::construct<char *,char * &>
  13048. _TEXT ENDS
  13049. ; Function compile flags: /Ogtp
  13050. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory0
  13051. ; COMDAT ??$destroy@PAD@?$allocator@D@std@@QAEXPAPAD@Z
  13052. _TEXT SEGMENT
  13053. __Ptr$dead$ = 8 ; size = 4
  13054. ??$destroy@PAD@?$allocator@D@std@@QAEXPAPAD@Z PROC ; std::allocator<char>::destroy<char *>, COMDAT
  13055. ; _this$dead$ = ecx
  13056.  
  13057. ; 622 : { // destroy object at _Ptr
  13058. ; 623 : _Ptr->~_Uty();
  13059. ; 624 : }
  13060.  
  13061. ret 4
  13062. ??$destroy@PAD@?$allocator@D@std@@QAEXPAPAD@Z ENDP ; std::allocator<char>::destroy<char *>
  13063. _TEXT ENDS
  13064. ; Function compile flags: /Ogtp
  13065. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility
  13066. ; COMDAT ??$_Fill_n@PANIN@std@@YAPANPANIABN@Z
  13067. _TEXT SEGMENT
  13068. __Val$ = 8 ; size = 4
  13069. ??$_Fill_n@PANIN@std@@YAPANPANIABN@Z PROC ; std::_Fill_n<double *,unsigned int,double>, COMDAT
  13070. ; __Dest$ = ecx
  13071. ; __Count$ = edx
  13072.  
  13073. ; 2677 : { // copy _Val _Count times through [_Dest, ...)
  13074.  
  13075. push ebp
  13076. mov ebp, esp
  13077.  
  13078. ; 2678 : for (; 0 < _Count; --_Count, ++_Dest)
  13079.  
  13080. test edx, edx
  13081. je SHORT $LN9@Fill_n
  13082. mov eax, DWORD PTR __Val$[ebp]
  13083. npad 6
  13084. $LL3@Fill_n:
  13085.  
  13086. ; 2679 : *_Dest = _Val;
  13087.  
  13088. movsd xmm0, QWORD PTR [eax]
  13089. movsd QWORD PTR [ecx], xmm0
  13090. add ecx, 8
  13091. dec edx
  13092. jne SHORT $LL3@Fill_n
  13093. $LN9@Fill_n:
  13094.  
  13095. ; 2680 : return (_Dest);
  13096.  
  13097. mov eax, ecx
  13098.  
  13099. ; 2681 : }
  13100.  
  13101. pop ebp
  13102. ret 0
  13103. ??$_Fill_n@PANIN@std@@YAPANPANIABN@Z ENDP ; std::_Fill_n<double *,unsigned int,double>
  13104. _TEXT ENDS
  13105. ; Function compile flags: /Ogtp
  13106. ; File c:\program files (x86)\microsoft visual studio 11.0\vc\include\xmemory
  13107. ; COMDAT ??$_Uninit_move@NNN@std@@YAPANPAN00AAU?$_Wrap_alloc@V?$allocator@N@std@@@0@0U_Scalar_ptr_iterator_tag@0@@Z
  13108. _TEXT SEGMENT
  13109. __Dest$ = 8 ; size = 4
  13110. ___formal$dead$ = 12 ; size = 4
  13111. ___formal$dead$ = 16 ; size = 4
  13112. ___formal$ = 20 ; size = 1
  13113. ??$_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
  13114. ; __First$ = ecx
  13115. ; __Last$ = edx
  13116.  
  13117. ; 458 : { // move [_First, _Last) to raw _Dest, scalar type
  13118.  
  13119. push ebp
  13120. mov ebp, esp
  13121.  
  13122. ; 459 : _DEBUG_RANGE(_First, _Last);
  13123. ; 460 : _DEBUG_POINTER(_Dest);
  13124. ; 461 : size_t _Count = (size_t)(_Last - _First);
  13125.  
  13126. sub edx, ecx
  13127. push esi
  13128. sar edx, 3
  13129.  
  13130. ; 462 : return ((_Ty2 *)_CSTD memmove(&*_Dest, &*_First,
  13131. ; 463 : _Count * sizeof (*_First)) + _Count); // NB: non-overlapping move
  13132.  
  13133. lea esi, DWORD PTR [edx*8]
  13134. push esi
  13135. push ecx
  13136. push DWORD PTR __Dest$[ebp]
  13137. call DWORD PTR __imp__memmove
  13138. add esp, 12 ; 0000000cH
  13139. add eax, esi
  13140. pop esi
  13141.  
  13142. ; 464 : }
  13143.  
  13144. pop ebp
  13145. ret 0
  13146. ??$_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>
  13147. _TEXT ENDS
  13148. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement