This is a continuation from stl allocator, a copy constructor of another type, rebind
I am using std :: map and I want the custom allocator to be able to reuse storage for internal nodes. The elements that are stored are pointers, so I'm not talking about reusing them, but only about the internal distributions for the map.
Basic requirements: different instances of the map cannot share the pool of objects, it must be unique for each instance.
I do not need a complete solution, I just would like to understand how to deal with the required copy constructor, which accepts distributors of a different type. I do not know how to manage the internal memory in this case.
c ++
edA-qa mort-ora-y
source share