diff --git a/include/fix8/conjure_enum.hpp b/include/fix8/conjure_enum.hpp index 3733a946..2ab12d20 100644 --- a/include/fix8/conjure_enum.hpp +++ b/include/fix8/conjure_enum.hpp @@ -116,7 +116,8 @@ class cs : private no_construct_or_assign #elif defined __GNUC__ { "e = ", ';', "", '<' }, { "T = ", ']', "{anonymous}", '{' }, #elif defined _MSC_VER - { "epeek<", '>', "`anonymous-namespace'", '`' }, { "::tpeek", '<', "enum `anonymous-namespace'", '`' }, { "', "", '\0' }, + { "epeek<", '>', "`anonymous-namespace'", '`' }, { "::tpeek", '<', "enum `anonymous-namespace'", '`' }, + { "", '\0', "enum", '\0' }, { "", '\0', "class", '\0' }, //{ "epeek<", '>', "`anonymous-namespace'", '`' }, { "enum ", '>', "enum `anonymous-namespace'", '`' }, { "class ", '>', "", 0 }, #else # error "conjure_enum not supported by your compiler" @@ -737,9 +738,12 @@ class conjure_type : private no_construct_or_assign return fixed_string(result); } #else -// enum class stype { enum_t, type_t, extype_t }; +// enum class stype { enum_t, type_t, extype_t0, extype_t1, extype_t2, extype_end }; // enum class sval { start, end, anon_str, anon_start }; -// constexpr auto ep { from.rfind(cs::get_spec()) }; + +// { "epeek<", '>', "`anonymous-namespace'", '`' }, { "::tpeek", '<', "enum `anonymous-namespace'", '`' }, +// { "enum ", '\0', "enum `anonymous-namespace'", '\0' }, { "", '\0', "class", '\0' }, + // { "epeek<", '>', "`anonymous-namespace'", '`' }, { "::tpeek", '<', "enum `anonymous-namespace'", '`' }, { "', "", 0 }, // const char *__cdecl conjure_type::tpeek(void) noexcept // const char *__cdecl conjure_type > >::tpeek(void) noexcept @@ -750,7 +754,15 @@ class conjure_type : private no_construct_or_assign if constexpr (ep == std::string_view::npos) return {}; if constexpr (constexpr auto lc { from.find_first_of(cs::get_spec()) }; lc != std::string_view::npos) - return from.substr(lc, ep - lc); + { + constexpr std::string_view e1 { from.substr(lc, ep - lc) }; + if constexpr (constexpr auto ep1 { e1.find(cs::get_spec()) }; ep1 != std::string_view::npos) + return e1.substr(ep1, e1.size() - ep1); + if constexpr (constexpr auto ep1 { e1.find(cs::get_spec()) }; ep1 != std::string_view::npos) + return e1.substr(ep1, e1.size() - ep1); + if constexpr (constexpr auto ep1 { e1.find(cs::get_spec()) }; ep1 != std::string_view::npos) + return e1.substr(ep1, e1.size() - ep1); + } return {}; } #endif