Closed Shuangcheng-Ni closed 3 months ago
It seems that only enumerations are affected. The code still works for structures and classes.
Sorry, I forgot function enumerators_of()
and that works. So, it was a bug that function members_of()
used to work for enumerations, which has been fixed?
Hey @Shuangcheng-Ni ! Thanks for opening the issue, and good find.
As you've already figured out, enumerators_of(^Enum)
should be used, and it was a bug for members_of(^Enum)
to be allowed in the first place. It seems that this change is what (quite accidentally) fixed the bug.
What was previously happening was that reflecting on some typename T
within a template was accidentally picking up a "SubstTemplateTypeParmType
" type-node, rather than the "replacement type" (i.e., the template argument that it was instantiated with). I'm surprised that didn't cause more issues in the first place 😅 With the above change, all code that accesses the type reflected by a std::meta::info
will receive a type for which the SubstTemplateTypeParmType
layer has already been "unwrapped".
Let me know if there's anything else I can help with, or if we can mark this one as closed :)
Thanks for the clarification and congratulations on the bug fix! I have no other questions at the moment, so I'm going to close this issue as completed.
Describe the bug Inspired by this issue, I implemented function
get_enum_members()
. The code still worked yesterday. Nevertheless, it refused to compile sometime today.Code
Error message
Possible causes The most recent commit adds an additional argument to function
__metafunction()
.