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