#include "Stack.h" #include "Exception.h" template void Stack::Push( const Etype & X ) { if( TopOfStack + 1 == Array.Length( ) ) Array.Double( ); Array[ ++TopOfStack ] = X; } template void Stack::Pop( ) { EXCEPTION( IsEmpty( ), "Can't Pop an empty stack" ); TopOfStack--; } template const Etype & Stack::Top( ) const { EXCEPTION( IsEmpty( ), "Can't Top an empty stack" ); return Array[ TopOfStack ]; }