[String Algo] Any reason the predicates don't optimize for random access iterators?
 
            
            
            
            
                3 Nov
                
                    2015
                
            
            
                3 Nov
                
                '15
                
            
            
            
        
    
                10:28 p.m.
            
        I was looking in boost/algorithm/string/predicate.hpp and noticed that that the predicates *starts_with, *ends_with, *contains and *equals don't optimize for random access iterators. While I haven't done any benchmarks yet, it seems like it would be faster for random access iterators to do an O(1) length check at the beginning and then while looping only check one iterator against its end instead of two. Thoughts? Nevin :-) -- Nevin ":-)" Liber <mailto:nevin@c <nevin@eviloverlord.com>plusplusguy.com> (847) 691-1404
        3649
        
      
          Age (days ago)
        
      
        3650
        
    
          Last active (days ago)
        
        
        
        1 comments
    
    
        
        2 participants
    
    
    
    
    
    
    
    
    participants (2)
- 
                 Nevin Liber Nevin Liber
- 
                 Seth Seth
