title: More specific template deduction
body: <p>I have primary template and three partial specializations, that the compiler considers as ambiguous:</p>
  
  <pre><code>#include &lt;vector&gt;
  
  template&lt;typename ... ARGS&gt;
  struct queryBuilder;
  
  template&lt;typename INTERNALDATA,
           template&lt;typename&gt; typename ICONTAINER,
           template &lt;typename&gt; typename ECONTAINER&gt;
  struct queryBuilder&lt;ECONTAINER&lt;ICONTAINER&lt;INTERNALDATA&gt;&gt;&gt;
  { };
  
  template&lt;typename PARAM,
           template&lt;typename&gt; typename T&gt;
  struct queryBuilder&lt;T&lt;PARAM&gt;&gt;
  { };
  
  template&lt;typename PARAM1,
           typename PARAM2,
           template&lt;typename,typename&gt; typename T&gt;
  struct queryBuilder&lt;T&lt;PARAM1, PARAM2&gt;&gt;
  { };
  
  template&lt;typename T&gt;
  struct queryBuilder&lt;T&gt;
  { };
  
  int main() {
    queryBuilder&lt;std::vector&lt;std::vector&lt;int&gt;&gt;&gt; q; // error: ambiguous
  }
  </code></pre>
  
  <p>I'm using g++ 7.3.0 with -std=c++17.</p>
  
  <p>Everything works just fine if we, as suggested in comments, provide allocators parameters for both containers in first specialization.</p>