Unit 02 of 02
The Standard Library
Containers, iterators and their validity rules, algorithms, the erase–remove idiom, lambdas, ranges and type deduction — each paired with the question of what an operation leaves in the source.
Published Updated
Lessons
- 01 Containers The measurement of how a map's operator[] read inserts an element when the key is absent, and how find and contains leave the source unchanged. 12 min read
- 02 Iterators and Validity The measurement of how reading an iterator after erase enters undefined behavior, and how an iterator that stays valid remains unchanged. 13 min read
- 03 Algorithms The measurement of how std::sort changes a vector in place, and how read-only algorithms such as std::count leave the source unchanged. 1 min read
- 04 The Erase–Remove Idiom The measurement of how the elements left in a vector's tail after std::remove carry an unspecified value, and how erase actually removes that tail. 14 min read
- 05 Lambdas and Function Objects The measurement of how a lambda's non-mutable capture-by-value leaves the source unchanged, and how the captured copy stays independent across calls. 13 min read
- 06 Ranges The measurement of how a view constructed from an lvalue leaves the underlying container unchanged, and how a view chain is evaluated lazily. 12 min read
- 07 Type Deduction How auto drops const and reference, auto&/const auto&/auto&&, decltype and decltype(auto), the copy-versus-reference difference in structured bindings, and what type deduction leaves in the source. 13 min read