mirror of
https://github.com/BlackMATov/enum.hpp.git
synced 2025-12-16 22:51:18 +07:00
clang compilation fix
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user