Introduction to OOP | Chapter 20: The STL : | next | previous | audio | real | text |
void inventory::receive (int wid) // process a widget received in shipment { cout << "Received shipment of widget type " << wid << endl; list<int>::iterator we_need = find (on_order.begin(), on_order.end(), wid); if (we_need != on_order.end()) { cout << "Ship " << Widget(wid) << " to fill back order" << endl; on_order.erase(we_need); } else on_hand.push_front(Widget(wid)); }