title: How to specialize a template-class with doubles?
body: <p>I write a template class dependent on a given type and variadic types, like so:</p>
  
  <pre><code>template&lt;typename ConstType,typename...Inputs&gt;
  class ConstantTensor;
  </code></pre>
  
  <p>Then I write another class, which is generally defined in this way (assume <code>wrong_type</code> whatever type you want, but which is different from the following specialization ):</p>
  
  <pre><code>template&lt;typename T&gt;
  class X{
  public:
  using type=wrong_type;
  }
  </code></pre>
  
  <p>And I also have a specialization of this kind:</p>
  
  <pre><code>template&lt;typename ConstType,typename...Inputs&gt;
  class X&lt; ConstantTensor&lt; ConstType ,Inputs...&gt;&gt;
  {
  public:
  using type=right_type;
  }
  </code></pre>
  
  <p>My problem is that, if I define the type <code>ConstantTensor&lt;ConstType,double&gt;</code> and then I want to use  <code>X&lt;ConstantTensor&lt;ConstType,double&gt;&gt;::type</code>, the general case is called and not the specialization. So I obtain <code>wrong_type</code> instead of <code>right_type</code>. I guess it has to deal with the <code>double</code> type...Could you explain me why and how can I solve this issue? Thank you in advance.</p>
  
  <p><strong>EDIT:</strong>
  Here a snippet of code, I hope it works:</p>
  
  <pre><code>class Scalar
  {};
  
  
  template&lt;typename ConstType,typename...Inputs&gt;
  class ConstantTensor
  {
    public:    
    constexpr ConstantTensor(const Inputs&amp;...inputs)
    {}
  };
  
  template&lt;typename ConstType,typename...Inputs&gt;
  constexpr auto Constant(const Inputs&amp;...inputs)
  {return ConstantTensor&lt;ConstType,Inputs...&gt;(inputs...);}
  
  template&lt;typename T&gt;
  class X{
  public:
  using type=int;
  };
  
  template&lt;typename ConstType,typename...Inputs&gt;
  class X&lt;ConstantTensor&lt;ConstType,Inputs...&gt;&gt;{
  public:
  using type=char;
  };
  
  int main()
  {
  constexpr auto delta=Constant&lt;Scalar&gt;(2.0);
  using type= X&lt;decltype(delta)&gt;::type; // this is int not char
  }
  </code></pre>