On Sunday, November 17, 2002, at 10:01 AM, Peter Dimov wrote:
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.From: "David Abrahams" <[EMAIL PROTECTED]>I haven't encountered a need to inspect the deleter yet... whatinterfaceare 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. }
A compressed_pair-style optimization will return an address (reference) even for members whose space has been optimized away.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.
-Howard
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost