[RFC] Two versions of struct _Rb_tree_impl... or not?!
Dhruv Matani
dhruvbird@gmx.net
Tue Jul 6 05:43:00 GMT 2004
> 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
More information about the Libstdc++
mailing list