auto split string container auto result container string size_type fou

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
auto split = [](string&& a) -> container {
auto result = container{};
string::size_type found, current = 0;
while ((found = a.find(",", current)) != string::npos) {
result.emplace_back(a, current, found - current);
current = found + 1;
}
result.emplace_back(a, current, a.size() - current);
return result;
};