assert(expression, error)

bearophile bearophileHUGS at lycos.com
Sat Feb 12 08:20:07 PST 2011


Andrej Mitrovic:

> Right. That's why I need it in this case, since the library can return
> null at runtime due to user or even (audio) hardware errors.

So in your case enforce is OK.
(In general, I suggest to use D design by contract a lot (with asserts)).

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list