Boost logo

Boost :

From: Murray Cumming (murrayc_at_[hidden])
Date: 2001-08-17 07:56:45

Peter Dimov wrote:
> From: "Murray Cumming" <murrayc_at_[hidden]>
> > I'd like to use the shared_ptr smart pointer, but the underlying types
> > that I am using have their own specific *_alloc() and *_drop() functions
> > instead of using new/delete.
> Another mandatory link to
> The variant in can do
> shared_ptr<my_type> p(my_alloc(), &my_drop);

No, I think that's enough because allocation/deallocation is rarely that

For instance, for the freaky Sybase client library that I'm wrapping:

- The allocation functions don't just return the instance. The instance
pointer is an input argument and the result is a success/error code.
- Some allocation functions require extra data/instances, so my smart
pointer has a non-default constructor that actually allows me to specify
an *instance* of an allocator. e.g.:

Connection::Connection(Context& context)
  : Base<CS_CONNECTION, Allocator_Connection>(new

> You only need to convince Beman that this is a good idea. :-)
> --
> Peter Dimov
> Multi Media Ltd.
> Info: Unsubscribe: <mailto:boost-unsubscribe_at_[hidden]>
> Your use of Yahoo! Groups is subject to

Murray Cumming

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