Is std::search coding fast enough?
Paolo Carlini
pcarlini@suse.de
Wed Jul 4 16:45:00 GMT 2007
Dimitris Xochellis wrote:
>Hi list,
>
>
Hi poster ;)
>After reading the following std::search STL algorithm [1] I have got the impression that it can be
>coded in a more efficient way. In my opinion, the code in the lines *A* & *C* guaranties that the
>condition of the line *B* will be always true. Consequently, we can effectively replace the "while
>(__first1 != __last1)" expression of the line *B* with a simpler "for ( ; ; )" expression and the
>algorithm will work just fine and significantly faster as well.
>
>
I agree. I would say the same is true for the std::search taking a
predicate, right?
Paolo.
More information about the Libstdc++
mailing list