-
Notifications
You must be signed in to change notification settings - Fork 454
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
static assertion failed with gcc 9.2.1 #28
Comments
Hi @morph208, Example gcc9.2: https://godbolt.org/z/d3cXHr This situation may occur if forward declared enum: https://godbolt.org/z/h9b_SK |
Thanks for your very quick reply. It's not forward declared but maybe I cannot use it like I do. I'm trying to get the size of the enum to declare an std::array of that size. Since the count it's constexpr I would have expected to work. I do not call it from the main like you did in your example, I should probably have told you that earlier. Sorry about that. Anyway it compiles and works as expected with VS2017. Here the complete code below:
|
Thanks for update example, I will check it later. |
Hi @morph208, std::cout << (int)MyEnum::Value0 << magic_enum::enum_name<MyEnum::Value0>() << std::endl;
std::cout << (int)MyEnum::Value1 << magic_enum::enum_name<MyEnum::Value1>() << std::endl;
std::cout << (int)MyEnum::Value2 << magic_enum::enum_name<MyEnum::Value2>() << std::endl; |
Hey @Neargye Sorry for the delay. I was very busy with a release. Anyway, here the output you needed:
Obviously the output was generated on Windows with VS 2017. I cannot give you an output on gcc 9.2.1 since it does not even compile. |
Any news on this? I haven’t heard from you since early March. |
Hi @morph208, |
No worries, totally understandable. The OS is Linux Mint 19 and the compiler is gcc 9.2.1. |
Hello, |
#53 looks similar to this one. |
Hello,
We have been trying to use magic_enum::enum_count. It works well with Visual Studio 2017 but does not compile with gcc 9.2.1. Here is the code:
And with gcc 9.2.1 we have the following issue:
We have the latest version of MagicEnum as of today. We have looked at the limitations, we don't seem to be in one of those situations. Did we miss anything? It looks like it is supposed to work from gcc 9 and upward.
Thank you so much for your work and very nice contribution. Magic enum seems pretty cool.
Cheers,
Olivier
The text was updated successfully, but these errors were encountered: