Skip to content

Commit

Permalink
msvc type fix 2
Browse files Browse the repository at this point in the history
  • Loading branch information
dakka committed Jun 6, 2024
1 parent 600b749 commit 6bdd0b6
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions include/fix8/conjure_enum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ class cs : private no_construct_or_assign
#elif defined __GNUC__
{ "e = ", ';', "<unnamed>", '<' }, { "T = ", ']', "{anonymous}", '{' },
#elif defined _MSC_VER
{ "epeek<", '>', "`anonymous-namespace'", '`' }, { "::tpeek", '<', "enum `anonymous-namespace'", '`' }, { "<class ", '>', "", '\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"
Expand Down Expand Up @@ -737,9 +738,12 @@ class conjure_type : private no_construct_or_assign
return fixed_string<result.size()>(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<cs::sval::start,cs::stype::enum_t>()) };

// { "epeek<", '>', "`anonymous-namespace'", '`' }, { "::tpeek", '<', "enum `anonymous-namespace'", '`' },
// { "enum ", '\0', "enum `anonymous-namespace'", '\0' }, { "", '\0', "class", '\0' },

// { "epeek<", '>', "`anonymous-namespace'", '`' }, { "::tpeek", '<', "enum `anonymous-namespace'", '`' }, { "<class ", '>', "", 0 },
// const char *__cdecl conjure_type<int>::tpeek(void) noexcept
// const char *__cdecl conjure_type<class std::basic_string_view<char,struct std::char_traits<char> > >::tpeek(void) noexcept
Expand All @@ -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<sval::end,stype::type_t>()) }; 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<sval::anon_str,stype::extype_t0>()) }; ep1 != std::string_view::npos)
return e1.substr(ep1, e1.size() - ep1);
if constexpr (constexpr auto ep1 { e1.find(cs::get_spec<sval::anon_str,stype::extype_t1>()) }; ep1 != std::string_view::npos)
return e1.substr(ep1, e1.size() - ep1);
if constexpr (constexpr auto ep1 { e1.find(cs::get_spec<sval::anon_str,stype::extype_t2>()) }; ep1 != std::string_view::npos)
return e1.substr(ep1, e1.size() - ep1);
}
return {};
}
#endif
Expand Down

0 comments on commit 6bdd0b6

Please sign in to comment.