title: tuple index out of bounds, variadic template
body: <p><a href="https://onlinegdb.com/N1tp3JG5u" rel="nofollow noreferrer">DEMO</a></p>
  <p>How I could read the <code>args</code> of this variadic template, as it can be any number of arguments?</p>
  <pre><code>#include &lt;tuple&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  
  enum class traceErr
  {
     err1, err2
  };
  
  template &lt;typename... Args&gt;
  void TraceErr(traceErr err, Args&amp;&amp;... args)
  {
      auto pack = std::make_tuple(std::forward&lt;Args&gt;(args)...);
  
      std::string str;
  
      switch (err)
      {
      case traceErr::err1:
          str = &quot;Err: &quot; + std::to_string(std::get&lt;0&gt;(pack));
      break;
  
      case traceErr::err2:
          str = &quot;Err: &quot; + std::to_string(std::get&lt;0&gt;(pack)) + &quot; &quot;
          + std::get&lt;1&gt;(pack);
      break;
      }
  
      std::cout &lt;&lt; str &lt;&lt; std::endl;
  }
  
  int main()
  {
      TraceErr(traceErr::err1, 1);
      TraceErr(traceErr::err2, 2, &quot;etc&quot;);  
  }
  </code></pre>
  <p>In the example above I'm getting these errors:</p>
  <p><code>static_assert failed: 'tuple index out of bounds</code></p>
  <p><code>'get': no matching overload function found</code></p>
  <p>Because the number of args being passed are different, how i could 'fix' it to work with any number of args?</p>