Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-20 09:14:05


----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>

> > where "struct subjAB :public A,public B{...}", when compiled and run
with
> > "gcc version 3.1 20011207 (experimental)", fails to delete a_make.
> >
> > I am using Peter's
> http://groups.yahoo.com/group/boost/files/smart_ptr_3.zip.
>
> True, there is no way to detect the general case where a shared_ptr is
being
> constructed from a T * that actually points to something derived from T.

Actually,

    typeid(*p) == typeid(T)

Gets you about as far along as you could hope for (my current work uses
/lots/ of RTTI so this jumped out at me ;-)). Not that you'd probably want
to pay for typeid.

I can imagine a policy which checked for this case being useful in debug
mode for some people.

-DAve


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