[phobos] Usage of asserts/contracts and memory safety
thecybershadow.lists at gmail.com
Wed Aug 24 21:23:06 PDT 2011
On Thu, 25 Aug 2011 06:49:09 +0300, Jonathan M Davis <jmdavisProg at gmx.com>
> So, I'd say that you should pick whether to use assert or enforce on
> arguments based on how bad it is if the test is skipped (as happens with
> assertions and -release), how performant the code must be (truly
> critical code may not be able to afford the cost of testing in -release
> mode as
> would happen with enforce), and how likely it is that bad arguments are a
> result of a bug in the program rather than the state of a particular run
> the program.
Thanks for the detailed explanation. Based on the above, it's quite clear
that my case should use "enforce".
Vladimir mailto:vladimir at thecybershadow.net
More information about the phobos