In labs 13 and 14 you created a priority queue that was derived from vector. The queue held instances of qElem and allowed you to sort the queue based on the priority.
For this assignment you are to create a Stack class that is also derived from vector. Your Stack should work like the queue in that it will hold instances of qElem. This is the same element that you used for the queue class. In this instance we are not goiong to be using the int that holds the priority but we are reserving the space in the case we need to create a priority stack derived from our stack class.
Your stack should allow you to create a stack of any type.
StackiStack; // Holds ints
StacksStack
Your stack should have the following functionality:
Operator overloads. You should also implement the following operator overloads.
Specifics. You should use the qElem struct that you created in labs 13 and 14. This struct should be a template type so that it can hold a value of any type.
The Stack should be derived from vector and should also be a template class so that it can operate on any type
Handling Errors. You should create a StackError class that has a string as the data section to hold the reason the error was thrown. You should throw an error under the following conditions
Make sure the error message thrown is appropriate. Some thing like "Empty Stack" should be sufficient.
For this assignment it is important that you understand inheritance and to use it properly.