Recently, in this question I saw an enum used to define a single value. eg:
enum { BITS_PER_WORD = 32 };
Instead of:
#define BITS_PER_WORD 32
Assuming more members won't be added later, what - if any, are the advantages of doing this? (or is this more a a question of personal taste )
Said differently, if I have existing code using one-off int defines, is there any good reason to change these around for one-off enums shown above?
Out of curiosity I compared GCC's optimized assembler output for some non-trivial code and the result was unchanged betweem enums/defines.