diff options
author | Paolo Carlini <pcarlini@suse.de> | 2007-12-11 19:08:26 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2007-12-11 19:08:26 +0000 |
commit | c62df8fddbe78c4af764227a36fd67fef8d2d665 (patch) | |
tree | 1212618bd275c50c8dd692b834da060b630a3375 | |
parent | fcd5a1131ae62f73a9887deb6a8b8d3cbb76b6c9 (diff) | |
download | gcc-c62df8fddbe78c4af764227a36fd67fef8d2d665.zip gcc-c62df8fddbe78c4af764227a36fd67fef8d2d665.tar.gz gcc-c62df8fddbe78c4af764227a36fd67fef8d2d665.tar.bz2 |
stl_bvector.h (vector<bool>::reserve): Move out of line...
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
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_bvector.h | 16 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/vector.tcc | 19 |
3 files changed, 26 insertions, 15 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d374db8..a318ac8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -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. diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index 255e00b..045f203 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -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() diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc index 354ab73..030cb3a 100644 --- a/libstdc++-v3/include/bits/vector.tcc +++ b/libstdc++-v3/include/bits/vector.tcc @@ -537,6 +537,25 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D) 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>:: _M_fill_insert(iterator __position, size_type __n, bool __x) { if (__n == 0) |