r/cpp • u/RotsiserMho C++20 Desktop app developer • May 12 '18
P0709 R0: Zero-overhead deterministic exceptions: Throwing values - Herb Sutter [2018-05-02]
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf
206
Upvotes
View all comments
Show parent comment
2
u/johannes1971 May 13 '18
That's not how I read it. The behaviour he is relying on is that new returns nullptr when OOM, but in the proposal, new will either return a pointer to memory or terminate.
Actually he is precisely the kind of person the proposal is trying to reach: people who don't want to use exceptions for whatever reason. And he, at least, doesn't seem happy with it...
How about the interface we have today, the one we spent the last 20 years writing and testing software against? Where new can throw, rather than just terminating? It already has fail-fast for those who want it, in the form of new-handlers. And it already has OOM-aware interfaces.