June 2025
Intermediate to advanced
1093 pages
33h 24m
English
After the general guide to container selection, I will show you some specific recipes for handling containers. I have chosen problems that frequently occur in practice:
Is a set really the right container for a sorted collection?
How do I output the contents of a container?
Can I really not add an element to an array?
Answering these questions in the following sections also helps in understanding some fundamental aspects of C++ and the standard library: the linear memory layout of vector, the interaction between streams and containers, and the moving of values.
Note that whenever your use of set splits into two distinct phases for filling and reading, ...
Read now
Unlock full access