Defining getFirst()
The stub of getFirst() should look like this:
Item List::getFirst() const {
}
The steps it should take are:
- If I am empty (e.g., mySize is zero):
-
throw an underflow_error exception
(with an appropriate error message).
- Return the value of myItem in the Node whose address is in myFirst.
You will need to #include <stdexcept> in order for underflow_error to be declared.