Skip to main content

Checkpoint: The Library, Assembled

intermediate40 min readLesson 130 of 204

The capstone core object: add, find with optional, and an inventory serializer — the whole course in one class.

Library is the final exam because it is the course in miniature:

  • add/find/size are encapsulation (M2-M4) with a clean interface
  • std::optional<const Book*> is the modern result type (M7)
  • inventory() is a serializer (M10) with an exact format contract

The format tests are deliberately strict — A|1\nB|3\n, insertion order, empty string when empty — because exact output is what a persistence boundary means in practice. "Close enough" is a parse error on the way back in.

Finish here and you have touched every layer: types, containers, algorithms, errors, and the seams between them. That is the intermediate bar: not that you have seen the features, but that you can assemble them into a small, working, explainable system.