newbie problem with nothrow
Daniel9 via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Nov 1 07:38:15 PDT 2016
On Monday, 31 October 2016 at 22:29:19 UTC, Jonathan M Davis
wrote:
> On Monday, October 31, 2016 22:20:59 Kapps via
> Digitalmars-d-learn wrote:
>> Assuming you're sure it'll never throw. To enforce this, use
>> try
>> { } catch { throw new Error("blah"); }. You can still throw
>> errors, just not exceptions (as errors are not meant to be
>> caught).
>
> I always use assert(0). e.g.
>
> try
> return format("%s", 42);
> catch(Exception)
> assert(0, "format threw when it shouldn't be possible.");
>
> - Jonathan M Davis
have the same problem
More information about the Digitalmars-d-learn
mailing list