title: Dependent function template parameter
body: <p>Let's say that I want the return value of a function template to be determined by the some template argument. I can use <code>auto</code>:</p>
  <pre><code>template&lt;int&gt;
  auto foo2();
  
  template&lt;&gt;
  auto foo2&lt;5&gt;() {
      return std::make_optional(5.0);
  }
  </code></pre>
  <p>However, it's not clear to me how this is possible without <code>auto</code>. Let's say my function template is:</p>
  <pre><code>template&lt;int, typename T&gt;
  std::optional&lt;T&gt; foo();
  
  template&lt;&gt;
  std::optional&lt;double&gt; foo&lt;5, double&gt;() {
      return std::make_optional(5.0);
  }
  </code></pre>
  <p>To use this, I now need to specify both parameters. Is there any way around this? I guess with a class I could do a partial specialization with a default value for the second parameter, but not with a function.</p>