Better HN
topnewbestaskshowjobs
Log inSign up

odradek

-4 karma · joined Jun 3, 2010 (16y ago) · 2 submissions

Submissions

comment 16y ago · link · parent

This is actually a quite old idea. Here's a comp.lang.c++.moderated thread from 2000 discussing the idea:

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.

comment 16y ago · link · parent

Narwhals! Narwhals!!

http://www.youtube.com/watch?v=ykwqXuMPsoc