This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Patch for stl_tree.h and cpp_type_traits.h.
- From: "Gawain Bolton" <gp dot bolton at computer dot org>
- To: "Dhruv Matani" <dhruvbird at gmx dot net>,"libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 17 Feb 2004 20:12:41 +0100
- Subject: Re: Patch for stl_tree.h and cpp_type_traits.h.
- References: <1077024657.2351.20.camel@localhost.localdomain>
Hi Dhruv,
I think your proposed changes to stl_tree.h can go a little bit further to
simplifying things...
The _Rb_tree_impl class constructor can be added to so that the
_M_empty_initialize() function can be removed entirely.
This will allow the copy constructor can be simplified to something like:
_Rb_tree(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x)
: _M_impl(__x.get_allocator(), __x._M_impl._M_key_compare())
{
if (__x._M_root() != 0)
{
_M_root() = _M_copy(__x._M_begin(), _M_end());
_M_leftmost() = _S_minimum(_M_root());
_M_rightmost() = _S_maximum(_M_root());
_M_impl._M_node_count = __x._M_impl._M_node_count;
}
}
Cheers,
Gawain