Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-02-24 12:41:11

David Abrahams wrote:
> I'd like to be able to stick all the generated code for using
> get_deleter<X>(sp), for a given X, on one side of a shared library
> boundary. The closest thing I've been able to find in the public
> interface is:
> my_get_deleter(shared_ptr<void>(sp))
> but that incurs reference-counting, at the very least.

A typical desktop (Athlon 1.4GHz) can make about three million shared_ptr
copies per second (Windows XP, multi-threaded build.) ;-)

> I realize this
> is somewhat of a low-level consideration, but I wonder if it makes
> sense to expose the shared_ptr's shared_count?

This is something that we might consider for the Boost implementation since
shared_count is pretty useful in itself, but I don't think that it should go
in the TR. So the "Right Way(tm)" is to use a shared_ptr<void>.

Boost list run by bdawes at, gregod at, cpdaniel at, john at