Boost logo

Boost :

From: Nathan Myers (ncm_at_[hidden])
Date: 1999-08-29 18:04:26

Andy Glew wrote:
> Since I cannot afford the overhead of virtual functions in many places
> (measured: 20% slowdown) I explicitly design data structures for use
> in inheritance hierarchies, statically overriding methods.

For this usage pattern, templates with (partial) specialization would
probably be a more appropriate mechanism. It would also allow inlining
and the optimizations inlining enables, as well as metaprogramming
techniques. If 20% overhead is a problem, surely a 2x-5x speedup
is attractive?

Probably Boost will eventually have many cases where both a
polymorphic and a template-based library do approximately the
same job.

Nathan Myers

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