38 std::vector<T> tokens;
39 size_t lastPos =
str.find_first_not_of(delimiters, 0);
40 size_t pos =
str.find_first_of(delimiters, lastPos);
42 while (lastPos != std::string_view::npos) {
43 std::string_view token =
str.substr(lastPos, pos - lastPos);
45 if constexpr (std::is_same_v<T, std::string_view>) {
46 tokens.push_back(token);
47 }
else if constexpr (std::is_same_v<T, std::string>) {
48 tokens.emplace_back(token);
53 tokens.push_back(value);
56 lastPos =
str.find_first_not_of(delimiters, pos);
57 pos =
str.find_first_of(delimiters, lastPos);