title: Lambda of a lambda : the function is not captured
body: <p>The following program do not compile :</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;functional&gt;
  #include &lt;algorithm&gt;
  #include &lt;cstdlib&gt;
  #include &lt;cmath&gt;
  
  void asort(std::vector&lt;double&gt;&amp; v, std::function&lt;bool(double, double)&gt; f)
  {
      std::sort(v.begin(), v.end(), [](double a, double b){return f(std::abs(a), std::abs(b));});
  }
  
  int main()
  {
      std::vector&lt;double&gt; v({1.2, -1.3, 4.5, 2.3, -10.2, -3.4});
      for (unsigned int i = 0; i &lt; v.size(); ++i) {
          std::cout&lt;&lt;v[i]&lt;&lt;" ";
      }
      std::cout&lt;&lt;std::endl;
      asort(v, [](double a, double b){return a &lt; b;});
      for (unsigned int i = 0; i &lt; v.size(); ++i) {
          std::cout&lt;&lt;v[i]&lt;&lt;" ";
      }
      std::cout&lt;&lt;std::endl;
      return 0;
  }
  </code></pre>
  
  <p>because :</p>
  
  <pre><code>error : 'f' is not captured
  </code></pre>
  
  <p>What does it mean and how to solve the problem ?</p>