Introduction to OOP: Chapter 16 : A Case Study : The STL [next] [previous] [audio] [real] [text]

Item Arrives in Shipment

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));
}
Intro OOP, Chapter 16, Slide 13