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

Enum From Integer is UB Problem #51

Open
Michael-F-Bryan opened this issue Nov 4, 2017 · 1 comment
Open

Enum From Integer is UB Problem #51

Michael-F-Bryan opened this issue Nov 4, 2017 · 1 comment

Comments

@Michael-F-Bryan
Copy link
Owner

Michael-F-Bryan commented Nov 4, 2017

Problem 4 (link) shows how it is UB to cast a random integer as an enum when there isn't a corresponding variant. This was originally mentioned by @bluss on the user forums.

The solutions section should mention how this is UB, as well as ways you can prevent this sort of behaviour.

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