title: Calling a template member function having existing name
body: <p>please see the following code:</p>
  
  <pre><code>namespace std {
      template &lt;std::size_t I, class T&gt;
      auto&amp; get(my_tuple_like_type&lt;T&gt;&amp; t)
      {
          std::size_t ext = t.template extent&lt;I&gt;(); // This line
          // .... do something with ext and return
      }
  }
  </code></pre>
  
  <p>As you can see, I'm trying to specialize (overload) <code>std::get</code> to make my own class template <code>my_tuple_like_type</code> somewhat <code>std::tuple</code>-like.</p>
  
  <p>But gcc 5.4.0 complains that the constant <code>I</code> is not a type name. It seems that the reason is there is already a name <code>std::extent</code> which is a class template.</p>
  
  <p>A workaround I can think of is to forward the call to a free-standing implementation function declared outside <code>namespace std</code>. But I wonder, <strong>is this the right behavior according to the standard?</strong> Or is it just another bug of gcc?</p>
  
  <p>I guess this should be a bug, since clang and MSVC both compile the above code just fine. On the other hand, Nvidia's CUDA compiler (nvcc) produces a similar error message.</p>
  
  <p>Thank you.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Providing overloads inside <code>namespace std</code> is forbidden (<a href="https://stackoverflow.com/questions/14402990/should-you-overload-swap-in-the-std-namespace">Should you overload swap in the std namespace?</a>), so I was doing a wrong thing.</p>
  
  <p>But I can't see potential problems this may induce. Is there any reason why overloadings on user-defined types are forbidden?</p>