title: Bind metafunction: accept both types and template template parameters (accept anything)
body: <p>I'm trying to write a <code>Bind</code> metaprogramming template helper metafunction that binds a template parameter to something.</p>
  
  <p>I have a working implementation for simple template metafunctions:</p>
  
  <pre><code>template&lt;typename T0, typename T1&gt;
  struct MakePair
  {
      using type = std::pair&lt;T0, T1&gt;;
  };
  
  template&lt;template&lt;typename...&gt; class TF, typename... Ts&gt;
  struct Bind
  {
      template&lt;typename... TArgs&gt;
      using type = TF&lt;Ts..., TArgs...&gt;;
  };
  
  using PairWithInt = typename Bind&lt;MakePair, int&gt;::type;
  static_assert(std::is_same&lt;PairWithInt&lt;float&gt;, MakePair&lt;int, float&gt;&gt;{}, "");
  </code></pre>
  
  <p>But what if <code>MakePair</code>'s template arguments were template templates? Or simple numerical values?</p>
  
  <pre><code>template&lt;template&lt;typename&gt; class T0, template&lt;typename&gt; class T1&gt;
  struct MakePair0
  {
      using type = /*...*/;
  };
  
  template&lt;template&lt;typename...&gt; class TF, template&lt;typename&gt; class... Ts&gt;
  struct Bind0 { /*...*/ }
  
  // ...
  
  template&lt;int T0, int T1&gt;
  struct MakePair1
  {
      using type = /*...*/;
  };
  
  template&lt;template&lt;int...&gt; class TF, int... Ts&gt;
  struct Bind1 { /*...*/ }
  </code></pre>
  
  <p>A lot of unnecessary repetition. It gets unmanageable if template arguments are mixed between types, template templates, and integral constants.</p>
  
  <p>Is something like the following piece of code possible?</p>
  
  <pre><code>template&lt;template&lt;ANYTHING...&gt; class TF, ANYTHING... Ts&gt;
  struct BindAnything
  {
      template&lt;ANYTHING... TArgs&gt;
      using type = TF&lt;Ts..., TArgs...&gt;;
  };
  </code></pre>
  
  <p><code>ANYTHING</code> would accept types, template templates, template template templates, integral values, etc...</p>