Module 6 · stack and queue: Last In First Out, First In First Out
Under the Hood: The Container Inside, and Why pop Returns Nothing
ProReading
Kenji's graph problem has 100,000 nodes, and he gives each node its own stack<int>. Before he pushes a single number, his program has taken about 65 MB. Maria asks the question this lesson answers: "But why does an empty stack cost anything?" The answer is the container inside, and you can choose it.
Checking what this lesson needs for you…
What is inside Under the Hood: The Container Inside, and Why pop Returns Nothing
- An adaptor is a class with one member, c
- Choosing the container inside
- What the container must provide, and when GCC checks
- What the container inside costs
- Why pop() returns nothing
- No iterators, and the one reference you get
- The performance lab