MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / string_split

Function string_split

smallthinker/common/common.h:482–494  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

480
481template<class T>
482static std::vector<T> string_split(const std::string & str, char delim) {
483 static_assert(!std::is_same<T, std::string>::value, "Please use the specialized version for std::string");
484 std::vector<T> values;
485 std::istringstream str_stream(str);
486 std::string token;
487 while (std::getline(str_stream, token, delim)) {
488 T value;
489 std::istringstream token_stream(token);
490 token_stream >> value;
491 values.push_back(value);
492 }
493 return values;
494}
495
496template<>
497std::vector<std::string> string_split<std::string>(const std::string & input, char separator)

Callers 5

_visit_patternMethod · 0.70
resolve_refsMethod · 0.70
github_dlMethod · 0.50
mainFunction · 0.50

Calls 1

push_backMethod · 0.45

Tested by 1

mainFunction · 0.40