+2004-10-27 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/basic_string.h (assign(const basic_string&)):
+ Move out of line...
+ * include/bits/basic_string.tcc: ... here.
+
2004-10-27 Paolo Carlini <pcarlini@suse.de>
* include/bits/basic_string.h (_M_replace_aux, _M_replace_safe):
* @return Reference to this string.
*/
basic_string&
- assign(const basic_string& __str)
- {
- if (_M_rep() != __str._M_rep())
- {
- // XXX MT
- const allocator_type __a = this->get_allocator();
- _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
- _M_rep()->_M_dispose(__a);
- _M_data(__tmp);
- }
- return *this;
- }
+ assign(const basic_string& __str);
/**
* @brief Set value to a substring of a string.
: _M_dataplus(_S_construct(__beg, __end, __a), __a)
{ }
+ template<typename _CharT, typename _Traits, typename _Alloc>
+ basic_string<_CharT, _Traits, _Alloc>&
+ basic_string<_CharT, _Traits, _Alloc>::
+ assign(const basic_string& __str)
+ {
+ if (_M_rep() != __str._M_rep())
+ {
+ // XXX MT
+ const allocator_type __a = this->get_allocator();
+ _CharT* __tmp = __str._M_rep()->_M_grab(__a, __str.get_allocator());
+ _M_rep()->_M_dispose(__a);
+ _M_data(__tmp);
+ }
+ return *this;
+ }
+
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>&
basic_string<_CharT, _Traits, _Alloc>::