title: Templates inside templates. Specializing a template class inside a template function
body: <p>In the following example, I want to get a stl container (either list or unordered_set) using the template function f. I know that the stl container will contain integers.</p>
  
  <p>I tried to use partial template template specialization but it was not working.</p>
  
  <p>How do I achieve what I want?</p>
  
  <p>The code above doesn't compile obviously.</p>
  
  <pre><code>#include &lt;list&gt;
  #include &lt;unordered_set&gt;
  
  template &lt;typename T, template C&lt;T&gt;&gt;
  C&lt;T&gt; f()
  {
      C&lt;T&gt; d;
      d.insert(1);
      return d;
  }
  
  int main()
  {
      auto l = f&lt;int, std::list&lt;int&gt;&gt;();
      auto s = f&lt;int, std::unordered_set&gt;();
  
      return 0;
  }
  </code></pre>
  
  <p>Thanks.</p>