
Christian Schladetsch skrev:
PS. Perhaps just porting ptr_container to use boost::container rather than
std::container would solve Roberts problem?
No. He needs to "install" his own new/delete with the container.
Isn't this called a stateful allocator? Which boost::container supports?
Hm. Is it? So construct() and destroy() would act as custom allocator/deleter? Anyway, let's say that all allocation is done with the supplied allocator via rebind<>. This is what you require to use ptr_container with monotonic allocators, right? But how do you get objects into the ptr_container in the first place? Do you intend users to write container c; c.push_back( c.get_allocator().construct( c.get_allocator().allocate(sizeof(T)) ); ? And how do you pass constructor arguments to construct? -Thorsten