title: initialization by lambda expression in c++
body: <p>i write follow code：</p>
  
  <pre><code>static int count = []()-&gt;int
                     {
                         int count = 0;
  
                         for(int i = 0; i &lt; categories.size(); ++i)
                         {
                             if(!categories[i].isCategory())
                             {
                                 count++;
                             }
                         }
  
                         return count;
                     };
  </code></pre>
  
  <p>and got error:<code>error: cannot convert '__lambda0' to 'int' in initialization</code>.</p>
  
  <p>does the meaning of my code fragment is assign the <code>__lambda0</code> to <code>static int count</code> instead of return the inner count?</p>