Challenge 1: Fixing cpp1-5's Own Leak With unique_ptr — Possible Solution ==================================================================== #include #include class Circle { public: double radius; Circle(double r) { radius = r; } ~Circle() { std::cout << "Circle destroyed" << std::endl; } }; int main() { std::unique_ptr c = std::make_unique(5.0); // no explicit delete anywhere -- and none is needed return 0; } Output: Circle destroyed WHY THIS WORKS AS AN ANSWER ------------------------------ Unlike cpp1-5's own Challenge 2 (a raw Circle* that was never deleted and produced NO destructor output at all), this version produces "Circle destroyed" even though delete was never written anywhere in the code. c, a unique_ptr, genuinely owns the Circle object; when c itself goes out of scope at the end of main, its own destructor runs automatically (RAII, cpp1-5's own mechanism) and calls delete on the Circle it owns -- closing exactly the gap that chapter's Challenge 2 demonstrated.