assert(0) behavior

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 4 04:58:08 PDT 2015


On 8/3/15 9:11 PM, Walter Bright wrote:

> enforce(), etc., are for CHECKING FOR INPUT ERRORS. Environmental errors
> are input errors, not programming bugs.

enforce isn't available in druntime. In this case, we don't want to 
throw an exception anyways, or we would have to remove nothrow from 
core.time. Technically, usage of this unsupported clock will ALWAYS 
throw, or NEVER throw. That's difficult to encode into the system.

The only answer I can think of is to write a message to stderr, and then 
assert(0) as meta suggested.

-Steve



More information about the Digitalmars-d mailing list