search/search_n vs find/find_if

Chris Jefferson caj@cs.york.ac.uk
Wed Mar 2 16:52:00 GMT 2005


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



More information about the Libstdc++ mailing list