static _RopeRep* _S_concat_char_iter(_RopeRep* __r,
const _CharT* __iter,
- size_type __slen);
- // Concatenate rope and char ptr, copying __s.
+ size_type __slen,
+ allocator_type& __a);
+ // Concatenate rope and char ptr, copying __iter.
// Should really take an arbitrary iterator.
// Result is counted in refcount.
static _RopeRep* _S_destr_concat_char_iter(_RopeRep* __r,
const _CharT* __iter,
- size_type __slen)
+ size_type __slen,
+ allocator_type& __a)
// As above, but one reference to __r is about to be
// destroyed. Thus the pieces may be recycled if all
// relevant reference counts are 1.
#ifdef __GC
// We can't really do anything since refcounts are unavailable.
- { return _S_concat_char_iter(__r, __iter, __slen); }
+ { return _S_concat_char_iter(__r, __iter, __slen, __a); }
#else
;
#endif
void
push_back(_CharT __x)
{
+ allocator_type __a = _M_get_allocator();
_RopeRep* __old = this->_M_tree_ptr;
this->_M_tree_ptr
- = _S_destr_concat_char_iter(this->_M_tree_ptr, &__x, 1);
+ = _S_destr_concat_char_iter(this->_M_tree_ptr, &__x, 1, __a);
_S_unref(__old);
}
rope&
append(const _CharT* __iter, size_type __n)
{
+ allocator_type __a = _M_get_allocator();
_RopeRep* __result =
- _S_destr_concat_char_iter(this->_M_tree_ptr, __iter, __n);
+ _S_destr_concat_char_iter(this->_M_tree_ptr, __iter, __n, __a);
_S_unref(this->_M_tree_ptr);
this->_M_tree_ptr = __result;
return *this;
rope&
append(const _CharT* __s, const _CharT* __e)
{
+ allocator_type __a = _M_get_allocator();
_RopeRep* __result =
- _S_destr_concat_char_iter(this->_M_tree_ptr, __s, __e - __s);
+ _S_destr_concat_char_iter(this->_M_tree_ptr, __s, __e - __s, __a);
_S_unref(this->_M_tree_ptr);
this->_M_tree_ptr = __result;
return *this;
rope&
append(_CharT __c)
{
+ allocator_type __a = _M_get_allocator();
_RopeRep* __result =
- _S_destr_concat_char_iter(this->_M_tree_ptr, &__c, 1);
+ _S_destr_concat_char_iter(this->_M_tree_ptr, &__c, 1, __a);
_S_unref(this->_M_tree_ptr);
this->_M_tree_ptr = __result;
return *this;
_Self_destruct_ptr __left(_S_substring(this->_M_tree_ptr, 0, __p));
_Self_destruct_ptr __right(_S_substring(this->_M_tree_ptr,
__p, size()));
- _Self_destruct_ptr __left_result(_S_concat_char_iter(__left, __i, __n));
+ _Self_destruct_ptr __left_result(_S_concat_char_iter(__left, __i, __n,
+ _M_get_allocator()));
// _S_ destr_concat_char_iter should be safe here.
// But as it stands it's probably not a win, since __left
// is likely to have additional references.
{
typedef rope<_CharT, _Alloc> rope_type;
std::size_t __rlen = rope_type::_S_char_ptr_len(__right);
+ _Alloc __a = __left.get_allocator();
return rope_type(rope_type::_S_concat_char_iter(__left._M_tree_ptr,
- __right, __rlen));
+ __right, __rlen, __a));
}
template <class _CharT, class _Alloc>
operator+(const rope<_CharT, _Alloc>& __left, _CharT __right)
{
typedef rope<_CharT, _Alloc> rope_type;
+ _Alloc __a = __left.get_allocator();
return rope_type(rope_type::_S_concat_char_iter(__left._M_tree_ptr,
- &__right, 1));
+ &__right, 1, __a));
}
template <class _CharT, class _Alloc>
template <class _CharT, class _Alloc>
typename rope<_CharT, _Alloc>::_RopeRep*
rope<_CharT, _Alloc>::
- _S_concat_char_iter(_RopeRep* __r, const _CharT*__s, std::size_t __slen)
+ _S_concat_char_iter(_RopeRep* __r, const _CharT*__s, std::size_t __slen,
+ allocator_type& __a)
{
using std::size_t;
_RopeRep* __result;
return __r;
}
if (0 == __r)
- return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
- __r->_M_get_allocator());
+ return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __a);
if (__r->_M_tag == __detail::_S_leaf
&& __r->_M_size + __slen <= size_t(_S_copy_max))
{
return __result;
}
}
- _RopeRep* __nright =
- __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->_M_get_allocator());
+ _RopeRep* __nright = __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __a);
__try
{
__r->_M_ref_nonnil();
typename rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::
_S_destr_concat_char_iter(_RopeRep* __r, const _CharT* __s,
- std::size_t __slen)
+ std::size_t __slen, allocator_type& __a)
{
using std::size_t;
_RopeRep* __result;
if (0 == __r)
- return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
- __r->_M_get_allocator());
+ return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __a);
size_t __count = __r->_M_ref_count;
size_t __orig_size = __r->_M_size;
if (__count > 1)
- return _S_concat_char_iter(__r, __s, __slen);
+ return _S_concat_char_iter(__r, __s, __slen, __a);
if (0 == __slen)
{
__r->_M_ref_count = 2; // One more than before
return __r;
}
}
- _RopeRep* __right =
- __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __r->_M_get_allocator());
+ _RopeRep* __right = __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen, __a);
__r->_M_ref_nonnil();
__try
{ __result = _S_tree_concat(__r, __right); }
_Self_destruct_ptr __left(_My_rope::_S_substring(__old, 0, _M_pos));
_Self_destruct_ptr __right(_My_rope::_S_substring(__old, _M_pos + 1,
__old->_M_size));
+ typename _RopeRep::allocator_type __a = _M_root->_M_get_allocator();
_Self_destruct_ptr __result_left(_My_rope::
_S_destr_concat_char_iter(__left,
- &__c, 1));
+ &__c, 1,
+ __a));
_RopeRep* __result = _My_rope::_S_concat(__result_left, __right);
#ifndef __GC