title: Why I can not return initializer list from lambda
body: <p>Why this code is not valid?</p>
  <pre><code>auto foo = [] () {
      return {1, 2};     
  };
  </code></pre>
  <p>However, this is valid since the <code>initializer_list</code> is used just to initialize a <code>vector</code> not to return itself:</p>
  <pre><code>auto foo = [] () -&gt; std::vector&lt;int&gt; {
      return {1, 2};     
  };
  </code></pre>
  <p>Why I can not return <code>initializer_list</code>? It could be useful. For example, a lambda that can be used to initialize a <code>vector</code> or a <code>list</code> or ... with some default values for something.</p>