diff options
author | Paolo Carlini <pcarlini@suse.de> | 2005-12-15 11:31:59 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2005-12-15 11:31:59 +0000 |
commit | 8d46ce6095853cebc4ea306fe0d00a4aa9758610 (patch) | |
tree | 08d5ce2c899415397c7a44696145113e226c600d | |
parent | bccef6d862166e9c58e231ba7aff09b59781d70d (diff) | |
download | gcc-8d46ce6095853cebc4ea306fe0d00a4aa9758610.zip gcc-8d46ce6095853cebc4ea306fe0d00a4aa9758610.tar.gz gcc-8d46ce6095853cebc4ea306fe0d00a4aa9758610.tar.bz2 |
stl_vector.h (vector<>::_M_get_Tp_allocator): Change to return by ref and add non const version.
2005-12-15 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_vector.h (vector<>::_M_get_Tp_allocator): Change
to return by ref and add non const version.
* include/bits/stl_deque.h (deque<>::_M_get_Tp_allocator): Likewise.
From-SVN: r108570
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_deque.h | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/stl_vector.h | 6 |
3 files changed, 16 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5197f12..92540fb 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,11 @@ 2005-12-15 Paolo Carlini <pcarlini@suse.de> + * include/bits/stl_vector.h (vector<>::_M_get_Tp_allocator): Change + to return by ref and add non const version. + * include/bits/stl_deque.h (deque<>::_M_get_Tp_allocator): Likewise. + +2005-12-15 Paolo Carlini <pcarlini@suse.de> + PR libstdc++/25421 * config/locale/gnu/c_locale.cc (_S_destroy_c_locale): Check for null argument. diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h index e5f5beb..eb534ca 100644 --- a/libstdc++-v3/include/bits/stl_deque.h +++ b/libstdc++-v3/include/bits/stl_deque.h @@ -395,7 +395,11 @@ namespace _GLIBCXX_STD { } }; - _Tp_alloc_type + _Tp_alloc_type& + _M_get_Tp_allocator() + { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); } + + const _Tp_alloc_type& _M_get_Tp_allocator() const { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); } diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index 7d8519c..d8ea4b3 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -91,7 +91,11 @@ namespace _GLIBCXX_STD public: typedef _Alloc allocator_type; - _Tp_alloc_type + _Tp_alloc_type& + _M_get_Tp_allocator() + { return *static_cast<_Tp_alloc_type*>(&this->_M_impl); } + + const _Tp_alloc_type& _M_get_Tp_allocator() const { return *static_cast<const _Tp_alloc_type*>(&this->_M_impl); } |