Liste des Groupes | Revenir à cl c |
Am 08.06.2025 um 17:08 schrieb Muttley@DastardlyHQ.org:
>Its no different to C++ exceptions except obviously no destructors>
are called so there's no chance to do a tidy up at each stack level.
It's much more complicated than exceptions because the functions where
the error raises and where the error is "caught" need shared global
variables. C++ doesn't need that, just throw and catch and everything
is glued to the runtime.
And the problem with your solution is: All functions between the setjmp-
and the longjmp-calls don't have any cleanup, i.e. they don't handle
back their opened resources to the runtime or the kernel. With RAII in
combination with exceptions that's for free.
Do you really think setjmp() / longjmp() is a competitive solution ?
You're naive.
Les messages affichés proviennent d'usenet.