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.

Yes precuisely. Actually, the original code did do exactly that and reduced
the size of the rb_tree, but it failed reg-testing, so it ws removed.
However, I do have a patch ready. (I had posted it to the list about a month
ago)

Follow these messages for a detailed idea of what exactly happened:

http://gcc.gnu.org/ml/libstdc++/2004-03/msg00320.html

The patch which failed:
http://gcc.gnu.org/ml/libstdc++/2004-02/msg00249.html

I'll send the patch to the list as soon as I reach home. Maybe a few days
hence.




> 
> (Note to somebody: in C++ there is no such thing as a "superclass".)

That sombody would be me :-)
I did read Stroustrup mentioning their ambiguous nature, but because I had
been using Pascal before this, thae habbit has stayed!



-Dhruv.

-- 
"Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info


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