Explications of the
by Arne Mertz
From the article:
I have written about handling exceptions some time ago, and about the levels of exception safety last week. What I have not touched yet are exception specifications. I will catch up on those with this post.
C++98 had the possibility to denote the types of exceptions that could be thrown from a given function by using
throw(<exception list>). In theory, the runtime had to check if any exception emitted by the function was indeed in that list or derived from one of the types in the list. If it wasn’t, the handler
std::unexpectedwould be called...