This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: search/search_n vs find/find_if
- From: Chris Jefferson <caj at cs dot york dot ac dot uk>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 02 Mar 2005 16:46:02 +0000
- Subject: Re: search/search_n vs find/find_if
- References: <42259CC6.50208@suse.de> <42259F79.1020705@suse.de>
Paolo Carlini wrote:
Paolo Carlini wrote:
Can you see anything wrong with calling find_if, instead? Actually,
first blush, I don't understand why find_if was not exploited also in
the original HP/SGI code...
In order to implement this, bind2nd is needed, apparently, but I cannot
see anything wrong...
This is actually very slightly harder than I thought at first... as find
is optimised for char types.. therefore it might be necessary to catch
if find_if is being given our special comparison object and if so pass
it back to find.. however I'm going to investigate to see a) how much
speed benefit is actually given by the char specialisations of find and
b) how messy it looks delegating find_if to find :)
Chris