title: (How) can I count the items in an enum?
body: <p>This question came to my mind, when I had something like</p>
  
  <pre><code>enum Folders {FA, FB, FC};
  </code></pre>
  
  <p>and wanted to create an array of containers for each folder:</p>
  
  <pre><code>ContainerClass*m_containers[3];
  ....
  m_containers[FA] = ...; // etc.
  </code></pre>
  
  <p>(Using maps it's much more elegant to use: <code>std::map&lt;Folders, ContainerClass*&gt; m_containers;</code>)</p>
  
  <p>But to come back to my original question: What if I do not want to hard-code the array size, is there a way to figure out how many items are in Folders? (Without relying on e.g. <code>FC</code> being the last item in the list which would allow something like <code>ContainerClass*m_containers[FC+1]</code> if I'm not mistaken.)</p>