title: Are lambdas inlined like functions in C++?
body: <p>Can/does the compiler inline lambda functions to increase efficiency, as it might with simple standard functions?</p>
  
  <p>e.g.</p>
  
  <pre><code>std::vector&lt;double&gt; vd;
  std::for_each(vd.begin(), vd.end(), [](const double d) {return d*d;});
  </code></pre>
  
  <p>Or is there loss of efficiency caused by lack of optimisation?</p>
  
  <p>A second question: where I can check if the compiler I use has optimised calls of inline functions, which are sent to an algorithm? What I mean is, if a function—not a function object—is sent to an algorithm, the last one gets a pointer to the function, and some compilers optimize pointers to inline functions and others don't.</p>