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

remove default case in switch of enum #481

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

WSoptics
Copy link
Contributor

I'd recommend removing default cases from switch statements for enums that are supposed to cover all cases. (In fact, Clang warns about this.)

Not providing a default case is better because if the enum ever is enlarged by somebody, the compiler can warn (-Wswitch-enum) that it is unhandled in the switch statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants