Boost logo

Boost :

From: Trey Jackson (tjackson_at_[hidden])
Date: 2004-06-07 19:01:56


I just started looking at boost::any, pretty nice. I looked at the
implementation, and it uses (as you know) a pointer to an object
(w/virtual methods) on the heap, and typeid to determine if conversion is

I understand the memory implications (a new object copied on heap).
But I'd like to get a better handle on performance, namely:

I'm unfamiliar with typeid - and how it's implemented.

Does anyone have good pointers to how typeid is generally implemented?
Or even specifically: I'm using gcc3.x on RH Linux.

I'd just like to avoid/guarantee I'm not going to be hit by some O(N)
look-up for using typeid a lot.



Trey Jackson
"Her hair glistened in the rain like nose hair after a sneeze."
-- Chuck Smith, Woodbridge

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