-
Notifications
You must be signed in to change notification settings - Fork 459
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
MAGIC_ENUM_SUPPORTED_ALIASES & magic_enum::enum_values<>() #68
Comments
if
|
In https://godbolt.org/z/4TTerr no bugs, bug is that the name of the macro is a little wrong. |
Oh ok! I was expecting:
I don't think the name of the macro is wrong, I think that the documentation is just incomplete. Maybe adding a more complete example will help? Maybe, the one we have in this issue? |
Yes, I will improve the documentation and then close these issues. |
This reverts commit ec4c508.
This reverts commit ec4c508.
Hello,
I wanted to write a piece of code that checks that all the values in an enum are unique.
Looking at the limitations of
magic_enum
, I read that "magic_enum
won't work if a value is aliased". Well, that's what I want to do: detect if at least one value is aliased in my enum.During my tests, I wrote the following code:
It prints:
The problem is visible with Compiler Explorer using gcc 10.2: https://godbolt.org/z/4TTerr
The aliased value GREEN doesn't appears in the list returned by
enum_values<Color>()
.This seems to be a bug because MAGIC_ENUM_SUPPORTED_ALIASES is defined to be 1.
Am I missing something?
The text was updated successfully, but these errors were encountered: