class Item_base{
public:
Item_base(const std::string &book = " ",double sales_price = 0.0):
isbn(book), price(sales_price){} //在构造函数运行前就初始化类成员,此构造函数灵活的接受0,1,2个实参的调用
std::string book() const {return isbn}; //申明为cons成员函数
virtual double net _price(std::size_t n) const {return n*price;} //定义为虚函数,在派生类中重写,启用动态绑定,在运行时根据实参确定
virtual ~Item_base() {}
private:
std::string isbn;
protected:
double price;
};