]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
stl_bvector.h (vector<bool>::reserve): Move out of line...
authorPaolo Carlini <pcarlini@suse.de>
Tue, 11 Dec 2007 19:08:26 +0000 (19:08 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 11 Dec 2007 19:08:26 +0000 (19:08 +0000)
2007-12-11  Paolo Carlini  <pcarlini@suse.de>

* include/bits/stl_bvector.h (vector<bool>::reserve): Move out of
line...
* include/bits/vector.tcc: ... here.

From-SVN: r130777

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_bvector.h
libstdc++-v3/include/bits/vector.tcc

index d374db8c53a5c0ebf65f97e9e398cb1bbdedba81..a318ac84282a65e2bb42e490f3c3b77dc308551a 100644 (file)
@@ -1,3 +1,9 @@
+2007-12-11  Paolo Carlini  <pcarlini@suse.de>
+
+       * include/bits/stl_bvector.h (vector<bool>::reserve): Move out of
+       line...
+       * include/bits/vector.tcc: ... here.
+
 2007-12-10  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
        * docs/html/21_strings/howto.html: Add links to referenced articles.
index 255e00b793c7e9fa16d479af0874dd8cc0eb6275..045f20378a6df51df70705e25f6692cb54bc55b5 100644 (file)
@@ -690,21 +690,7 @@ template<typename _Alloc>
     { _M_range_check(__n); return (*this)[__n]; }
 
     void
-    reserve(size_type __n)
-    {
-      if (__n > this->max_size())
-       __throw_length_error(__N("vector::reserve"));
-      if (this->capacity() < __n)
-       {
-         _Bit_type* __q = this->_M_allocate(__n);
-         this->_M_impl._M_finish = _M_copy_aligned(begin(), end(),
-                                                   iterator(__q, 0));
-         this->_M_deallocate();
-         this->_M_impl._M_start = iterator(__q, 0);
-         this->_M_impl._M_end_of_storage = (__q + (__n + int(_S_word_bit) - 1)
-                                            / int(_S_word_bit));
-       }
-    }
+    reserve(size_type __n);
 
     reference
     front()
index 354ab73f10f6580981ca2754488826689f71abd8..030cb3aabccedd99e3db5a1a7e1ca09568469134 100644 (file)
@@ -534,6 +534,25 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
 
   // vector<bool>
 
+  template<typename _Alloc>
+    void
+    vector<bool, _Alloc>::
+    reserve(size_type __n)
+    {
+      if (__n > this->max_size())
+       __throw_length_error(__N("vector::reserve"));
+      if (this->capacity() < __n)
+       {
+         _Bit_type* __q = this->_M_allocate(__n);
+         this->_M_impl._M_finish = _M_copy_aligned(begin(), end(),
+                                                   iterator(__q, 0));
+         this->_M_deallocate();
+         this->_M_impl._M_start = iterator(__q, 0);
+         this->_M_impl._M_end_of_storage = (__q + (__n + int(_S_word_bit) - 1)
+                                            / int(_S_word_bit));
+       }
+    }
+
   template<typename _Alloc>
     void
     vector<bool, _Alloc>::