Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2004-03-25 17:27:14


From: "Matthew Hurd" <matt_at_[hidden]>
>
> I'm a simple fellow and get confused about who is responsible for =
> deleting a
> raw buffer, is it me, the library, should it be free or delete? Maybe I =
> get
> a pointer the buffer and I must free it. May I get the pointer to the
> buffer and I should do nothing... When I create the buffer and send it =
> to
> the library, the lib will delete, so I shouldn't but should I malloc or =
> new
> the thing?

Isn't that the purpose of shared_ptr and shared_array?

> Any way, to kill annoying mozzie with a hammer I wrote a little policy
> buffer, perhaps others might find this useful and it might make its way =
> into
> a utility section somewhere in boost. =20

The header wasn't in this message, so I can't see what problem
you're really trying to solve.

> I also had a goal of the potential for binary compatibility with a =
> struct
> buffer { size t size; char * data; } as per WSABUF on win32, and many =
> other
> standardish buffers, which limited the choices a little.

Interesting.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk