3 ms·
Well, you could compile everything with noexcept and not use exceptions, but that would certainly make large chunks of the STL useless.
by dodobirdlord 5y ago
Well, you could compile everything with noexcept and not use exceptions, but that would certainly make large chunks of the STL useless.
- _b 5y agoWhat? Everything in the STL works fine without exceptions. Only wrinkle is if one wants to handle out of memory in way besides crashing, although there is generally nothing better to do. Besides, the kernel will often kill processes rather than return malloc failures (see the OOM killer) anyway.
- dodobirdlord 5y agoIIRC, STL constructors throw if they can’t run successfully. I suppose if you’re sure that OOM is the only thing that is going to cause constructors to fail, you can just live with allocation failures causing program termination.