
Dominique Devienne:
Probably a silly question, but has anyone performed benchmarks on using a std::for_each(begin, end, bind(&C::f, _1)); compared to the hand written loop? Under the debugger I see bind adds a 4 or 5 stack frames between the for_each frame and the C::f frame, so I'm wondering if there is any overhead in these?
It depends (heavily) on the amount of inlining the compiler does. In the
simple case of
#include