title: Lambda in C++0x: error: conversion from to non-scalar type requested
body: <p>I've faced with problem while compiling lambda-function:</p>
  
  <pre><code>... (int level = 3) ...
  QString str = [level] {QString s;for(int i=0;i++&lt;level;s.append(" "));return s;};
  </code></pre>
  
  <p>Content of the error:</p>
  
  <pre><code>error: conversion from 'GainStatistic::getWidgetAndProps(QObject*, int)::&lt;lambda()&gt;' to non-scalar type 'QString' requested
  </code></pre>
  
  <p>I've tried this variant:</p>
  
  <pre><code>... (int level = 3) ...
  QString str ([level] {QString s;for(int i=0;i++&lt;level;s.append(" "));return s;});
  
  error: no matching function for call to 'QString::QString(GainStatistic::getWidgetAndProps(QObject*, int)::&lt;lambda()&gt;)'
  </code></pre>
  
  <p>But lambda-expression in a function is simply value of some type? Is that right? Thus, <code>QString(lambda-that-returns-QString)</code> must call the <code>QString::QString(const QString&amp; ref)</code> constructor and this must work:</p>
  
  <pre><code>... (int level = 3) ...
  QString str([level] {const QString&amp; ref = "123";return ref;}); //leads to the same error
  </code></pre>
  
  <p>Another variant:</p>
  
  <pre><code>QString str = [level]-&gt;QString {QString s;for(int i=0;i++&lt;level;s.append(" "));return s;};
  
  error: expected token ';' got 'str'
  </code></pre>
  
  <p>MinGW 4.6.1</p>