ch15/474/Basket.cc
// debugging routine to check contents in a Basket
debugging routine to check contents in a Basket
debugging routine to check contents in a Basket
void Basket::display(ostream &os) const
{
    os << "Basket size: " << items.size() << endl;
    for (const_iter next_item = items.begin();
                  next_item != items.end();
                  next_item = items.upper_bound(*next_item))
    {
        os << (*next_item)->book() << " occurs " 
           << items.count(*next_item) << " times" 
           << " for a price of " 
           << (*next_item)->net_price(items.count(*next_item)) 
           << endl;
    }
}
void Basket :: display ( ostream & os ) const { os << " " << items . size ( ) << endl ; for ( const_iter next_item = items . begin ( ) ; next_item != items . end ( ) ; next_item = items . upper_bound ( * next_item ) ) { os << ( * next_item ) -> book ( ) << " " << items . count ( * next_item ) << " " << " " << ( * next_item ) -> net_price ( items . count ( * next_item ) ) << endl ; } }
debugging routine to check contents in a Basket
debugging routine to check contents in a Basket