title: C++ variadic function template with multiple typelists
body: <p><a href="https://godbolt.org/z/G6aWez8qE" rel="nofollow noreferrer">Compiler Explorer Demonstration</a> shows what I have found that works as well as a commented out section showing what I want, but that doesn't work.</p>
  <p>I am new to C++ and I am trying to write a sqlite3 interface in C++20 that has type checking for query parameters and returned column types. I have been stuck for several days now and have read so much. I am sure that one of these has my answer, but I just don't understand this stuff well enough to figure out what my issue is:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/38663639/variadic-template-constructor-with-multiple-parameters-packs">Variadic template constructor with multiple parameters packs</a></li>
  <li><a href="https://stackoverflow.com/questions/59712096/template-template-variadic-parameter-pack">template template variadic parameter pack</a></li>
  <li><a href="https://stackoverflow.com/questions/44831474/c-variadic-template-return-type">C++ variadic template return type</a></li>
  <li><a href="https://stackoverflow.com/questions/9831501/how-can-i-have-multiple-parameter-packs-in-a-variadic-template">How can I have multiple parameter packs in a variadic template?</a></li>
  <li><a href="https://stackoverflow.com/questions/42002126/unpacking-a-typelist">Unpacking a typelist</a></li>
  </ul>
  <p>Ultimately, this is what I would like to work</p>
  <pre class="lang-cpp prettyprint-override"><code>template &lt;class... T&gt;
  struct Typelist {};
  
  struct Database {
      Database(const string &amp;sql) {}
      template &lt;class Input, class Output&gt;
      void Query(Input input) {}
      
  
      // error: non-class, non-variable partial specialization
      // 'Query&lt;Typelist&lt;Inputs ...&gt;, Typelist&lt;Outputs ...&gt; &gt;' is not allowed
      template &lt;class... Inputs, class... Outputs&gt;
      vector&lt;tuple&lt;Outputs...&gt;&gt; Query&lt;Typelist&lt;Inputs...&gt;, Typelist&lt;Outputs...&gt;&gt;(
          const string &amp;sql, Inputs... inputs) {}
  };
  
  int main() {
      Database db(&quot;:memory:&quot;);
      vector&lt;tuple&lt;string, string&gt;&gt; people =
          db.Query&lt;Typelist&lt;int, float&gt;, Typelist&lt;string, string&gt;&gt;(
              &quot;SELECT fname, lname FROM users WHERE id = ? AND somefloat = ?;&quot;, 1, 42.0f);
  }
  </code></pre>
  <p>Any observations would be greatly appreciated.</p>