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

Better to use enum class instead of enum #205

Open
jievince opened this issue Sep 21, 2021 · 4 comments
Open

Better to use enum class instead of enum #205

jievince opened this issue Sep 21, 2021 · 4 comments

Comments

@jievince
Copy link

jievince commented Sep 21, 2021

eg. In s2shape_index.h:

enum InitialPosition { BEGIN, END, UNPOSITIONED };

Such an enum name like BEGIN is very common, so it is easy to have the same name with a macro or other enum, which will cause conflict.

@jievince
Copy link
Author

If changing it to enum class is ok, I will make a PR to fix it.

@jmr
Copy link
Member

jmr commented Sep 23, 2021

Sure. You can call them kBegin, etc.

@jmr
Copy link
Member

jmr commented Sep 23, 2021

I mean, send a PR to change it to:

enum class InitialPosition { kBegin, kEnd, kUnpositioned };

@jievince
Copy link
Author

OK

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