title: assigning lambda to std::function
body: <p>Why is the 2nd assignment allowed, when the inferred return type is std::nullptr_t? With function pointers this is forbidden.</p>
  
  <p>And why doesn't the 2nd lambda run?</p>
  
  <pre><code>#include &lt;cstdio&gt;
  #include &lt;functional&gt;
  
  int main()
  {
      std::function&lt;void* ()&gt; f;
  
      f = []() -&gt; void* {
          printf ("runs\n");
          return nullptr;
      };
      f();
  
      f = []() {
          printf ("doesn't run\n");
          return nullptr; // -&gt; std::nullptr_t
      };
      f();
  
      return 0;
  }
  </code></pre>