This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Implementing normal algorithms using predicate versions
- From: Nathan Myers <ncm-nospam at cantrip dot org>
- To: libstdc++ at gcc dot gnu dot org
- Date: Sun, 28 Nov 2004 07:15:33 -0800
- Subject: Re: Implementing normal algorithms using predicate versions
- References: <41A9E80F.6050901@cs.york.ac.uk>
On Sun, Nov 28, 2004 at 03:00:31PM +0000, caj wrote:
> Many algorithms have a predicated version, and a version which simply
> uses operator<. Why not implement the operator< versions using the
> predicated versions? This would seem to half the size of the algorithm
> heaader, remove lots of redundant code, and on -O2 seems to produce
> identical code...
This is probably just historical. When the STL was written, compoilers
just weren't very good. Anywhere you can demonstrate that it actually
does produce the same code, nowadays, I think a patch would be welcome.
Nathan Myers
ncm-nospam@cantrip.org