Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2001-03-27 12:56:35


Daryle Walker wrote:
>> I think I changed it because I heard that compilers inline function objects
>> better than functions.

on 3/27/01 9:45 AM, Jens Maurer at Jens.Maurer_at_[hidden] wrote:
> This sounds like a very platform-dependent claim which is hopefully
> backed by lots of benchmarks on different platforms? In other words:
> This is most certainly not correct in general.

Although this is platform-dependent, it's not really just one programmer's
opinion. For example, Bjarne mentions this in section 18.4 of The C++
Programming Language. To quote him (page 515 of the Special Edition): "For
example, it is easier to inline the application operator of a class than to
inline a function passed as a pointer to a function. Consequently, function
objects often execute faster than do ordinary functions."

    -- Darin


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk