Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile error if enum value is 0xab #79

Closed
yaoxinliu opened this issue Apr 21, 2021 · 1 comment
Closed

compile error if enum value is 0xab #79

yaoxinliu opened this issue Apr 21, 2021 · 1 comment

Comments

@yaoxinliu
Copy link

yaoxinliu commented Apr 21, 2021

enum class Color1
{
    red  = 0xab,
    blue = 0xcd
};

enum class Color2
{
    red  = 0x12,
    blue = 0x34
};

int main()
{	
    magic_enum::enum_name(Color1::red); // compile error!
    magic_enum::enum_name(Color2::red); // okay
}
@Neargye
Copy link
Owner

Neargye commented Apr 21, 2021

Fixed in master.

Note

magic_enum::enum_name(Color1::red); // return ""
magic_enum::enum_name(Color2::red); // return "red"

@Neargye Neargye closed this as completed Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants