01 // PROJECT AT A GLANCE
C++ POOL — DAY 16
C++Stop rewriting everything: discovering the standard library containers.
After two weeks implementing lists, stacks and trees by hand, the day reveals that C++ provides all of it, tested and optimised. The point is no longer writing those structures but choosing the right one: each has its strengths and its costs, and picking the wrong container is a performance mistake you only see in production.
Two standard containers put to work: an std::vector of member function pointers for a koala that learns and forgets commands, and two std::stack instances to evaluate an arithmetic expression.
PRIMARYC++
DELIVERYTEAM RECORD
VERIFICATIONgcc/g++
SOURCEINSPECTOR READY
03 // KEY OUTCOMES
- A vector of member function pointers as a table of commands learned on the fly
- The STL stack where day 2 had forced writing it by hand
BEYOND THE BRIEF
- An incremental interface (feed/result/reset) rather than a single evaluation function, which makes it possible to parse a stream without storing it whole
04 // SOURCE TREE
READING SOURCE…