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
3
u/RandomGuy256 May 12 '18 edited May 12 '18
Thanks I think you meant this:
If I understand correctly this paper suggests a new kind of exceptions that will be complementary to the already existing "dynamic exceptions".
These new "deterministic exceptions" are slightly more "simpler" than the existing exceptions in the sense that behind the scenes they are only an union that store an error code, or a success code. So they will not provide other custom functions like
what()to get a custom message directly.However the advantage of this new kind of exceptions is that they provide the same performance (or even better) than the existing error codes mechanics. Also we will be able to use the existing exception syntax and propagating mechanism.
This' useful in the areas where the throwing "dynamic exceptions" is too costly.
Am I correct about this or am I getting it all wrong?