20#if defined (_STLP_DEBUG)
21# define basic_string _STLP_NON_DBG_NAME(str)
25#define _STLP_NO_MEM_T_STRING_BASE _STLP_PRIV _STLP_NO_MEM_T_NAME(str)<_CharT, _Traits, _Alloc>
27template <
class _CharT,
class _Traits,
class _Alloc>
29#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (basic_string)
45#include <stl/_string_npos.h>
74#if !defined (_STLP_NO_MOVE_SEMANTIC)
81 template <
class _InputIterator>
88# if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS)
89 template <
class _InputIterator>
98 _Base::operator=(__s);
103 _Base::operator=(__s);
108 _Base::operator=(
__c);
113 template <
class _InputIter>
116 this->_M_allocate_block();
117 this->_M_construct_null(this->_M_Finish());
121 template <
class _ForwardIter>
125 this->_M_allocate_block(
__n + 1);
130 template <
class _InputIter>
135 template <
class _Integer>
137 this->_M_allocate_block(
__n + 1);
142 template <
class _InputIter>
149 _Base::operator+=(__s);
154 _Base::operator+=(__s);
158 _Base::operator+=(
__c);
169 _Base::append(__s, __pos,
__n);
175 _Base::append(__s,
__n);
190 template <
class _InputIter>
196#if !defined (_STLP_NO_METHOD_SPECIALIZATION) && !defined (_STLP_NO_EXTENSIONS)
207 template <
class _InputIter>
215 template <
class _ForwardIter>
220 if (
__n >= this->_M_rest()) {
225 this->_M_construct_null(__new_finish);
226 this->_M_deallocate_block();
227 this->_M_reset(__new_start, __new_finish, __new_start +
__len);
230 _Traits::assign(*this->_M_finish, *
__first++);
232 this->_M_construct_null(this->_M_Finish() +
__n);
233 this->_M_finish +=
__n;
239 template <
class _Integer>
243 template <
class _InputIter>
255 _Base::assign(__s, __pos,
__n);
261 _Base::assign(__s,
__n);
278 template <
class _Integer>
282 template <
class _InputIter>
284 pointer __cur = this->_M_Start();
285 while (
__f !=
__l && __cur != this->_M_Finish()) {
286 _Traits::assign(*__cur, *
__f);
291 _Base::erase(__cur, this->_M_Finish());
300 template <
class _InputIter>
306#if !defined (_STLP_NO_METHOD_SPECIALIZATION) && !defined (_STLP_NO_EXTENSIONS)
320 _Base::insert(__pos, __s);
326 _Base::insert(__pos, __s, __beg,
__n);
331 _Base::insert(__pos, __s,
__n);
337 _Base::insert(__pos, __s);
342 _Base::insert(__pos,
__n,
__c);
347 {
return _Base::insert(__p,
__c); }
350 { _Base::insert(__p,
__n,
__c); }
354 template <
class _InputIter>
360#if !defined (_STLP_NO_METHOD_SPECIALIZATION)
374 template <
class _ForwardIter>
382 this->_M_construct_null(__new_finish);
383 this->_M_deallocate_block();
384 this->_M_reset(__new_start, __new_finish, __new_start +
__len);
387 template <
class _InputIter>
396 template <
class _ForwardIter>
401 if (__n < this->_M_rest()) {
402 const size_type __elems_after = this->_M_finish - __pos;
403 if (__elems_after >=
__n) {
405 this->_M_finish +=
__n;
406 _Traits::move(__pos +
__n, __pos, (__elems_after -
__n) + 1);
410 pointer __old_finish = this->_M_Finish();
412 _STLP_STD::advance(__mid, __elems_after + 1);
413 _STLP_STD::uninitialized_copy(__mid,
__last, this->_M_Finish() + 1);
414 this->_M_finish +=
__n - __elems_after;
416 this->_M_finish += __elems_after;
426 template <
class _Integer>
431 template <
class _InputIter>
440 template <
class _InputIterator>
444 _Traits::assign(*__result, *
__first);
447#if !defined (_STLP_NO_METHOD_SPECIALIZATION)
450 _Base::_M_copy(
__f,
__l, __res);
456 _Base::erase(__pos,
__n);
462 return _Base::erase(__pos);
473 _Base::replace(__pos,
__n, __s);
479 _Base::replace(__pos1, __n1, __s, __pos2, __n2);
486 _Base::replace(__pos, __n1, __s, __n2);
492 _Base::replace(__pos, __n1, __s);
498 _Base::replace(__pos, __n1, __n2,
__c);
533 template <
class _InputIter>
535 _InputIter
__f, _InputIter
__l) {
541#if !defined (_STLP_NO_METHOD_SPECIALIZATION)
543 const _CharT*
__f,
const _CharT*
__l) {
559 template <
class _Integer>
566 template <
class _InputIter>
572 return _M_replace(__first,
__last, __self._M_Start(), __self._M_Finish(),
false);
577#if defined (_STLP_USE_PARTIAL_SPEC_WORKAROUND) && !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER)
578 void _M_swap_workaround(
_Self& __x) {
swap(__x); }
585#if defined (_STLP_USE_TEMPLATE_EXPRESSION) && !defined (_STLP_DEBUG)
586# define _STLP_STRING_SUM_BASE _STLP_NO_MEM_T_STRING_BASE
588# undef _STLP_STRING_SUM_BASE
592#undef _STLP_NO_MEM_T_STRING_BASE
594#if defined (basic_string)
#define _STLP_ITERATOR_CATEGORY(_It, _Tp)
#define _STLP_NO_MEM_T_STRING_BASE
_STLP_MOVE_TO_STD_NAMESPACE _ForwardIter uninitialized_copy(_InputIter __first, _InputIter __last, _ForwardIter __result)
_STLP_MOVE_TO_STD_NAMESPACE void uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp &__x)
void get(int argc, const char *argv[])
_Self & insert(size_type __pos, size_type __n, _CharT __c)
_STLP_NO_MEM_T_STRING_BASE _Base
void _M_copyT(const _CharT *__f, const _CharT *__l, _CharT *__res)
_Self & _M_replace_dispatch(iterator __first, iterator __last, _Integer __n, _Integer __x, const __true_type &)
_Self & append(const _Self &__s, size_type __pos, size_type __n)
_Self & replace(iterator __first, iterator __last, const _CharT *__f, const _CharT *__l)
basic_string(const _CharT *__s, size_type __n, const allocator_type &__a=allocator_type())
_Self & erase(size_type __pos=0, size_type __n=npos)
_Self & replace(iterator __first, iterator __last, const _CharT *__s, size_type __n)
_Self & _M_appendT(_ForwardIter __first, _ForwardIter __last, const forward_iterator_tag &)
_Self & _M_append_dispatch(_Integer __n, _Integer __x, const __true_type &)
_Self & operator=(const _Self &__s)
_Self & replace(size_type __pos, size_type __n, const _Self &__s)
_Self & assign(const _CharT *__f, const _CharT *__l)
_Self & replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
iterator erase(iterator __pos)
basic_string(const allocator_type &__a=allocator_type())
_Base::size_type size_type
void insert(iterator __p, _InputIter __first, _InputIter __last)
basic_string(_InputIterator __f, _InputIterator __l, const allocator_type &__a _STLP_ALLOCATOR_TYPE_DFL)
_Self & _M_append_dispatch(_InputIter __f, _InputIter __l, const __false_type &)
_Self & _M_replace_dispatch(iterator __first, iterator __last, _InputIter __f, _InputIter __l, const __false_type &)
_Self substr(size_type __pos=0, size_type __n=npos) const
_Self & replace(size_type __pos, size_type __n1, const _CharT *__s)
_Self & assign(const _CharT *__s, size_type __n)
ptrdiff_t difference_type
bool _M_inside(const _CharT *__s) const
void _M_insertT(iterator __pos, _ForwardIter __first, _ForwardIter __last, const forward_iterator_tag &)
_Self & assign(const _Self &__s)
void _M_initialize_dispatch(_InputIter __f, _InputIter __l, const __false_type &)
_Self & replace(size_type __pos, size_type __n1, const _CharT *__s, size_type __n2)
_Self & insert(size_type __pos, const _CharT *__s)
_Self & replace(iterator __first, iterator __last, _InputIter __f, _InputIter __l)
_Self & replace(iterator __first, iterator __last, const _Self &__s)
_Self & assign(const _Self &__s, size_type __pos, size_type __n)
basic_string(const _Self &__s, size_type __pos, size_type __n=npos, const allocator_type &__a=allocator_type())
basic_string(const _CharT *__s, const allocator_type &__a=allocator_type())
_STLP_PRIVATE iterator const _CharT const _CharT * __l
basic_string(_Reserve_t __r, size_t __n, const allocator_type &__a=allocator_type())
_Self & _M_replace(iterator __first, iterator __last, const _CharT *__f, const _CharT *__l, bool __self_ref)
void _M_insertT(iterator __p, _InputIter __first, _InputIter __last, const input_iterator_tag &)
iterator erase(iterator __first, iterator __last)
_Self & operator=(const _CharT *__s)
void insert(iterator __p, const _CharT *__f, const _CharT *__l)
_Self & _M_assign_dispatch(_Integer __n, _Integer __x, const __true_type &)
void _M_insert_dispatch(iterator __p, _Integer __n, _Integer __x, const __true_type &)
void _M_range_initializeT(_InputIter __f, _InputIter __l)
void _M_initialize_dispatch(_Integer __n, _Integer __x, const __true_type &)
_Self & _M_appendT(_InputIter __first, _InputIter __last, const input_iterator_tag &)
void _M_copyT(_InputIterator __first, _InputIterator __last, pointer __result)
void insert(iterator __p, size_t __n, _CharT __c)
_Self & insert(size_type __pos, const _Self &__s)
_Self & operator+=(_CharT __c)
_Self & _M_assign_dispatch(_InputIter __f, _InputIter __l, const __false_type &)
_Self & assign(size_type __n, _CharT __c)
_Self & append(size_type __n, _CharT __c)
_Self & append(const _CharT *__f, const _CharT *__l)
_Self & operator+=(const _Self &__s)
_Self & operator=(_CharT __c)
_STLP_PRIVATE const _CharT const _CharT * __last
_Self & replace(size_type __pos1, size_type __n1, const _Self &__s, size_type __pos2, size_type __n2)
_Self & assign(const _CharT *__s)
void _M_terminate_string()
_Self & insert(size_type __pos, const _CharT *__s, size_type __n)
void _M_insert_overflow(iterator __pos, _ForwardIter __first, _ForwardIter __last, size_type __n)
void _M_insert_dispatch(iterator __p, _InputIter __first, _InputIter __last, const __false_type &)
_Base::allocator_type allocator_type
basic_string(__move_source< _Self > src)
void _M_insert(iterator __p, const _CharT *__f, const _CharT *__l, bool __self_ref)
_Self & replace(iterator __first, iterator __last, const _CharT *__s)
_Self & append(const _CharT *__first, const _CharT *__last)
_STLP_PRIV _String_reserve_t _Reserve_t
_Self & append(const _Self &__s)
iterator insert(iterator __p, _CharT __c)
_Self & insert(size_type __pos, const _Self &__s, size_type __beg, size_type __n)
_STLP_PRIVATE const _CharT * __first
void _M_range_initialize(_InputIter __f, _InputIter __l, const input_iterator_tag &__tag)
_Self & append(const _CharT *__s)
void _M_range_initialize(_ForwardIter __f, _ForwardIter __l, const forward_iterator_tag &)
_STLP_PRIVATE iterator const _CharT * __f
allocator_type get_allocator() const
basic_string(const _Self &__s)
_Self & replace(iterator __first, iterator __last, size_type __n, _CharT __c)
_STLP_PRIVATE const _CharT const _CharT bool __self_ref
_Self & append(const _CharT *__s, size_type __n)
_Self & append(_InputIter __first, _InputIter __last)
basic_string< _CharT, _Traits, _Alloc > _Self
_Self & assign(_InputIter __first, _InputIter __last)
_Base::_CalledFromWorkaround_t _CalledFromWorkaround_t
basic_string(size_type __n, _CharT __c, const allocator_type &__a=allocator_type())
_Self & operator+=(const _CharT *__s)
#define _STLP_MOVE_TO_STD_NAMESPACE
#define __STATIC_CAST(__x, __y)
#define _STLP_ALLOCATOR_TYPE_DFL
#define _STLP_FIX_LITERAL_BUG(__x)
#define __IMPORT_WITH_REVERSE_ITERATORS(_Super)
#define _STLP_BEGIN_NAMESPACE
#define _STLP_END_NAMESPACE
#define _STLP_MOVE_TO_PRIV_NAMESPACE