title: lambdas and `const std::function&` arguments - minimizing copies
body: <p>If I have code like this:</p>
  <pre><code>int executeTypeErased(const std::function&lt;int()&gt;&amp; f)
  {
      return f();
  }
  
  void test()
  {
      executeTypeErased([] {
          return 42;
      });
  }
  </code></pre>
  <p>When I call <code>test()</code>, am I guaranteed that no heap allocations occur due to the <code>std::function</code>?  I know that I am guaranteed that no heap allocations occur if I wrap this in a <code>std::reference_wrapper</code>, but I'm less certain with an undecorated lambda as an argument, promoted to <code>std::function</code>.</p>