From 20ce3b1536dc50be848f9295acda892dfc82b587 Mon Sep 17 00:00:00 2001 From: paolo Date: Wed, 2 Nov 2005 10:27:54 +0000 Subject: 2005-11-02 Thomas Kho PR libstdc++/23425 * include/bits/stl_vector.h (vector<>::clear): Open code in terms of _Destroy. 2005-11-02 Paolo Carlini * include/bits/vector.tcc (vector<>::_M_fill_assign): Qualify fill_n. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106379 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 10 ++++++++++ libstdc++-v3/include/bits/stl_vector.h | 6 +++++- libstdc++-v3/include/bits/vector.tcc | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8b9d310ad37..0a779b6b257 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,13 @@ +2005-11-02 Thomas Kho + + PR libstdc++/23425 + * include/bits/stl_vector.h (vector<>::clear): Open code + in terms of _Destroy. + +2005-11-02 Paolo Carlini + + * include/bits/vector.tcc (vector<>::_M_fill_assign): Qualify fill_n. + 2005-11-01 Paolo Carlini PR libstdc++/24595 diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index 94acec2fb2c..1fc59dd5bbe 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -742,7 +742,11 @@ namespace _GLIBCXX_STD */ void clear() - { erase(begin(), end()); } + { + std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish, + _M_get_Tp_allocator()); + this->_M_impl._M_finish = this->_M_impl._M_start; + } protected: /** diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc index 9e0eeb91fcf..3a9b66e1d1a 100644 --- a/libstdc++-v3/include/bits/vector.tcc +++ b/libstdc++-v3/include/bits/vector.tcc @@ -184,7 +184,7 @@ namespace _GLIBCXX_STD this->_M_impl._M_finish += __n - size(); } else - erase(fill_n(begin(), __n, __val), end()); + erase(std::fill_n(begin(), __n, __val), end()); } template -- cgit v1.2.1