Boost logo

Boost :

From: Larry Evans (jcampbell3_at_[hidden])
Date: 2003-01-30 23:40:03

Philippe A. Bouchard wrote:
> "Larry Evans" <jcampbell3_at_[hidden]> wrote in message
> [...]
>>Only if you want to collect cycles or provide some other means for
>>accessing the arcs in the pointer graph. As a matter of fact, it may
>>be better to do somewhat like shared_ptr does, i.e. instead of storing
>>a ip_descriptor*, just store something like counted_base, where the
>>actual instance is a derived class, counted_impl<T>, which knows the
>>"real" type, T, of the object pointed to.
> What about typeid(* m_ptr).name() which is also virtual and returns a real
> compile-time id?
But that means m_ptr must point to something with a virtual function, but
what I was proposing would allow m_ptr to be non-virtual. Instead, the
ip_descriptor would "takeover" to purpose of the virtual dtor with no extra
overhead than that required for accessing the internal pointers. Only instead
of having a virtual function table pointer, there'd be the ip_descriptor* in
the gc_header.

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