Source of ListingC5-2.h


  1: //  Created by Frank M. Carrano and Timothy M. Henry.
  2: //  Copyright (c) 2017 Pearson Education, Hoboken, New Jersey.

  4: // Listing C5-2 (This class appears in C1-7)

  6: template<class ItemType>
  7: class MagicBox : public PlainBox<ItemType>
  8: {
  9: private:
 10:    bool firstItemStored;
 11: public:
 12:    MagicBox();
 13:    MagicBox(const ItemType& theItem);
 14:    void setItem(const ItemType& theItem);
 15: }; // end MagicBox