|
Boost : |
From: Iain K. Hanson (iain.hanson_at_[hidden])
Date: 2003-08-28 12:25:31
On Thu, 2003-08-28 at 17:46, E. Gladyshev wrote:
> --- Peter Dimov <pdimov_at_[hidden]> wrote:
> >
> > You can use all smart pointers except shared_ptr and shared_array as they do
> > not allocate any memory. In particular, intrusive_ptr is a good candidate if
> > memory is a concern as it has smaller memory footprint than shared_ptr.
>
> Thanks, I'll consider it next time.
> However if Boost doesn't have a clear memory management
> concept, how can I guarantee that the next time around,
> intrusive_ptr or something else in boost
> won't start allocating memory under the covers.
> It is perfectly legal in Boost.
> How will I even know it, the documentation is completely
> ignorant on the memory issues.
Both dynamic_bitset and multi_array are allocator enabled. array isn't
for obvious reasons.
What you are looking for is a policy based smart pointer. Boost does not
*yet* have one of these, although David Held has one under development
in the sandbox but I don't know what state it is in.
Policy based design is fairly recent and people are experimenting with
them. But then you probably wouldn't want to put experimental code into
production ;-).
/ikh
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk