title: Are C++ enums slower to use than integers?
body: <p>It's really a simple problem : </p>
  
  <p>I'm programming a Go program. Should I represent the board with a <code>QVector&lt;int&gt;</code> or a <code>QVector&lt;Player&gt;</code> where</p>
  
  <pre><code>enum Player
  {
      EMPTY = 0,
      BLACK = 1,
      WHITE = 2
  };
  </code></pre>
  
  <p>I guess that of course, using Player instead of integers will be slower. But I wonder how much more, because I believe that using <code>enum</code> is better coding.</p>
  
  <p>I've done a few tests regarding assigning and comparing Players (as opposed to <code>int</code>)</p>
  
  <pre><code>QVector&lt;int&gt; vec;
  vec.resize(10000000);
  int size = vec.size();
  
  
  for(int i =0; i&lt;size; ++i)
  {
      vec[i] = 0;
  }
  
  
  for(int i =0; i&lt;size; ++i)
  {
      bool b = (vec[i] == 1);
  }
  
  
  QVector&lt;Player&gt; vec2;
  vec2.resize(10000000);
  int size = vec2.size();
  
  
  for(int i =0; i&lt;size; ++i)
  {
      vec2[i] = EMPTY;
  }
  
  
  for(int i =0; i&lt;size; ++i)
  {
      bool b = (vec2[i] == BLACK);
  }
  </code></pre>
  
  <p>Basically, it's only 10% slower. Is there anything else I should know before continuing?</p>
  
  <p>Thanks!</p>
  
  <p>Edit : The 10% difference is not a figment of my imagination, it seems to be specific to Qt and QVector. When I use std::vector, the speed is the same</p>