57bool string_split(InputIt first, InputIt last,
const char* c, Predicate p) {
58 auto n = std::strlen(c);
60 InputIt next = std::find_if(first, last, [&c, &n](
char l) ->
bool {
61 return c + n != std::find(c, c + n, l);
63 if (p(first, next))
return true;
64 if (next == last)
return false;
65 first = std::next(next);
72 std::vector<std::string> strings;
73 string_split(first, last, c, [&strings](InputIt begin, InputIt end) {
74 strings.emplace_back(&(*begin), std::distance(begin, end));
83 std::vector<std::string> strings;
84 string_split(first, last, c, [&strings](InputIt begin, InputIt end) {
85 strings.emplace_back(&(*begin), std::distance(begin, end));