title: Casting enum to int in a template parameter
body: <p>I have defined a custom <code>enum</code> for convenience over a particular class, and it is now getting in the way for getting it processed by more general processes.</p>
  
  <p>How should I perform this typecast?</p>
  
  <pre><code>// A templated value holder:
  template &lt;typename T&gt;
  struct Holder {
      T _value;
  };
  
  // A more general process..
  template &lt;typename T&gt;
  struct General {
      Holder&lt;T&gt; *holder;
  };
  // ..over integral types:
  struct IntGeneral : General&lt;int&gt; {};
  // Here is something interesting: I can tell that this process will work on
  // any enum type. But I've found no way to make this explicit.
  
  // Convenience for a particular case
  typedef enum {One, Two, Three} Enum;
  typedef Holder&lt;Enum&gt; Particular;
  
  
  int main() { 
  
      Particular* a( new Particular { One } );
      IntGeneral ig { static_cast&lt;Holder&lt;int&gt;*&gt;(a) }; // compiler grumbles
  
      return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>This is what I get:</p>
  
  <pre><code>error: invalid static_cast from type ‘Particular* {aka Holder&lt;Enum&gt;*}’ to type ‘Holder&lt;int&gt;*’
  </code></pre>
  
  <p>Is there a way I can keep the convenient <code>Enum</code> and get this code compiled?</p>
  
  <hr>
  
  <p>EDIT: This turned out to be an <a href="https://meta.stackexchange.com/q/66377/278779">XY problem</a>. An answer to Y has been accepted here, and several discussed.
  X has been moved to <a href="https://stackoverflow.com/q/32316875/3719101">another question</a>.</p>