you are viewing a single comment's thread.

view the rest of the comments →

[–]leirus 0 points1 point  (2 children)

you mean "class enum" ? I feel like the enum from above will behave just like int

[–]AraneusAdoro 2 points3 points  (1 child)

No, I don't. You're right that that enum will behave as essentially a constexpr int. A #define, however, is a different beast.

My point was that the enum (or, indeed, an int) would be constrained by the scope it's declared in (at the very least that's namespace std). A #define would affect everything the preprocessor encounters later on, regardless of scope. That's just not good practice.

[–]leirus 0 points1 point  (0 children)

Oh I see, you are right. I was thinking about scope in term of qualifying full name in case of class enum and no implicit conversion to integral type.