google / s2geometry

Computational geometry and spatial indexing on the sphere
http://s2geometry.io/
Apache License 2.0
2.32k stars 308 forks source link

Better to use enum class instead of enum #205

Open jievince opened 3 years ago

jievince commented 3 years ago

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 commented 3 years ago

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

jmr commented 3 years ago

Sure. You can call them kBegin, etc.

jmr commented 3 years ago

I mean, send a PR to change it to:

enum class InitialPosition { kBegin, kEnd, kUnpositioned };
jievince commented 3 years ago

OK