title: constexpr and std::cout working on function but not in lambda
body: <p>Why <code>constexpr</code> does not work with <code>std::cout</code>, but works with <code>printf</code>?</p>
  
  <pre><code>#include &lt;iostream&gt;
  constexpr void f() { std::cout &lt;&lt; ""; } //error
  constexpr void g() { printf(""); } //ok
  </code></pre>
  
  <p>And why <code>std::cout</code> works with lambdas <code>constexpr</code>?</p>
  
  <pre><code>#include &lt;iostream&gt;
  int main () {
      auto h = []() constexpr { std::cout &lt;&lt; ""; }; //ok
  }
  </code></pre>