Exploding Error Codes (C++)
engvhack.blogspot.com
engvhack.blogspot.com
https://groups.google.com/group/comp.lang.c++.moderated/brow...
The OP there did not pass an extra parameter, but used the return value itself to deliver the exploding return code.
I've used this from time to time as a debugging aid, because it allows me to track down places in my code where I forget error checks. Using the exploding codes in live code is not a good idea however, because they rely on throwing in destructors, which is a bad thing to do.
API documentation: http://library.gnome.org/devel/glib/stable/glib-Error-Report....
Of course, glib being C it cannot provide the same level of checking that C++ can do, so it's quite basic, but also quite nice to work with.
"Those who do not know history are doomed to reinvent CORBA_Environment."
(Although there are few new details, such as the aborting if the dtor determines it wasn't checked.)
Checked exceptions don't give you exception safety for free: they give you boilerplate code, and exception safety is still up to the developer.
(I never bought the argument about exceptions obfuscating control flow, either.)