scope() statements and return

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 3 22:13:40 PDT 2014


On Sat, 04 Oct 2014 04:47:44 +0000
deadalnix via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> Write this in sepeareted scope statement?. problem solved.
i don't agree. it makes excessive noise for nothing. and it breaking
the implied promise "all cleanup code will be executed on exit". it's
easy to miss something that can throw in scope(...). so the only other
option is to write this noisy code:

  scope(exit) firstCall();
  scope(exit) secondCall();
  scope(exit) thirdCall();

...and so on. and double-check if everything was really executed --
just in case. 'cause there is no promise to execute cleanup code
anymore.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141004/82df60ea/attachment.sig>


More information about the Digitalmars-d mailing list