News for hackers. Stuff that matters.
Re:Under the hood of C++ lambdas and std::function by gpderetta on Monday March 28, 2016 @02:32PM (#11376243)
In principle there is no difference, in practice until relatively recently some popular compilers would fail to inline calls via function pointers. The reason is that the inliner would need to run after constant propagation and after the HOF function itself, i.e. sort, has been inlined. With function objects and templates you get a distinct instance of sort for each callback type so the target is known statically even before any optimisation starts.

There are no comments on this comment yet.