assert(expression, error)

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Feb 12 08:05:15 PST 2011


On 2/12/11, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> But
> if
> your function isn't likely to be inlined anyway, or for some reason, you
> just
> don't like having the if statement, then enforce is just fine.
>
> - Jonathan M Davis
>

It's noticeable in code and partially self-documenting, that's why I
use it. I could go with
if (exp) throw new exc();

Same deal, I guess.

As for inlining, I really have yet to push D to it's limits to see
that as a problem.


More information about the Digitalmars-d-learn mailing list