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 classes #39590

Merged
merged 3 commits into from
Apr 16, 2020
Merged

Conversation

ZhilkinSerg
Copy link
Contributor

Summary

SUMMARY: None

Purpose of change

Add class to some enums (rename some enum class members in the process to remove prefixes)

Describe alternatives you've considered

Leave enums alone in a classless society.

Testing

Let it compile.

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style labels Apr 15, 2020
@jbytheway
Copy link
Contributor

Ping me if and when you're done with these conversions. It will be easy to add an enforcement check to ensure they don't come back :).

@kevingranade
Copy link
Member

kevingranade commented Apr 16, 2020

There is one caveat, it suppresses using enums as integers for e.g. bit shifting, IDK if we do that but it's a legit use case.

@kevingranade kevingranade merged commit 93c4a41 into CleverRaven:master Apr 16, 2020
@jbytheway
Copy link
Contributor

There is one caveat, it suppresses using enums as integers for e.g. bit shifting, IDK if we do that but it's a legit use case.

You can overload the bitshift operators on an enum class.

@ZhilkinSerg ZhilkinSerg deleted the enum-classes-2020-04-14 branch April 16, 2020 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants