Boost logo

Boost :

From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2008-01-10 09:35:22

dizzy wrote:
> The final (best?) solution I came with now is using RTTI. RTTI's typeid() is
> by design non-intrusive (actually the way it is implemented by the compiler
> is intrusive but it happens anyway for any polymorphic type so why not use
> it) and it does not have any of the problems listed above, the implementation
> is "small enough" that I can include it here:
If I understand correctly, your implementation is O(n) with n =
size(typelist), right? The advantage of virtual calls is that they're
O(1), no matter how big the hierarchy.

Though if that is a problem in the real world is a different question.
How big are visited class hierarchies usually?

Sebastian Redl

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