[OT] OT: Null checks.
Kagamin
spam at here.lot
Tue May 6 07:10:56 UTC 2025
On Tuesday, 6 May 2025 at 06:11:29 UTC, Walter Bright wrote:
> D is set up so if you throw an `Exception`, then destructors
> will run as the stack unwinds. But if you throw an `Error`, you
> can catch it but the destructors don't run.
>
> The reason is that `Error` means the program has entered an
> invalid state. Nothing in the program can be trusted any more.
> The program should do as little as possible to close down
> gracefully.
>
> The template `std.exception.enforce` works like `assert`, but
> throws an `Exception` instead.
Or do you mean _enforceNoOverlap should be renamed to
_assertNoOverlap?
More information about the Digitalmars-d
mailing list