Customizing the Standard Containers
summary
Covers how standard containers are actually customized: allocator objects versus allocator types, allocator responsibilities (allocators: allocate/deallocate/construct/destroy), and real use cases like memory pools, shared memory and tiny-block allocation for immutable data. Explains comparator requirements and pitfalls including const comparator requirement and strict weak ordering bugs. Demonstrates hashers with primes <100 using three hashes and shows a constant/random-like hasher collapses every element into one bucket (hash collision demo with primes <100), so expect code examples and practical gotchas.
AI-written summary · about
chapters (13)
- 0:00Intro
- 2:10The Standard Containers
- 3:58Customization Methods
- 4:59Allocator Talks this week
- 9:21What does an allocator do?
- 11:24Allocating memory a simple implementation
- 20:27What can you do with this?
- 27:05Creating objects in allocated memory a simple implementation
- 34:01Using your own allocator
- 40:34Allocators and containers
- 43:30What do comparison functions look like?
- 52:26Using your own comparison functions
- 56:35The importance of a good hash function
related talks
52m“Regular Types and Why Do I Care ?”
07mISO/IEC 14882
46mComparison is not simple, but it can be simpler
59mMetaprogramming: From Templates to Concepts
57mHow To Implement the C++ Standard Library - (Part 1 of 2)
38mWhat's New In C++23
01h 29mA Deep Dive Into C++ Object Lifetimes
50mAn insight into Go Garbage Collection
