]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
basic_string.h (append(const basic_string&), [...]): Move out of line...
authorPaolo Carlini <pcarlini@suse.de>
Wed, 27 Oct 2004 01:02:47 +0000 (01:02 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 27 Oct 2004 01:02:47 +0000 (01:02 +0000)
2004-10-26  Paolo Carlini  <pcarlini@suse.de>

* include/bits/basic_string.h (append(const basic_string&),
append(size_type, _CharT)): Move out of line...
* include/bits/basic_string.tcc: ... here.

From-SVN: r89622

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/basic_string.h
libstdc++-v3/include/bits/basic_string.tcc

index 94a2adb2ada85544e5b9cd5159736f283243d301..f51f6f1d005df9fae037d40660cfcd3a626641b3 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-26  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/bits/basic_string.h (append(const basic_string&),
+       append(size_type, _CharT)): Move out of line...
+       * include/bits/basic_string.tcc: ... here.
+
 2004-10-26  Paolo Carlini  <pcarlini@suse.de>
 
        * include/bits/basic_string.h (erase(size_type, size_type),
index 34c6fab94a554a57c60423e07c513a6f73d40f2d..6550b9c33622582304fe1eff95e63c82472f53dd 100644 (file)
@@ -776,19 +776,7 @@ namespace std
        *  @return  Reference to this string.
        */
       basic_string&
-      append(const basic_string& __str)
-      {
-       const size_type __size = __str.size();
-       if (__size)
-         {
-           const size_type __len = __size + this->size();
-           if (__len > this->capacity() || _M_rep()->_M_is_shared())
-             this->reserve(__len);
-           _M_copy(_M_data() + this->size(), __str._M_data(), __size);
-           _M_rep()->_M_set_length_and_sharable(__len);
-         }
-       return *this;
-      }
+      append(const basic_string& __str);
 
       /**
        *  @brief  Append a substring.
@@ -835,19 +823,7 @@ namespace std
        *  Appends n copies of c to this string.
        */
       basic_string&
-      append(size_type __n, _CharT __c)
-      {
-       if (__n)
-         {
-           _M_check_length(size_type(0), __n, "basic_string::append");   
-           const size_type __len = __n + this->size();
-           if (__len > this->capacity() || _M_rep()->_M_is_shared())
-             this->reserve(__len);
-           _M_assign(_M_data() + this->size(), __n, __c);
-           _M_rep()->_M_set_length_and_sharable(__len);
-         }
-       return *this;
-      }
+      append(size_type __n, _CharT __c);
 
       /**
        *  @brief  Append a range of characters.
index 9e59e2c6b50dc834498da5d535f38f227637f662..6bd129682029f556c906b7e16f08d3679f2b83f0 100644 (file)
@@ -261,6 +261,23 @@ namespace std
        }
      }
 
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    append(size_type __n, _CharT __c)
+    {
+      if (__n)
+       {
+         _M_check_length(size_type(0), __n, "basic_string::append");     
+         const size_type __len = __n + this->size();
+         if (__len > this->capacity() || _M_rep()->_M_is_shared())
+           this->reserve(__len);
+         _M_assign(_M_data() + this->size(), __n, __c);
+         _M_rep()->_M_set_length_and_sharable(__len);
+       }
+      return *this;
+    }
+
   template<typename _CharT, typename _Traits, typename _Alloc>
     basic_string<_CharT, _Traits, _Alloc>&
     basic_string<_CharT, _Traits, _Alloc>::
@@ -288,6 +305,23 @@ namespace std
       return *this;
     }
 
+  template<typename _CharT, typename _Traits, typename _Alloc>
+    basic_string<_CharT, _Traits, _Alloc>&
+    basic_string<_CharT, _Traits, _Alloc>::
+    append(const basic_string& __str)
+    {
+      const size_type __size = __str.size();
+      if (__size)
+       {
+         const size_type __len = __size + this->size();
+         if (__len > this->capacity() || _M_rep()->_M_is_shared())
+           this->reserve(__len);
+         _M_copy(_M_data() + this->size(), __str._M_data(), __size);
+         _M_rep()->_M_set_length_and_sharable(__len);
+       }
+      return *this;
+    }    
+
   template<typename _CharT, typename _Traits, typename _Alloc>
     basic_string<_CharT, _Traits, _Alloc>&
     basic_string<_CharT, _Traits, _Alloc>::