clang compilation fix

This commit is contained in:
2019-11-21 04:21:24 +07:00
parent aa7fcddf9a
commit a29115e71d

View File

@@ -42,10 +42,17 @@ namespace enum_hpp::detail
}; };
constexpr std::string_view trim_raw_name(std::string_view raw_name) noexcept { constexpr std::string_view trim_raw_name(std::string_view raw_name) noexcept {
const auto end_index = raw_name.find_first_of(" =\r\n\t"); for ( std::size_t i = 0; i < raw_name.size(); ++i ) {
return end_index == std::string_view::npos switch ( raw_name[i] ) {
? raw_name case ' ':
: raw_name.substr(0, end_index); case '=':
case '\r':
case '\n':
case '\t':
return raw_name.substr(0, i);
}
}
return raw_name;
} }
} }