Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-08-31 20:08:52


Christopher Kohlhoff <chris_at_[hidden]> writes:

> Hi Felipe,
>
>
> The overhead is not the virtual function call itself, but all the other
> stuff that gets generated by the compiler as soon as you add a virtual
> function to a class (e.g. vtable, RTTI etc).
>
...
>
> By doing this little workaround, I can guarantee for all compilers that
> the overhead for each handler is limited to a single function, which is
> called through a function pointer.

That technique was first used in Boost.Function, IIUC. I'm not trying
to direct credit, just letting the list know there's ample precedent
for this kind of thing.
 

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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