Skip to main content

Checkpoint: Object-Oriented Design

Challenge on lesson: Checkpoint: Object-Oriented Design

Implement class Library that owns a std::vector<std::string> titles_; plus an inline static int copies_; counting every title ever added across all instances. Provide: void add(std::string title) (push_back and bump the static counter), std::size_t size() const, bool has(const std::string& title) const, and static int total_copies().

Difficulty: intermediate

Back to lesson: Checkpoint: Object-Oriented Design