Skip to content

Implement multi-exception destructors #12

@kammce

Description

@kammce

Multi-exception destructors, or MED for short, is an idea where, rather than calling std::terminate when a destructor terminates, simply allocate the memory for the new exception and continue propagation. Now if the exception from the destructor or the thrown exception can be a valid catch. Once we reach a valid catch block, we stop exception propagation.

It may also be useful for the catching exception to check to see if a particular exception was thrown along with the caught type. We could investigate what is needed to provide a function like so:

template<typename T>
std::optional<T&> get_additional_thrown_exception(T&);

Assuming we get std::optional<T&> in the standard, with this, you either get a reference to the thrown object that follows that type OR you get nullopt.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions