What is the purpose of anonymous enum declarations such as:
enum { color = 1 };
Why not just declare int color = 1
(1) int color = 1;
color is changeable (accidently).
(2) enum { color = 1 };
color cannot be changed.
The other option for enum is,
const int color = 1; // 'color' is unmutable
Both enum and const int offer exactly same concept; it's a matter of choice. With regards to popular belief that enums save space, IMO there is no memory constraint related to that, compiler are smart enough to optimize const int when needed.
[Note: If someone tries to use const_cast<> on a const int; it will result in undefined behavior (which is bad). However, the same is not possible for enum. So my personal favorite is enum]