1234567891011121314151617
template <typename T> bool Stack<T>::operator==(const Stack<T>& rhs) const{ Stack<T> tempA=*this, tempB = rhs; for(int i = 0; i < MAX_STACK;i++){ T topRHS,topLHS; tempB.getTop(topRHS); tempA.getTop(topLHS); if(topLHS != topRHS){ return false; } tempA.pop(); tempB.pop(); } }