assert or throw in range members?

Kagamin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 5 05:14:23 PDT 2016


On Friday, 5 August 2016 at 10:25:42 UTC, Nordlöw wrote:
> If it should assert() doesn't that lead to unsafer code in 
> release mode?
>
> What's the consensus here?

It is unsafer, the rationale is that your code should be debugged 
to comply with the assumption of the release mode that there are 
no bugs. The consensus is that it's ok that the assumption is 
backed by a hope (there were bugs that would be caught by asserts 
and bound checks, but weren't).


More information about the Digitalmars-d-learn mailing list