checkedint call removal

Tofu Ninja via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 30 20:09:33 PDT 2014


On Thursday, 31 July 2014 at 02:53:11 UTC, Walter Bright wrote:
> Your code is doomed to having problems using assert this way.
>
> The behavior you desire here is easily handled by creating your 
> own template to exhibit it. See the implementation of enforce() 
> for how to do it.

When is the appropriate time to use an assert? If an assert
should not be used on input, then any thing that can't be
statically known is considered an input and anything that is
derived from an input is also an input... so when can we use an
assert? The only things left it seems are things know at compile
time and at that point what is the the point of having assert
when we have static assert...


More information about the Digitalmars-d mailing list