1 #ifndef SRC_UTILS_VECTORIZE_HPP_
2 #define SRC_UTILS_VECTORIZE_HPP_
11 std::vector<A>
Vectorize(
const char* cstr,
const char* delimiter =
" ") {
14 snprintf(str,
sizeof(str),
"%s", cstr);
15 p = std::strtok(str, delimiter);
17 arr.push_back(
static_cast<A>(std::stof(
p)));
18 p = std::strtok(NULL, delimiter);
24 std::vector<std::string>
Vectorize(
const char* cstr,
const char* delimiter);
std::vector< A > Vectorize(const char *cstr, const char *delimiter=" ")
split a string to a vector