title: Passing variadic template parameter to another function with a variadic template parameter
body: <p>I'm currently writing a logger for my engine and I've been stuck with a problem I could not solve. <a href="https://en.cppreference.com/w/cpp/utility/format/format" rel="nofollow noreferrer"><code>std::format</code></a> takes in a constant string and a list of arguments after.</p>
  <p>My Log functions is as follows:</p>
  <pre><code>template &lt;typename... Args&gt;
  void Log(const char* message, Args&amp;&amp;... args)
  </code></pre>
  <p>Now in somewhere in the function scope, I try to format the string by:</p>
  <pre><code>std::string formattedMsg = std::format(message, args);
  </code></pre>
  <p>And I try to mess with it:</p>
  <pre><code>Scope&lt;Colour::Logger&gt; myLogger = CreateScope&lt;Colour::Logger&gt;(&quot;MyLogger&quot;);
  myLogger-&gt;Log(&quot;Hey! I have a variable named \&quot;a\&quot; and it is equal to {0}&quot;, a);
  myLogger-&gt;Info(&quot;Hey! I have a variable named \&quot;a\&quot; and it is equal to {0}&quot;, a);
  myLogger-&gt;Log(&quot;Hey! I have a variable named \&quot;a\&quot; and it is equal to {0}&quot;, a);
  myLogger-&gt;Warn(&quot;Hey! I have a variable named \&quot;a\&quot; and it is equal to {0}&quot;, a);
  myLogger-&gt;Error(&quot;Hey! I have a variable named \&quot;a\&quot; and it is equal to {0}&quot;, a);
  myLogger-&gt;Fatal(&quot;Hey! I have a variable named \&quot;a\&quot; and it is equal to {0}&quot;, a);
  myLogger-&gt;Info(&quot;Hey! I have a variable named \&quot;a\&quot; and it is equal to {0}&quot;, a);
  </code></pre>
  <blockquote>
  <p>Scope is unique_ptr, CreateScope is make_unique. Info, Fatal, Trace etc. functions just set the level to correct one and call Log().</p>
  </blockquote>
  <p>But that gives me the error:</p>
  <blockquote>
  <p>std::_Basic_format_string::_Basic_format_string': call to immediate function is not a constant expression</p>
  </blockquote>
  <p>I tried doing stuff like taking in a _Fmt_String, std::string, const char*, I tried expanding the arguments, forwarding them but none of them work. How can I format this <code>message</code> parameter using the <code>args</code> parameter using <code>std::format</code>?</p>