| 86 | } |
| 87 | |
| 88 | void Truckload::addBox(SharedBox box) |
| 89 | { |
| 90 | auto package{ new Package{box} }; // Create a new Package |
| 91 | |
| 92 | if (m_tail) // Check list is not empty |
| 93 | m_tail->m_next = package; // Append the new object to the tail |
| 94 | else // List is empty |
| 95 | m_head = package; // so new object is the head |
| 96 | |
| 97 | m_tail = package; // Either way: the latest object is the (new) tail |
| 98 | } |
| 99 | |
| 100 | bool Truckload::removeBox(SharedBox boxToRemove) |
| 101 | { |