Why do we use a reference in the catch statement? Down below where it says catch(MyException &e) . What is the point of using the reference? I've found that without the reference the output is the same. Also, could someone explain what virtualconstchar* what() constthrow() means exactly. I've used the class exception on this site and I don't really understand what all it does.
The higher-level exception handler may in fact expect the exception to be rethrown unchanged (this is part of what's called "exception-neutral" when describing a library).
Although I agree that it is much like top-level const on a function definition; it is not part of any interface, it's just a constraint on the body of the handler.