I'm doing the exercises from Stroustrup's C++ Programming Language 4th Edition. One of the tasks is formulated like this:
Consider using a class Exception as the base of all classes used as exceptions. What should it look like? How should it be used? What good might it do? What disadvantages might result from a requirement to use such a class?
The answer looks pretty much like std::exception
, save for the disadvantages part - the only one I can imagine is the cost of __vptr
which is usually considered negligible. What am I missing here?