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

Method getNextBox

Exercises/NoModules/Chapter 12/Soln12_06/Truckload.cpp:72–80  ·  view source on GitHub ↗

Only thing we changed was adding "Iterator::" to the member's qualification

Source from the content-addressed store, hash-verified

70
71// Only thing we changed was adding "Iterator::" to the member's qualification
72SharedBox Truckload::Iterator::getNextBox()
73{
74 if (!m_current) // If there's no current...
75 return getFirstBox(); // ...return the 1st Box
76
77 m_current = m_current->m_next; // Move to the next package
78
79 return m_current? m_current->m_box : nullptr; // Return its box (or nullptr...).
80}
81
82void Truckload::addBox(SharedBox box)
83{

Callers 2

findLargestBoxFunction · 0.45
findSmallestBoxFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected