apstack

template <class itemType>

class apstack

{

      public:

   

      // constructors/destructor

      apstack( );                                            // construct empty stack

      apstack( const apstack & s );                // copy constructor

      ~apstack( );                                          // destructor

 

      // assignment

      const apstack & operator = ( const apstack & rhs );

 

      // accessors

      const itemType & top( )  const;             // return top element (NO pop)

      bool  isEmpty( )  const;                         // return true if empty, else false

      int  length( )   const;                              // return number of elements in stack

 

      // modifiers

      void push( const itemType & item );      // push item onto top of stack

      void pop( );                                          // pop top element

      void pop( itemType & item );                // combines pop and top

      void makeEmpty( );                              // make stack empty (no elements)

};