I'm not a Windows programmer, but it seems to me that using structured exception handling to treat hardware exceptions like software exceptions means that:
- Your code does something that in the C++ standard produces undefined or implementation-defined behaviour (such as dividing by zero).
- Windows defines that with SEH enabled it throws an exception in that case.
- You are using this fact to catch the exception and/or execute a termination handler.
So the questions to ask, IMO, are:
- Is your programming task really of a nature that standard C++ cannot handle? (or can only handle in a way which is measurably inferior to what you get by allowing the hardware exception).
- Do you really need to take action when your code goes non-standard?
- Can you write your code so that it doesn't provoke hardware exceptions in the first place?
If the answers are 'yes', 'yes', 'no', then structured exception handling is needed. Otherwise you may be able to avoid it, in which case you probably want to. Writing exception-safe code is tricky, so the stronger the exception guarantees you can offer the better. Code which maybe divides by zero with SEH isn't offering the nothrow guarantee, when perhaps with a bit of redesign so that callers don't give it duff data, it could do so. But if a function already has to throw exceptions for other reasons, then also possibly throwing them for hardware traps might make things no worse.
One notable special case is memory allocation. Not sure if .NET does this, but on linux allocation only fails if there's insufficient virtual address space for the allocation. Physical memory is committed on first use, and causes a hardware exception if there isn't enough. Since memory allocation is supposed to throw std::bad_alloc on failure, and the implementation fails to implement this requirement of the standard, it may be that in some cases converting the hardware exception to software is the right thing to do. However, that hardware exception can occur in unexpected places, (including in routines you thought were nothrow), so may still be impossible to handle gracefully, which is why linux core dumps instead of throwing. In practice, anything that gets initialised fully will crash its constructor, which is often close enough to the allocation that a software exception instead would be useful.