35 return out <<
"Widget " <<
w.id;
50 return wid.
id == testid;
56 std::cout <<
"Received order for widget type " << wid << std::endl;
59 wehave = std::find_if (on_hand.begin (), on_hand.end (),
61 if (wehave != on_hand.end ()) {
62 std::cout <<
"Ship " << *wehave << std::endl;
63 on_hand.erase (wehave);
66 std::cout <<
"Back order widget of type " << wid << std::endl;
67 on_order.push_front (wid);
74 std::cout <<
"Received shipment of widget type " << wid << std::endl;
76 idList::iterator weneed = std::find (on_order.begin (),
77 on_order.end (), wid);
78 if (weneed != on_order.end ()) {
79 std::cout <<
"Ship " <<
Widget (wid) <<
" to fill back order"
81 on_order.erase (weneed);
84 on_hand.push_front (
Widget (wid));
90 std::cout <<
"Widget Works test program" << std::endl;
101 std::cout <<
"End of widget words test program" << std::endl;
bool operator==(const Widget &lhs, const Widget &rhs)
std::ostream & operator<<(std::ostream &out, const Widget &w)
bool operator<(const Widget &lhs, const Widget &rhs)