D
dragan
I got the idea and material for this thread from the "high-class" ( ) ng
clc++m. Please add any commonly held/observed misconceptions about C++
exceptions or exceptions in general. Both mechanism and condition
misconceptions are fine. I'll start...
"Exceptions invoke all destructors while unwinding the stack."
I think that is probably incorrect, though I'm not a compiler writer so
can't say with high certainty that it is a misconception. I hypothesize that
the compiler introduces some kind of "jumps to the closing brace" and lets
the normal destruction of stack class objects happen. An explicit mechanism
that is part of the exception machinery that calls destructors? I don't
think so.
clc++m. Please add any commonly held/observed misconceptions about C++
exceptions or exceptions in general. Both mechanism and condition
misconceptions are fine. I'll start...
"Exceptions invoke all destructors while unwinding the stack."
I think that is probably incorrect, though I'm not a compiler writer so
can't say with high certainty that it is a misconception. I hypothesize that
the compiler introduces some kind of "jumps to the closing brace" and lets
the normal destruction of stack class objects happen. An explicit mechanism
that is part of the exception machinery that calls destructors? I don't
think so.