You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But #__VA_ARGS__ will convert all enums to a single string. For example, Enum class Foo { A, B, C }; will get "A, B, C". So I need to split by comma in compile time or have a better preprocessor than macro.
After some searchs, I can use BOOST_PP_SEQ_FOR_EACH_I in boost. Or use static reflection lib about enum process such as https://github.com/Neargye/magic_enum.
The text was updated successfully, but these errors were encountered:
Define an enum can generate
const char* GetXXXName(EnumType e)
method automatically.The first version I implemented is:
But
#__VA_ARGS__
will convert all enums to a single string. For example,Enum class Foo { A, B, C };
will get"A, B, C"
. So I need to split by comma in compile time or have a better preprocessor than macro.After some searchs, I can use
BOOST_PP_SEQ_FOR_EACH_I
in boost. Or use static reflection lib about enum process such ashttps://github.com/Neargye/magic_enum
.The text was updated successfully, but these errors were encountered: