Is there a way to write a lambda expression inside an IF with everything captured? : <p>It's my understanding that if I use the syntax [&amp;] in a lambda expression, then my lambda expression has access to surrounding variables and parameters of the function.</p>

<p>Therefore, I tried to write the following (simplified) code</p>

<pre><code>if ( [&amp;]() 
     {
        bool b = false;
        return b;
     }
   )
  {
     // Do something in TRUE part of if statement
  }
</code></pre>

<p>but I get the error "Value of type 'lambda at...' is not contextually convertible to 'bool'</p>

<p>Would appreciate some insight into this issue.</p>

<p>Many thanks,
D</p>
