
1 Sep
2005
1 Sep
'05
1:08 a.m.
Christopher Kohlhoff <chris@kohlhoff.com> 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