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

Undefined behavior #315

Closed
IvanArkhipov1999 opened this issue Nov 15, 2023 · 1 comment · Fixed by #316
Closed

Undefined behavior #315

IvanArkhipov1999 opened this issue Nov 15, 2023 · 1 comment · Fixed by #316
Milestone

Comments

@IvanArkhipov1999
Copy link
Contributor

Hi there!

After adding magic_enum to my project I got unexpected build errors on some platforms in ci. But on some platforms build was successful.

I started looking into it and found out what was going on. In magic_enum std::get is extended https://github.com/Neargye/magic_enum/blob/master/include/magic_enum/magic_enum_containers.hpp#L1130. But с++ documentation states, that "It is undefined behavior to declare a full specialization of any standard library function template." (https://en.cppreference.com/w/cpp/language/extending_std section "Function templates and member functions of templates").

I suggest to define get for magic_enum in a separate namespace. Maybe you have other suggestions?

@Neargye Neargye added this to the v0.9.5 milestone Nov 15, 2023
@Neargye
Copy link
Owner

Neargye commented Nov 15, 2023

Yes indeed, I think it’s worth leaving it in namespace magic_enum::containers

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

Successfully merging a pull request may close this issue.

2 participants