Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 1999-10-09 07:36:57

Andy Glew wrote:

> ...
>As usual^2, I am somewhat unhappy at using virtual functions,
although that is the only way

I used to worry about using virtual functions too. Then I actually
timed the additional cost, and stopped worrying. If the function
does almost anything beyond simply returning, the virtual function
dispatch cost is just not material.

Of course, if the virtual function simply returns a value, and the
alternative is an inline non-virtual function, then the relative cost
of a virtual function is high. But if the function does almost any
computation, the relative cost drops rapidly toward zero.


Boost list run by bdawes at, gregod at, cpdaniel at, john at