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

Method listBoxes

Examples/NoModules/Chapter 12/Ex12_17/Truckload.cpp:36–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void Truckload::listBoxes() const
37{
38 const size_t boxesPerLine{ 4 };
39 size_t count {};
40 for (Package* package{m_head}; package; package = package->getNext())
41 {
42 std::cout << ' ';
43 package->getBox()->listBox();
44 if (! (++count % boxesPerLine)) std::cout << std::endl;
45 }
46 if (count % boxesPerLine) std::cout << std::endl;
47}
48
49
50SharedBox Truckload::getFirstBox()

Callers 1

mainFunction · 0.45

Calls 3

getNextMethod · 0.45
listBoxMethod · 0.45
getBoxMethod · 0.45

Tested by

no test coverage detected