For the Standard allocator interface for use in, say, std::vector
, is re-allocation supported? I have a rather specific use-case in which being able to reallo
You can put a bool flag in the structure you are saving in the std::vector to indicate it its logically deleted or not. To delete an element set this flag to true but don't physically delete it. To reallocate an element, look for an flag that's true, set it to false to show its not deleted and that use it.