From: "David Abrahams" <[EMAIL PROTECTED]>
> > I haven't encountered a need to inspect the deleter yet... what
interface
> > are you suggesting?
>
> How about:
>
>     // attempt to extract a deleter of type D
>     D* d = boost::get_deleter<D>(p);
>     if (d)
>     {
>         // that was the deleter type used.
>     }

Hmm. Do you really need access to the deleter, or only information about the
deleter type used? Or do you actually need an answer to the question "did I
create this shared_ptr?"

BTW, introspection isn't currently part of shared_ptr because whenever I
encounter a need for yet another shared_ptr feature, I always try _very
hard_ to solve the problem using only the existing public interface. This
unofficial filter has always worked well so far. :-) (And when I failed to
apply it - shared_from_this - it was a mistake.)

Have you considered keeping a std::set< weak_ptr<> > to track shared_ptr
instances created by boost.python? (Shot in the dark, don't yell at me if I
missed the point.)

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to