On 3/13/23, Ralph Corderoy <ralph(a)inputplus.co.uk> wrote:
That said, I absolutely loathe exceptions with
all my heart.
I'm not a fan either.
Exceptions play merry hell with compiler optimizations. If you are in
a piece of code where an exception can occur, unless you have
knowledge of the global side-effects of the handler(s) that might get
invoked you must abandon any attempts to do data flow analysis of
global data items.
The C++ Standard Library is fond of using throw and catch exception
handling. An optimizing compiler pretty much has to throw all data
flow optimization involving global variables, or things passed to a
callee by pointer, if anything in the call chain calls a C++ Standard
From a compiler writer's perspective, the name STD for the C++
Standard Library is most apt. STD routines are a disease that infects
anything that touches them.