
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