This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] empty base class optimization completed in stl_tree.h
- From: "Chris Jefferson" <chris at bubblescope dot net>
- To: "Maxim Yegorushkin" <maxim dot yegorushkin at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Wed, 10 Jan 2007 10:19:52 +0000
- Subject: Re: [patch] empty base class optimization completed in stl_tree.h
- References: <3254098f0701100204s4ff77edeg81ef759305c480f6@mail.gmail.com>
On 10/01/07, Maxim Yegorushkin <maxim.yegorushkin@gmail.com> wrote:
Hi,
It looks like an intended empty base class optimization has not been
finished for struct _Rb_tree_impl in stl_tree.h. If it is so indeed,
this patch completes it.
Unfortunatly I don't have a working compile of g++ right now to check
this. The only thing in this patch which worries me is this line:
+ struct _Rb_tree_impl : _Node_allocator, _Key_compare
As multiple inheritance is known to occasionally cause annoying
problems. I would advise trying to make a key_compare with all the
methods a _Node_allocator should have, and also give the
_Node_allocator could have.
I wonder, if someone wanted to be really insane, if they could make
the allocator and the key compare exactly the same type?
Chris