Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-11-18 07:24:04


Gennadiy Rozental wrote:
> Let say we have somewhere map<T*,shared_ptr<T>*> registry;
>
> if( registry[raw_ptr] == 0 ) {
> t = shared_ptr<T>( raw_ptr )
> registry.add( raw_ptr, &t );
> }
> else
> t = *registry[raw_ptr];
>> }
>
> Do I miss something important?

The problem is that a shared_ptr<T> and a shared_ptr<U> can share ownership,
and that they both can actually contain a V, derived from T and U.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk