Summary
Stop here for a quick summary.
In this chapter, you’ve learned about the searchers that can be passed into std::search
algorithm. They allow you to use more advanced algorithms for string matching - Boyer-Moore and Boyer-Moore-Horspool that offers better complexity than a naive approach.
std::search
with searchers is a general algorithm that works for most of the containers that expose random access iterators. If you work with strings and characters, then you might also compare it against std::string::find
, which is usually specialised and optimised for character processing (implementation-dependent!).
Extra Info: The change was proposed in: N3905.
We will conclude with compiler support, in the next lesson.
Get hands-on with 1400+ tech skills courses.