Skip to content

Commit b96ef69

Browse files
committed
llama: Add static_assert in the string_split template to ensure the correct template specialization is used for std::string
1 parent e41cfc7 commit b96ef69

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

common/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ void string_replace_all(std::string & s, const std::string & search, const std::
387387

388388
template<class T>
389389
static std::vector<T> string_split(const std::string & str, char delim) {
390+
static_assert(!std::is_same<T, std::string>::value, "Please use the specialized version for std::string");
390391
std::vector<T> values;
391392
std::istringstream str_stream(str);
392393
std::string token;

0 commit comments

Comments
 (0)