| 10 | SharedBox findSmallestBox(const Truckload& truckload); |
| 11 | |
| 12 | int main() |
| 13 | { |
| 14 | Truckload load; // Create an empty list |
| 15 | |
| 16 | // Add 12 random Box objects to the list |
| 17 | const size_t boxCount{ 12 }; |
| 18 | for (size_t i{}; i < boxCount; ++i) |
| 19 | load.addBox(randomSharedBox()); |
| 20 | |
| 21 | std::cout << "The random truckload:\n"; |
| 22 | load.listBoxes(); |
| 23 | std::cout << std::endl; |
| 24 | |
| 25 | std::cout << "The same random truckload in reverse:\n"; |
| 26 | load.listBoxesReversed(); |
| 27 | std::cout << std::endl; |
| 28 | |
| 29 | std::cout << "The largest box (found using forward iteration) is "; |
| 30 | findLargestBox(load)->listBox(); |
| 31 | std::cout << std::endl; |
| 32 | |
| 33 | std::cout << "The smallest box (found using reverse iteration) is "; |
| 34 | findSmallestBox(load)->listBox(); |
| 35 | std::cout << std::endl; |
| 36 | } |
| 37 | |
| 38 | SharedBox findLargestBox(const Truckload& truckload) |
| 39 | { |
nothing calls this directly
no test coverage detected