title: c++: ensure enum values are unique at compile time
body: <p>I have the following <code>enum</code> that describes error codes:</p>
  
  <pre><code> typedef enum {
      et_general           = 0,
      et_INVALID_CLI_FLAG  = 1,
      ...
      et_undef = 500
    } EErrorType;
  </code></pre>
  
  <p>The main reason why I explicitly write the enum values, is to ease the debug process.<br>
  Anyways, I wonder if there's a way, to <strong>make the compiler complain about non unique values</strong>. 
  I can always check it at run time easily, but I'd like to avoid that. </p>
  
  <p>I've read this <a href="https://stackoverflow.com/q/11263396/1798187">post</a> and reviewed this <a href="https://stackoverflow.com/a/11263967/1798187">answer</a>. As I understand, that answer suggests to generate the enum in such way that it "<em>make it much harder to make mistakes</em>".<br/>
  I'd would like to leave the enum definition as is, or close to it.</p>