diff --git a/src/string_utils.cpp b/src/string_utils.cpp index ce3bd10..1de289d 100644 --- a/src/string_utils.cpp +++ b/src/string_utils.cpp @@ -32,12 +32,7 @@ vector sc::split(const string& str, const string& sep) } vector sc::split(const string& str, const regex& sep) { - vector components; - sregex_token_iterator end {}; - for (sregex_token_iterator p {str.begin(), str.end(), sep, -1}; p != end; ++p) { - components.push_back(*p); - } - return components; + return {sregex_token_iterator {str.begin(), str.end(), sep, -1}, sregex_token_iterator {}}; } string sc::join(const vector& components, const string& join)