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
This commit is contained in:
Paolo Carlini 2005-12-15 11:31:59 +00:00 committed by Paolo Carlini
parent bccef6d862
commit 8d46ce6095
3 changed files with 16 additions and 2 deletions

View file

@ -1,3 +1,9 @@
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

View file

@ -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); }

View file

@ -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); }