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

Method removeBox

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

Source from the content-addressed store, hash-verified

132}
133
134bool Truckload::removeBox(SharedBox boxToRemove)
135{
136 for (auto* current{ m_head }; current != nullptr; current = current->m_next)
137 {
138 if (current->m_box == boxToRemove) // We found the Box!
139 {
140 removePackage(current);
141 return true;
142 }
143 }
144
145 return false; // Return false: boxToRemove was not found
146}
147
148bool Truckload::removeBox(Iterator iter)
149{

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected