MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / listBoxes

Method listBoxes

Exercises/Modules/Chapter 12/Soln12_06/Truckload.cpp:48–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.45

Calls 1

listBoxMethod · 0.45

Tested by

no test coverage detected