| 47 | } |
| 48 | |
| 49 | void Truckload::listBoxes() const |
| 50 | { |
| 51 | const size_t boxesPerLine{ 4 }; |
| 52 | size_t count {}; |
| 53 | for (Package* package{m_head}; package; package = package->m_next) |
| 54 | { |
| 55 | std::cout << ' '; |
| 56 | package->m_box->listBox(); |
| 57 | if (! (++count % boxesPerLine)) std::cout << std::endl; |
| 58 | } |
| 59 | if (count % boxesPerLine) std::cout << std::endl; |
| 60 | } |
| 61 | |
| 62 | void Truckload::listBoxesReversed() const |
| 63 | { |