4 ms·
> I thought destructors were all noexcept now... Destructors are noexcept by default, but that can be overridden with noexcept(false). > or at the very least
by aw1621107 1y ago
> I thought destructors were all noexcept now...
Destructors are noexcept by default, but that can be overridden with noexcept(false).
> or at the very least if you didn't noexcept, and then threw something, it just killed the process.
IIRC throwing out of a destructor that's marked noexcept(false) terminates the process only if you're already unwinding from something else. Otherwise the exception should be thrown "normally".