Program logic bugs vs input/environmental errors

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 16 00:44:38 PDT 2014


On 10/15/2014 6:54 PM, Sean Kelly wrote:
> I hate to say it, but I'm inclined to treat nothrow the same as in C++, which is
> to basically pretend it's not a part of the language. The efficiency is nice,
> but not if it means that throwing an Error will cause the program to be
> invalid.  Please tell me there's no plan to change the unwinding behavior when
> Error is thrown in standard (ie not nothrow) code.

Don't throw Errors when you need to unwind. Throw Exceptions. I.e. use enforce() 
instead of assert().



More information about the Digitalmars-d mailing list