title: Why are lambda expressions not allowed in an unevaluated operands but allowed in the unevaluated portions of constant expressions?
body: <p>If we look at the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3485.pdf" rel="noreferrer">draft C++ standard</a> section <code>5.1.2</code> <em>Lambda expressions</em> paragraph <em>2</em> says (<em>emphasis mine going forward</em>):</p>
  
  <blockquote>
    <p>The evaluation of a lambda-expression results in a prvalue temporary (12.2). This temporary is called the closure object. <strong>A lambda-expression shall not appear in an unevaluated operand</strong> (Clause 5). [ Note: A closure object behaves like a function object (20.8).—end note ]</p>
  </blockquote>
  
  <p>and section <code>5.19</code> <em>Constant expressions</em> paragraph <em>2</em> says:</p>
  
  <blockquote>
    <p>A conditional-expression <strong>is a core constant expression unless</strong> it involves one of the following as a potentially evaluated subexpression (3.2), <strong>but subexpressions of logical AND (5.14), logical OR (5.15), and conditional (5.16) operations that are not evaluated are not considered</strong> [...]</p>
  </blockquote>
  
  <p>and has the following bullet:</p>
  
  <blockquote>
    <p>— a lambda-expression (5.1.2);</p>
  </blockquote>
  
  <p>So why are lambdas expressions not allowed in an unevaluated operand but are allowed in the unevaluated portions of constant expressions?</p>
  
  <p>I can see how for unevaluated operands the type information in several cases(<em><a href="http://en.cppreference.com/w/cpp/language/decltype" rel="noreferrer">decltype</a> or <a href="http://en.cppreference.com/w/cpp/language/typeid" rel="noreferrer">typeid</a></em>) is not very useful since each lambda has a unique type. Although why we would want to allow them in the unevaluated context of a constant expression is not clear, perhaps to allow for <a href="http://en.cppreference.com/w/cpp/language/sfinae" rel="noreferrer">SFINAE</a>?</p>