title: How does lambda capture local static variable?
body: <p>In below code I do not specify any capture mode, yet some_static is visible inside closure. So the question is whether it is actually captured, or maybe somehow referenced in other way.</p>
  
  <p>Bonus question is whether compiler is allowed to turn such lambda into a free function instead of closure - that would be possible as no capture list is specified.</p>
  
  <pre><code>std::vector&lt;std::function&lt;bool(int)&gt;&gt; filters;
  
  int main()
  {
      static int some_static = 1;
      filters.emplace_back([](int){
        return some_static == 2;
      });
  }
  </code></pre>