Does anyone know of an STL implementation that allows dynamic porting of dynamic allocators to a container instance before dynamically migrating?
The scenario is that we have a shared memory allocator that manages multiple memory pools, and for each instance of say stl :: vector we want to allocate each instance from a different memory pool.
The problem with standard STL implementations is that you can only define a memory pool for a type, i.e. the entire vector of type int will be allocated from one pool.
I already changed our standard stl :: allocator by default for someone who has state, i.e. the pool from which we want to allocate this instance, but this does not work well for say stl :: list, where it allocates things in default ctor.
For reasons related to our library, we also do not have a valid ctor pool for all objects, so we want to call the "set memory pool" function before users can use the stl container.
Does anyone come across an implementation that supports such things?
c ++ stl allocator
user176168
source share