diff --git a/modules/06_oop_basics/src/polymorphism.cpp b/modules/06_oop_basics/src/polymorphism.cpp index cafd0a3..2d36cd0 100644 --- a/modules/06_oop_basics/src/polymorphism.cpp +++ b/modules/06_oop_basics/src/polymorphism.cpp @@ -5,8 +5,7 @@ namespace oop { auto total_area(const std::vector>& shapes) -> double { double total = 0.0; for (const auto& shape : shapes) { - // TODO: Add each shape's area using polymorphism - (void)shape; + total += shape->area(); } return total; } @@ -15,8 +14,7 @@ auto shape_names(const std::vector>& shapes) -> std::vector { std::vector names; for (const auto& shape : shapes) { - // TODO: Collect shape->name() - (void)shape; + names.push_back(shape->name()); } return names; }