Boost logo

Boost :

Subject: Re: [boost] [ptr_container] ptr_vector across DLL boundaries
From: Robert Dailey (rcdailey_at_[hidden])
Date: 2009-06-26 20:14:11

On Fri, Jun 26, 2009 at 6:42 PM, Thorsten Ottosen <
thorsten.ottosen_at_[hidden]> wrote:

> Robert Dailey skrev:
>> Hi,
>> Suppose I have a DLL that allocates a few objects and places them in a
>> ptr_vector. I then pass this ptr_vector to my executable via a move
>> operation (basically a swap, not a copy). The executable would keep the
>> ptr_vector by value and eventually delete it when it falls out of scope.
> Hi Robert,
> I have checked in a new version in trunk that supports stateful
> clone_allocators.
> You may access the clone_allocator by
> clone_allocator& get_clone_allocator();
> I prefer this to a constructor argument, since there are already so many
> constructors.
> Let me know if this allows you to solve your problem.

Thanks Thorsten,

I'm not familiar with how to use clone allocators in ptr_container yet, so
I'll have to read through the documentation first to make sure I know how to
use them. Given that, at what point will I need to be calling
get_clone_allocator()? I figured I would just give ptr_vector my clone
allocator and never need it back from the container. I expect my clone
allocator to call the appropriate allocation method in its implementation
details, which as I showed in an earlier example, will be a function located
in the DLL itself.

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