diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f51f6f1d005d..71d793d6d56b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2004-10-27 Paolo Carlini + + * include/bits/basic_string.h (_M_replace_aux, _M_replace_safe): + Move out of line... + * include/bits/basic_string.tcc: ... here. + 2004-10-26 Paolo Carlini * include/bits/basic_string.h (append(const basic_string&), diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index 6550b9c33622..be340ff9420a 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -1435,24 +1435,11 @@ namespace std basic_string& _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2, - _CharT __c) - { - _M_check_length(__n1, __n2, "basic_string::_M_replace_aux"); - _M_mutate(__pos1, __n1, __n2); - if (__n2) - _M_assign(_M_data() + __pos1, __n2, __c); - return *this; - } + _CharT __c); basic_string& _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s, - size_type __n2) - { - _M_mutate(__pos1, __n1, __n2); - if (__n2) - _M_copy(_M_data() + __pos1, __s, __n2); - return *this; - } + size_type __n2); // _S_construct_aux is used to implement the 21.3.1 para 15 which // requires special behaviour if _InIter is an integral type diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index 6bd129682029..b5f86459b248 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -620,7 +620,32 @@ namespace std return _M_replace_safe(__i1 - _M_ibegin(), __n1, __s._M_data(), __s.size()); } - + + template + basic_string<_CharT, _Traits, _Alloc>& + basic_string<_CharT, _Traits, _Alloc>:: + _M_replace_aux(size_type __pos1, size_type __n1, size_type __n2, + _CharT __c) + { + _M_check_length(__n1, __n2, "basic_string::_M_replace_aux"); + _M_mutate(__pos1, __n1, __n2); + if (__n2) + _M_assign(_M_data() + __pos1, __n2, __c); + return *this; + } + + template + basic_string<_CharT, _Traits, _Alloc>& + basic_string<_CharT, _Traits, _Alloc>:: + _M_replace_safe(size_type __pos1, size_type __n1, const _CharT* __s, + size_type __n2) + { + _M_mutate(__pos1, __n1, __n2); + if (__n2) + _M_copy(_M_data() + __pos1, __s, __n2); + return *this; + } + template basic_string<_CharT, _Traits, _Alloc> operator+(const _CharT* __lhs,