3 ms·
Stateful allocators require a word be dedicated to the allocator in the header. In my use cases, I always have access to the allocator, but I need to create a l
by thechao 4y ago
Stateful allocators require a word be dedicated to the allocator in the header. In my use cases, I always have access to the allocator, but I need to create a lot of containers — most staying empty, to boot! Paying the extra overhead is morally objectionable.
- messe 4y agoC++ might have the advantage here then: it's a template parameter, in other words, the allocator is decided at compile-time, meaning that no additional storage space would be needed if you know in advance which allocator you intend on using.