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]

rel_ops (was Re: GCC 3.1 Release)




Gaby:
> | > I'll apply the same thing to mainline.  Branch requires your approval
> | > if I understand correctly.

Mark:
> | Do it.  And thank you.  And please close the high-priority PR. :-)

Gaby:
> Done.  Thanks.

I see that Gaby couldn't resist throwing in an editorial comment attacking
std::rel_ops.  After the attack, Gaby asks "Can someone remind me what
generic programming is about?"

I will remind him that the ability to define just operator== and operator<
and automatically get correct definitions of the other four, every time,
(at least for a large number of cases) is a powerful instance of of
generic programming, and this is exactly what generic programming is
about.  I have a large C++ project that greatly benefits from that
feature.

Sometimes this is not what's desired (especially when operator== and
operator< return some class rather than bool), but that is solved by
creating the rel_ops namespace.  Library implementers must pay a price for
rel_ops, as the standard library has to work even if the user imports the
rel_ops namespace, but it is not a large price.

I'm not going to ask that the comment be stricken, but I'm not crazy
about the idea of a lot of editorial commentary in the headers.
The one-line comment I originally had would have been enough for
maintainers (who need to be told why there is a seemingly redundant
definition).


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