| 7 | #include "Can.h" // for the Can class |
| 8 | |
| 9 | int main() |
| 10 | { |
| 11 | Box box {40, 30, 20}; |
| 12 | Can can {10, 3}; |
| 13 | Carton carton {40, 30, 20, "Plastic"}; |
| 14 | ToughPack hardcase {40, 30, 20}; |
| 15 | |
| 16 | std::vector<const Vessel*> vessels {&box, &can, &carton, &hardcase}; |
| 17 | |
| 18 | for (const auto* vessel : vessels) |
| 19 | std::cout << "Volume is " << vessel->volume() << std::endl; |
| 20 | } |