On Sunday, November 17, 2002, at 10:01  AM, Peter Dimov wrote:

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.
    }
Why is it important that the type of the deleter be able to vary at runtime? It seems to me that this problem could be more elegantly and efficiently solved if the shared_ptr's deleter type were fixed at compile time.

BTW, the deleter is not required to have an address. For example, the
current shared_ptr implementation can easily be made to optimize out
checked_deleter<Y> instances.
A compressed_pair-style optimization will return an address (reference) even for members whose space has been optimized away.

-Howard

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

Reply via email to