I haven\'t written any C++ in years and now I\'m trying to get back into it. I then ran across this and thought about giving up:
typedef enum TokenType
{
This is kind of old, but anyway, I hope you'll appreciate the link that I am about to type as I appreciated it when I came across it earlier this year.
Here it is. I should quote the explanation that is always in my mind when I have to grasp some nasty typedefs:
In variable declarations, the introduced names are instances of the corresponding types. [...] However, when the
typedefkeyword precedes the declaration, the introduced names are aliases of the corresponding types
As many people previously said, there is no need to use typedefs declaring enums in C++. But that's the explanation of the typedef's syntax! I hope it helps (Probably not OP, since it's been almost 10 years, but anyone that is struggling to understand these kind of things).