A clean and minimal map API
summary
Proposes a map with four concrete operations lookup insert update remove where lookup returns success plus key and value, insert returns whether an insertion happened plus key/value, update inserts if missing and otherwise replaces, and remove returns ownership of the removed key/value. Implements lazy and emplacement overloads that call user callables only on actual inserts, a small‑size optimization with inline buffer plus a type eraser map_ref and a fast read‑only map_view that precomputes buffer pointers for much faster repeated reads.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 0:22Four fundamental map APIs
- 0:39Model
- 0:58Key
- 1:18Update
- 2:16Other APIs
- 2:55Map API
- 3:08Overloads
- 3:37Updating
- 3:49Overload
- 4:05lambdas
- 4:40vote
- 5:43map ref type
- 6:04type ratio
- 7:09conversion operators
related talks
49mSee the tries for the trees
55mBreaking Dependencies: Type Erasure - The Implementation Details
28mDeep Dive Into API Machinery
01h 31mWhen Abstractions Fix Too Much - Towards Flexible Library Design
48mJourneys with Maps, Riemann, http.async.client, Canon fodder
01h 20mBetter Code: Relationships
56m“High Performance Code 201: Hybrid Data Structures"
59mThe Most Valuable Values
