scope(exit) do_this_always(); bool success; try { do_a_thing(); success = true; } catch(Exception exception) { handle_error(); } finally { if(success) { depends_on_success_of_thing(); } }
Why not an optional syntax like: finally(bool thrown) { } ?
Andrea Fontana via Digitalmars-d Wed, 28 Sep 2016 00:56:18 -0700
scope(exit) do_this_always(); bool success; try { do_a_thing(); success = true; } catch(Exception exception) { handle_error(); } finally { if(success) { depends_on_success_of_thing(); } }
Why not an optional syntax like: finally(bool thrown) { } ?