I have a substring defined by two iterators (start and end). I need to check if this substring is present in another string.
Is there a standard library algorithm or string member I can use or adapt to do this without creating a whole new string object (std::string(start, end)) just for this purpose?
e.g.
struct Substring
{
std::string::const_iterator start, end;
};
auto found = std::contains(whole.begin(), whole.end(), substring.start, substring.end); // ???
Boosthasboost::algorithm::containsboost.org/doc/libs/1_55_0/doc/html/string_algo/…