title: Can a lambda instantiate a template function?
body: <p>Questions regarding the use of C++14 generic lambdas or C++20 template lambdas are typically about generating lambdas with the appropriate parameterized types.</p>
  <p><em>My question is</em>, is it possible for a lambda parameter, or its evaluation, to force the instantiation (or <em>specialization</em>) of a template, e.g., a template function? The parameter <code>(n)</code> would need to be qualified as <code>constexpr</code> for this to work.</p>
  <pre><code>template &lt;int n&gt; ret_type fn (...) {...}
  ...
  auto fx = [] (int n) { return fn&lt;n&gt;(...) }
  </code></pre>
  <p>I'm not completely up to date with C++20, or newer working proposals, and admit there are still nuances with <code>constexpr</code>, etc., in C++17 lambdas and other edge features, that have me looking up <code>cppreference</code>, Josuttis, and others pretty frequently.</p>
  <p>I know this close to an XY-problem. Since template instantiation is performed at compile time, a lambda expression for a template parameter seems like an anti-pattern. But since templates <em>can</em> be instantiated if types and constant values are known at compile time, are there any proposals to allow such a mechanism?</p>