90
Can/does the compiler inline lambda functions to increase efficiency, as it might with simple standard functions?
e.g.
std::vector<double> vd;
std::for_each(vd.begin(), vd.end(), [](const double d) {return d*d;});
Or is there loss of efficiency caused by lack of optimisation?
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.