title: c++11 variadic template method completely shadow base class method?
body: <p>I have the following problem( see code below).</p>
  
  <p>In a class that inherits from a base class, I want to be able to have two implementations of <code>operator()</code>. One that takes integers, one that takes "indices", see simple <code>Index</code> class.
  The <code>operator(ints...)</code> will be in the child class, while I need to have the <code>operator(Index...)</code> in the parent class (also with different return type.)</p>
  
  <p>The code below is not the exact design but a minimal working example explaining the final problem.</p>
  
  <p>Problem is, if I put <code>operator(Index...)</code> in the child class, everything is good. If I put it in the base class, i get a compilation error:</p>
  
  <pre><code>error: no match for call to ‘(Tensor&lt;1, int&gt;) (Index&lt;'i'&gt;&amp;)’
  </code></pre>
  
  <p>when I call <code>vec(i)</code> and the end of the <code>main()</code>. I understand the compiler doesn't find the good method, but why ? Is there some "shadowing" rule associated to variadic templates ? </p>
  
  <p>Thanks !</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;type_traits&gt;
  
  template&lt;char i&gt;
  class Index{
  public:
      Index(){};
  };
  
  template&lt;int order, typename T, class tensor_type&gt;
  class Tensor_traits{
    public:
  
        //// here, doesn't compile ! !
      //template &lt;char i&gt;
      //T&amp;operator()(Index&lt;i&gt; &amp;ii){
      //std::cout &lt;&lt; "puet" &lt;&lt; std::endl;
      //}
  };
  
  
  template&lt;int order, typename T&gt;
  class Tensor : public Tensor_traits&lt;order, T, Tensor&lt;order, T&gt;&gt; {
      private:
      int data[3] = {1,2,3};
      public:
      Tensor(){};
  
      template &lt;typename... Idx&gt;
          typename std::enable_if&lt;std::is_same&lt;Idx...,int&gt;::value
          or std::is_same&lt;Idx...,unsigned int&gt;::value
          or std::is_same&lt;Idx...,size_t&gt;::value, T&amp;&gt;::type
          operator()(const Idx&amp;... idx){
          return data[0]; //dummy here, actually i do other stuff !
          }
  
      // here, works!
      template &lt;char i&gt;
          T&amp;operator()(Index&lt;i&gt; &amp;ii){
          std::cout &lt;&lt; "puet" &lt;&lt; std::endl;
          }
  
  };
  
  
  int main() {
  
      Tensor&lt;1,int&gt; vec1;
  
      std::cout&lt;&lt; vec1(1) &lt;&lt; std::endl;;
  
      Index&lt;'i'&gt; i;
  
      vec1(i);
  }
  </code></pre>