title: Template Metaprogramming - Type deduction based on enum
body: <p>I am trying to implement a flexible container (Maybe something close to NumPy arrays).</p>
  <p>Consider the following code:</p>
  <pre class="lang-cpp prettyprint-override"><code>enum class SupportedTypes { i32, f32 };
  
  struct X {
    SupportedTypes type_;
  
    X(SupportedTypes type) : type_{type} {}
  
    void func() {
      switch (type_) {
        case i32:
          // process data as int.
        case f32:
          // process data as float.
  
      }
    }
  };
  </code></pre>
  <p>Question:
  Can I use template metaprogramming to eliminate the switch case?</p>
  <p>Something like:</p>
  <pre><code>...
  
  using type = unwrap&lt;type_&gt;::type;
  </code></pre>