mirror of
https://github.com/Neargye/magic_enum.git
synced 2026-01-09 23:34:23 +00:00
Support gcc -fno-pretty-templates (#258)
https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html#index-fno-pretty-templates The gcc option -fno-pretty-templates changes the __PRETTY_FUNCTION__ from e.g. "auto n() [with E = E]" to "auto n<E>()" (more like MSVC). Pass the entire __PRETTY_FUNCTION__ / __FUNCSIG__ to pretty_name(), and truncate it there, checking the last character if necessary to determine the format used.
This commit is contained in:
parent
d4fa0c3dd3
commit
5367f5183c
2 changed files with 11 additions and 2 deletions
|
|
@ -76,6 +76,7 @@ struct MyStringView {
|
|||
constexpr std::size_t find(char c) const { return str.find(c); } // required
|
||||
constexpr MyStringView substr(std::size_t p, std::size_t n) { return str.substr(p, n); } // required
|
||||
constexpr void remove_prefix(std::size_t n) { str.remove_prefix(n); } // required
|
||||
constexpr void remove_suffix(std::size_t n) { str.remove_suffix(n); } // required
|
||||
friend constexpr bool operator==(MyStringView lhs, MyStringView rhs); // required
|
||||
|
||||
constexpr MyStringView(const char* cstr) : str{ cstr } {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue