I had code that looked like this:
enum EEventID {
eEvent1,
eEvent2,
...
eEventN };
And that got reviewed and changed to
typedef enum {
eEvent1,
eEvent2,
...
eEventN } EEventID;
What is the difference between the two? Why make the change? When I looked at this question, the only mention of typedefs got downvoted.
The two are identical in C++, but they’re not the same in C — in C if you use the typedef you get code that is compatible between C and C++ (so can be used freely in a header file that might be used for either C or C++). That’s the only reason I can see for preferring it.