Sobes.tech
Junior — Senior

What happens when a destructor throws an exception

livecode

Task condition

What will be the result when calling the following function?

void test_exception_in_destructor()
{
    struct X {
        ~X() {
            throw 1;
        }
    };

    try {
        X x;
    } catch (...) {
    }
}