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

Method getPreviousBox

Exercises/Modules/Chapter 12/Soln12_07/Truckload.cpp:104–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104SharedBox Truckload::Iterator::getPreviousBox()
105{
106 if (!m_current) // If there's no current...
107 return getLastBox(); // ...return the last Box
108
109 m_current = m_current->m_previous; // Move to the next package
110
111 return m_current ? m_current->m_box : nullptr; // Return its box (or nullptr...).
112}
113
114void Truckload::addBox(SharedBox box)
115{

Callers 1

findSmallestBoxFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected