This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] Two versions of struct _Rb_tree_impl... or not?!
- From: Nathan Myers <ncm-nospam at cantrip dot org>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 5 Jul 2004 21:35:22 -0700
- Subject: Re: [RFC] Two versions of struct _Rb_tree_impl... or not?!
- References: <40E9C285.7030305@suse.de>
On Mon, Jul 05, 2004 at 11:05:09PM +0200, Paolo Carlini wrote:
> Hi,
>
> I'm reading the following, rather new, code, and would appreciate some help
> understanding what is supposed to achieve, in principle, at least
>
> // Specialization for _Comparison types that are not capable of
> // being base classes / super classes.
> [...]
>
> I gather that something went wrong with the original idea and now we end
> up having a specialization that is a duplicate of the primary template :(
It appears that somebody was trying to avoid storing a _Comparison
object as a member if (as is common) it is a class with no data members.
If it's a pointer to function, you have no choice. Otherwise, you can
use "empty-base" tricks to share storage with some other sub-object
of a different type.
(Note to somebody: in C++ there is no such thing as a "superclass".)
Nathan Myers
ncm-nospam@cantrip.org