
Episode 118: C++ Allocators with Zach Laine! (Part 2)
Algorithms + Data Structures = Programs
00:00
Is There a Better Way to Standardize Container Adapters?
The big problem that I have with allocators, the thing that started getting me so dead set against them was when I heard that we added all these constructors to the container adapters. There's no need for the stack to know about allocation or allocators, it doesn't allocate. So, if you have a vector that has a custom allocator, which is part of the vectors type, this way allocators work, you can just stick that into your stack. And then people are trying to add all these interfaces that do this allocating stuff to things that never allocate. That makes me crazy, because there's a non-trivial cost to all these things.
Transcript
Play full episode