Search

December 30, 2011
Learn »
Thanks, Jonathan, for your detailed answer.

Ashish

December 30, 2011
Learn »
...stack won't be unwound properly, so RAII, scope statements, and finally blocks aren't...
December 30, 2011
Learn »
Ok, now there are two issues here:
IMPLEMENTATION: Implementation of a safe_exit() without an...
December 30, 2011
Learn »
And how would it do that? The only way in the language to properly unwind...
December 30, 2011
Learn »
...following code shows that exit() breaks C++ RAII.

#include <iostream>
#include <cstdlib>

struct SafeExit {
    ~SafeExit...
December 30, 2011
Learn »
A D exit function would have to do essentially the same thing as throw an...
December 29, 2011
Learn »
Yeah, really. I'd been using the C exit() as well. Seems like a pretty...
December 29, 2011
Learn »
Could druntime hook up on the atexit function to run destructors and similar when the...
December 29, 2011
Learn »
Thanks, Andrej. That option had occurred to me, but I figured that shouldn't be...
December 29, 2011
Learn »
...main() to return your status code. Unlike
exit(), throwing will take care of RAII stuff.
75 76 77 78 79 80 81 82 83 84 85 86
Next ›   Last »