June 2025
Intermediate to advanced
1093 pages
33h 24m
English
Containers constantly request new memory to store their elements. This can be a complex task, especially for noncontiguous containers like list or set. To give users the ability to intervene, each container is equipped with an allocator. If you do not specify one, it defaults to std::allocator<Elem>.
I recommend that you use std::allocator and do not implement your own allocator. If you do, use ones from the Boost project or other major providers. The concept of allocators implemented in the current standard library is much debated and does not make all experts happy. You should not bother delving deeply into this subject unless you really have to.
To show you how to ...
Read now
Unlock full access