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