3 ms·
> Yep, I have to wrap every string-to-number conversion in a try-catch block. Ah, that's simply because C++ exceptions are unwind-only, non-restartable. "Blub
by kazinator 10y ago
> Yep, I have to wrap every string-to-number conversion in a try-catch block.
Ah, that's simply because C++ exceptions are unwind-only, non-restartable.
"Blub" exceptions.
> This is why exceptions are stupid - 80% of the time you want the context provided by the program counter.
Exactly.
Imagine if a CPU exception threw away that context. We couldn't implement virtual memory, which requires faulting instructions to be precisely restarted.
- AstralStorm 10y agoGenerally the context is held by most implementations (And accessible by implementation specific tricks), but that is not required by the standard as some platforms have highly limited stack Or other storage for such data. Why would you want to restart same code after an exception anyway? Conditions have changed...