Using Polymorphic Memory Allocators

Learn to implement custom memory resources with polymorphic allocators.

Polymorphic allocators

If you have followed this chapter, you now know how to implement a custom allocator that can be used with arbitrary containers, including those from the standard library. Suppose we want to use our new allocator for some code we find in our code base that is processing buffers of the type std::vector<int>, like this:

Get hands-on with 1400+ tech skills courses.