title: std::get using enum class as template argument
body: <p>I'm using a <code>std::tuple</code> and defined a class enum to somehow "naming" each of the tuple's fields, forgetting about their actual indexes. </p>
  
  <p>So instead of doing this:</p>
  
  <pre><code>std::tuple&lt;A,B&gt; tup;
  /* ... */
  std::get&lt;0&gt;(tup) = bleh; // was it 0, or 1?
  </code></pre>
  
  <p>I did this:</p>
  
  <pre><code>enum class Something {
       MY_INDEX_NAME = 0,
       OTHER_INDEX_NAME
  };
  
  std::tuple&lt;A,B&gt; tup;
  /* ... */
  std::get&lt;Something::MY_INDEX_NAME&gt; = 0; // I don't mind the actual index...
  </code></pre>
  
  <p>The problem is that, as this compiled using gcc 4.5.2, I've now installed the 4.6.1 version, and my project failed to compile. This snippet reproduces the error:</p>
  
  <pre><code>#include &lt;tuple&gt;
  #include &lt;iostream&gt;
  
  enum class Bad {
      BAD = 0
  };
  
  enum Good {
      GOOD = 0
  };
  
  int main() {
      std::tuple&lt;int, int&gt; tup(1, 10);
      std::cout &lt;&lt; std::get&lt;0&gt;(tup) &lt;&lt; std::endl;
      std::cout &lt;&lt; std::get&lt;GOOD&gt;(tup) &lt;&lt; std::endl; // It's OK
      std::cout &lt;&lt; std::get&lt;Bad::BAD&gt;(tup) &lt;&lt; std::endl; // NOT!
  }
  </code></pre>
  
  <p>The error basically says that there's no overload that matches my call to <code>std::get</code>:</p>
  
  <pre><code>test.cpp: In function ‘int main()’:
  test.cpp:16:40: error: no matching function for call to ‘get(std::tuple&lt;int, int&gt;&amp;)’
  test.cpp:16:40: note: candidates are:
  /usr/include/c++/4.6/utility:133:5: note: template&lt;unsigned int _Int, class _Tp1, class _Tp2&gt; typename std::tuple_element&lt;_Int, std::pair&lt;_Tp1, _Tp2&gt; &gt;::type&amp; std::get(std::pair&lt;_Tp1, _Tp2&gt;&amp;)
  /usr/include/c++/4.6/utility:138:5: note: template&lt;unsigned int _Int, class _Tp1, class _Tp2&gt; const typename std::tuple_element&lt;_Int, std::pair&lt;_Tp1, _Tp2&gt; &gt;::type&amp; std::get(const std::pair&lt;_Tp1, _Tp2&gt;&amp;)
  /usr/include/c++/4.6/tuple:531:5: note: template&lt;unsigned int __i, class ... _Elements&gt; typename std::__add_ref&lt;typename std::tuple_element&lt;__i, std::tuple&lt;_Elements ...&gt; &gt;::type&gt;::type std::get(std::tuple&lt;_Elements ...&gt;&amp;)
  /usr/include/c++/4.6/tuple:538:5: note: template&lt;unsigned int __i, class ... _Elements&gt; typename std::__add_c_ref&lt;typename std::tuple_element&lt;__i, std::tuple&lt;_Elements ...&gt; &gt;::type&gt;::type std::get(const std::tuple&lt;_Elements ...&gt;&amp;)
  </code></pre>
  
  <p>So, is there any way I can use my enum class as a template argument to <code>std::get</code>? Was this something that wasn't ment to compile, and was fixed in gcc 4.6? I could use a simple enum, but I like the scoping properties of enum classes, so I'd prefer to use the latter if it's possible.</p>