23 template <
typename SequenceSequenceT>
25 split(SequenceSequenceT& result, std::string
const& in,
const char*
const delimiters)
27 using StringSizeT = std::string::size_type;
29 const auto len = in.length();
30 StringSizeT token_start = 0;
33 while (token_start < len) {
35 token_start = in.find_first_not_of(delimiters, token_start);
36 if (token_start == std::string::npos) {
41 const auto token_end = in.find_first_of(delimiters, token_start);
44 if (token_end == std::string::npos) {
45 result.emplace_back(in.data() + token_start, len - token_start);
49 result.emplace_back(in.data() + token_start, token_end - token_start);
53 token_start = token_end + 1;
void split(SequenceSequenceT &result, std::string const &in, const char *const delimiters)
Lightweight tokenization function This function can be used as a boost::split substitute.