std::search can be optmized for Random Access Iterators by implementing inside search algorithm like Boyer-Moore or Boyer-Moore-Horspool or Musser-Nishanov algorithm (or smth faster). For Bidirectional iterators AFAIK Crochemore-Perrin algorithm is very good.
AFAIK, now std::search use only naive search algortihm. Can be it improved?
P.S. I know about changes in C++17 new search algorithms, but i suggest use the most efficient version for every type of iterators.
P.S.S Efficient algorithms you can find in Seqan library and in Boost.Algorithm.
I know the only one reason: Boyer-Moore and Boyer-Moore-Horspool are a little bit complex and have state. Constructing these search engines isn't so cheap. But they work much faster than naive search.
std::search can be optmized for Random Access Iterators by implementing inside search algorithm like Boyer-Moore or Boyer-Moore-Horspool or Musser-Nishanov algorithm (or smth faster). For Bidirectional iterators AFAIK Crochemore-Perrin algorithm is very good.
AFAIK, now std::search use only naive search algortihm. Can be it improved?
P.S. I know about changes in C++17 new search algorithms, but i suggest use the most efficient version for every type of iterators.
P.S.S Efficient algorithms you can find in Seqan library and in Boost.Algorithm.