} // eo split_string(const std::string&,std::list< std::string >&,const std::string&,bool,const std::string&)
+/** call split_string with list<string>, converts result to vector; vector is clear()-ed first
+ *
+ * Note: Uses 3 O(n)-operations: list.size, vector.resize and std::swap_ranges;
+ * not sure whether there is a better way to do this
+ * */
+void split_string(
+ const std::string& str,
+ std::vector<std::string>& result,
+ const std::string& delimiter,
+ bool omit_empty,
+ const std::string& trim_list
+)
+{
+ std::list<std::string> tmp;
+ split_string(str, tmp, delimiter, omit_empty, trim_list);
+ std::size_t size = tmp.size(); // this is O(n)
+ result.clear();
+ result.resize(size); // also O(n)
+ std::swap_ranges(tmp.begin(), tmp.end(), result.begin()); // also O(n)
+}
+
/**
* splits a string by a given delimiter
* @param str the string which should be splitted.