// StackType.h in StackType2/
// templated stack class

//note no typedef of ItemType and no ItemType class

const int MAX_ITEMS=100;


template<class ItemType>     //ItemType is the template parameter
class StackType {
 public:
    StackType();
    void MakeEmpty();
    bool IsEmpty() const;
    bool IsFull() const;
    void Push(ItemType item);
    void Pop(ItemType& item);
 private:
    int top;
    ItemType items[MAX_ITEMS];  //an array of whatever ItemType is
};


//templates require that declaration and implementation be together
// either in the same file (as in textbook's example, page 195) or
// like this:

#include "StackType.cpp"
 
//Either way, the .cpp file can not be compiled separately from the client code.
//So no more Makefiles and no more Projects for this course, as everything will
//now use templates.
