4 ms·
Thanks. Do you know what the knock-on effects are of disabling exceptions in modern C++? Are there parts of the language or standard library that won’t work wit
by pansa2 7y ago
Thanks. Do you know what the knock-on effects are of disabling exceptions in modern C++? Are there parts of the language or standard library that won’t work without exceptions?
- paulddraper 7y agoThe standard library uses exceptions, but in ways that are avoidable. Not using exceptions does necessitate avoiding the `new` operator, or allowing your program to terminate on OOM. [1] https://stackoverflow.com/questions/37700365/if-youre-in-the-we-dont-use-exceptions-camp-then-how-do-you-use-the-standar https://stackoverflow.com/questions/37700365/if-youre-in-the... [2] https://news.ycombinator.com/item?id=13354027 https://news.ycombinator.com/item?id=13354027
- kabdib 7y agoMany of the large C++ projects I've been on are exceptionless, but do throw an OOM exception which is caught at a very high level. That's usually the point where a crashdump is taken and some other forensics are gathered; a decent strategy is to freeze threads (if you can), release some reserve memory and try to gather evidence. Doesn't always work . . .
- paulddraper 7y agoSome "exceptionless" projects actually disable exceptions entirely via compiler flag.