15 Apr
2014
15 Apr
'14
9:50 a.m.
Hello, Is there a particular reason why Boost.Algorithm's any_of does not call std::find? I have devised a simple benchmark that shows it to perform much worse (compiling with gcc): http://pastebin.com/nrgtTfPX boost::find is almost as fast as std::find - no surprises, as it calls it. any_of is considerably slower, whatever the optimization level. I have not dug in the implementation of std::find to determine why; perhaps the compiler recognizes this is a sorted range, perhaps it's even capable of doing the calculation at compile time. Whatever the case however, surely any_of should also call std::find to reap the same benefits? Albert