assert(expression, error)

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Feb 12 07:05:34 PST 2011


On 2/12/11, bearophile <bearophileHUGS at lycos.com> wrote:
> Andrej Mitrovic:
>
>> Yeah, enforce is great.
>
> Enforce is not disabled in release mode.

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.

> Currently a function with enforce
> inside can't be nothrow, and it can't be inlined.
>
> Bye,
> bearophile
>

Of course it can't be nothrow? I thought the idea of enforce is to
throw a custom exception when needed, so how can you expect a function
which throws an exception to be nothrow?

Btw, is the inline problem just a DMD implementation problem, or does
enforce have to be fixed for that?


More information about the Digitalmars-d-learn mailing list