summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++/include/bits/stl_tree.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libstdc++/include/bits/stl_tree.h')
-rw-r--r--contrib/libstdc++/include/bits/stl_tree.h49
1 files changed, 32 insertions, 17 deletions
diff --git a/contrib/libstdc++/include/bits/stl_tree.h b/contrib/libstdc++/include/bits/stl_tree.h
index e871877..80cf7c4 100644
--- a/contrib/libstdc++/include/bits/stl_tree.h
+++ b/contrib/libstdc++/include/bits/stl_tree.h
@@ -410,10 +410,19 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_Rb_tree_node_base _M_header;
size_type _M_node_count; // Keeps track of size of tree.
- _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(),
- const _Key_compare& __comp = _Key_compare())
- : _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
+ _Rb_tree_impl()
+ : _Node_allocator(), _M_key_compare(), _M_header(),
_M_node_count(0)
+ { _M_initialize(); }
+
+ _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
+ : _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
+ _M_node_count(0)
+ { _M_initialize(); }
+
+ private:
+ void
+ _M_initialize()
{
this->_M_header._M_color = _S_red;
this->_M_header._M_parent = 0;
@@ -431,11 +440,20 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_Rb_tree_node_base _M_header;
size_type _M_node_count; // Keeps track of size of tree.
- _Rb_tree_impl(const _Node_allocator& __a = _Node_allocator(),
- const _Key_compare& __comp = _Key_compare())
+ _Rb_tree_impl()
+ : _Node_allocator(), _M_key_compare(), _M_header(),
+ _M_node_count(0)
+ { _M_initialize(); }
+
+ _Rb_tree_impl(const _Key_compare& __comp, const _Node_allocator& __a)
: _Node_allocator(__a), _M_key_compare(__comp), _M_header(),
_M_node_count(0)
- {
+ { _M_initialize(); }
+
+ private:
+ void
+ _M_initialize()
+ {
this->_M_header._M_color = _S_red;
this->_M_header._M_parent = 0;
this->_M_header._M_left = &this->_M_header;
@@ -568,16 +586,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
_Rb_tree()
{ }
- _Rb_tree(const _Compare& __comp)
- : _M_impl(allocator_type(), __comp)
- { }
-
- _Rb_tree(const _Compare& __comp, const allocator_type& __a)
- : _M_impl(__a, __comp)
+ _Rb_tree(const _Compare& __comp,
+ const allocator_type& __a = allocator_type())
+ : _M_impl(__comp, __a)
{ }
- _Rb_tree(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x)
- : _M_impl(__x._M_get_Node_allocator(), __x._M_impl._M_key_compare)
+ _Rb_tree(const _Rb_tree& __x)
+ : _M_impl(__x._M_impl._M_key_compare, __x._M_get_Node_allocator())
{
if (__x._M_root() != 0)
{
@@ -591,8 +606,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
~_Rb_tree()
{ _M_erase(_M_begin()); }
- _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&
- operator=(const _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __x);
+ _Rb_tree&
+ operator=(const _Rb_tree& __x);
// Accessors.
_Compare
@@ -653,7 +668,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
{ return get_allocator().max_size(); }
void
- swap(_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& __t);
+ swap(_Rb_tree& __t);
// Insert/erase.
pair<iterator, bool>
OpenPOWER on IntegriCloud