This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Two versions of struct _Rb_tree_impl... or not?!


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]