title: Why do you use typedef when declaring an enum in C++?
body: <p>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:</p>
  
  <pre><code>typedef enum TokenType
  {
      blah1   = 0x00000000,
      blah2   = 0X01000000,
      blah3   = 0X02000000
  } TokenType;
  </code></pre>
  
  <p>What is this? Why is the <code>typedef</code> keyword used here? Why does the name <code>TokenType</code> appear twice in this declaration? How are the semantics different from this:</p>
  
  <pre><code>enum TokenType
  {
      blah1 = 0x00000000,
      blah2=0x01000000,
      blah3=0x02000000
  };
  </code></pre>