summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-02 10:27:54 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-02 10:27:54 +0000
commit20ce3b1536dc50be848f9295acda892dfc82b587 (patch)
tree9bee4cb52377e6c350311f236c1dfe3e5ac58033 /libstdc++-v3
parentf266c925f8af42ef501221e18809823661d2a524 (diff)
downloadgcc-20ce3b1536dc50be848f9295acda892dfc82b587.tar.gz
2005-11-02 Thomas Kho <tkho@ucla.edu>
PR libstdc++/23425 * include/bits/stl_vector.h (vector<>::clear): Open code in terms of _Destroy. 2005-11-02 Paolo Carlini <pcarlini@suse.de> * 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
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog10
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h6
-rw-r--r--libstdc++-v3/include/bits/vector.tcc2
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 <tkho@ucla.edu>
+
+ PR libstdc++/23425
+ * include/bits/stl_vector.h (vector<>::clear): Open code
+ in terms of _Destroy.
+
+2005-11-02 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/vector.tcc (vector<>::_M_fill_assign): Qualify fill_n.
+
2005-11-01 Paolo Carlini <pcarlini@suse.de>
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<typename _Tp, typename _Alloc>