[phobos] enforce() vs. assert() for range primitives
Michel Fortin
michel.fortin at michelf.com
Wed Aug 18 17:09:59 PDT 2010
Le 2010-08-18 à 19:08, Jonathan M Davis a écrit :
> The ideal situation would be to use asserts in all cases where it's going to be
> bugs in the program rather than bad user input and that they go away in release
> mode.
I'd say the ideal situation would be to have the 'in' contracts checked on the caller's side. That way a program compiled in debug mode would still check the input it sends to Phobos, and whether Phobos was compiled in debug or release mode would only affect its internal checks, not the checks about its inputs.
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the phobos
mailing list