Back to Basics: Standard Library Containers in Cpp
summary
Claims and measurements land the decision: std::vector and std::array are your best friends for sequences with contiguous layout and cache wins (benchmark summing 100M elements shows vector ~0.4s vs forward_list ~1.9s, many‑times faster). For key‑value use std::unordered_map often beats std::map by about 3× at 90k keys and ~8× at 90M keys. Also note iterator invalidation, reserve/rehash behavior, and that unordered_map requires a hash and equality.
AI-written summary · about
chapters (30)
- 0:00Introduction
- 1:24Outline
- 2:06Generic Containers
- 2:47Containers
- 7:09Vectors
- 9:46Comparison
- 12:28Sequence Container Overview
- 20:37Vector Container
- 20:56Homogeneous Container
- 21:18Index Operator
- 21:57Insert Operator
- 22:33Deck
- 22:57Linked List
- 23:23Assistive List
- 23:43Signaling List
- 24:04Ordered Associative Containers
- 24:23Phone Books
- 29:40Auto assistive
- 31:27Associative containers
- 31:40Another map
- 35:31Unordered maps
- 36:49Required maps
- 37:50How does it work
- 41:09Why this is the case
- 45:27Your best friends
- 45:51Sequence Containers
- 48:27Performance Test
- 52:47Performance Numbers
- 54:47Phonebook
- 56:07Map
related talks
55mIntroduction to C++ Containers - Know Your Data Structures
48mC++ Data Structures That Make Video Games Go Round
06mUsing STL containers efficiently
45mBeyond Lists: High Performance Data Structures
24mDesigning Fast and Efficient List-like Data Structures
01h 03m#Hashing (Hashing Values)
06mAmortized O(1) Complexity in C++
56mWhy Data Access Patterns Have Always Mattered
