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

Method listBoxes

Exercises/NoModules/Chapter 12/Soln12_08/Truckload.cpp:49–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49void 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
62void Truckload::listBoxesReversed() const
63{

Callers 1

mainFunction · 0.45

Calls 1

listBoxMethod · 0.45

Tested by

no test coverage detected