better-enums
better-enums copied to clipboard
How to reflect to enum with type and value strings?
Hi, this is a great work you’v made. But how to reflect from strings of enum value and name?
I have,
enum Type
{
A = 1,
B = 2
};
and text content
enum name : Type ; value: A
How to reflect the strings into Type with A?
I know there is no reflection in c++, but can we build that system just with help of this better-enum
project?
You would have to edit the macro to store the name of the type being declared somewhere. I'm not immediately sure if it can be done in a compile-time only way. It can definitely be done with an ordinary run-time map.
It can definitely be done with an ordinary run-time map.
Would you be kindly tell me how to do this?
This question is far too generic and contains no information at all about what specifically you might be having trouble with.
I won't have time in the immediate term to offer anything except very specific advice to very specific prompts with specific technical issues and information.
This question is far too generic and contains no information at all about what specifically you might be having trouble with.
I won't have time in the immediate term to offer anything except very specific advice to very specific prompts with specific technical issues and information.
Thanks anyway. BTW, great work again!