|
Boost : |
Subject: Re: [boost] [ptr_container] ptr_vector across DLL boundaries
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-06-26 04:30:35
Robert Dailey skrev:
> If you want to provide a stateful clone allocator, it would allow me to do
> something like this:
> class clone_allocator
> {
> public:
> clone_allocator()
> {
> dll_clone_object = GetProcAddress();
> }
> MyClass* operator() ( MyClass const& node )
> {
> return dll_clone_object( node )
> }
>
> private:
> MyClass* (*dll_clone_object)( MyClass const& );
> };
>
> Note that the above is pseudocode. The point is, it would allow me to
> abstract the DLL factory function for creating clones, thus giving me full
> control over which 'delete' and 'new' method is called (In this case, it
> would be the one from the DLL's memory manager).
Ok. This should be very easy to add.
I'm going to additionally require that a clone allocator is
1. default constructible
2. nothrow swapable
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk