initial import, >900commits predate this

This commit is contained in:
2020-09-29 13:47:50 +02:00
commit e74154ccee
352 changed files with 108120 additions and 0 deletions

View File

@ -0,0 +1,27 @@
#pragma once
#include <string_view>
namespace MM::std_utils {
// src : https://marcoarena.wordpress.com/2017/01/03/string_view-odi-et-amo/
inline std::vector<std::string_view> split(std::string_view str, const char* delims) {
std::vector<std::string_view> ret;
std::string_view::size_type start = 0;
auto pos = str.find_first_of(delims, start);
while (pos != std::string_view::npos) {
if (pos != start) {
ret.push_back(str.substr(start, pos - start));
}
start = pos + 1;
pos = str.find_first_of(delims, start);
}
if (start < str.length())
ret.push_back(str.substr(start, str.length() - start));
return ret;
}
} // MM::std_utils