T
tonytech08
Scenario: An n-deep nesting of RAII contructors and an error occurs at
level n.
One doesn't need the C++ exception machinery to handle the error: an
installable handler (for example, set_new_handler()) can be used to
handle the error. If the error cannot be corrected ("handled") by any
installed handler (perhaps there is a hierarchy of installed
handlers), the stack needs to be unwound (destructors called) on all
the constructed RAII objects. An Unwind() function that would enable
installable handlers to be used in place of C++ exceptions seems to be
curiously missing.
Is the alternative to exceptions described above feasible if there was
an Unwind() function provided by the standard or the platform?
level n.
One doesn't need the C++ exception machinery to handle the error: an
installable handler (for example, set_new_handler()) can be used to
handle the error. If the error cannot be corrected ("handled") by any
installed handler (perhaps there is a hierarchy of installed
handlers), the stack needs to be unwound (destructors called) on all
the constructed RAII objects. An Unwind() function that would enable
installable handlers to be used in place of C++ exceptions seems to be
curiously missing.
Is the alternative to exceptions described above feasible if there was
an Unwind() function provided by the standard or the platform?