Apple clang version 13.0.0 (clang-1300.0.29.3) C++17 still does not support std::boyer_moore_searcher
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>
#include <string_view>
int main()
{
constexpr std::string_view haystack =
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
"do eiusmod tempor incididunt ut labore et dolore magna aliqua";
const std::string_view needle {"pisci"};
if (const auto it = std::search(haystack.begin(), haystack.end(),
std::boyer_moore_searcher(needle.begin(), needle.end()));
it != haystack.end()
) {
std::cout << "The string " << quoted(needle) << " found at offset "
<< it - haystack.begin() << '\n';
} else {
std::cout << "The string " << std::quoted(needle) << " not found\n";
}
}
reference:https://en.cppreference.com/w/cpp/utility/functional/boyer_moore_searcher