checkedint call removal

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 30 09:39:33 PDT 2014


"Ary Borenszweig"  wrote in message news:lrb6ev$2ln$1 at digitalmars.com...

> > Because if assert only means 'check this condition' then the optimizer
> > can't optimize based on the assumption that it's true.
>
> Assert means: check this condition and terminate the program if it doesn't 
> hold.
>
> So why can't the compiler optimize based on this?

The compiler can optimize based on this.  But with that definition of assert 
it can't optimize based on the assumption that the condition is always true, 
without checking it first. 



More information about the Digitalmars-d mailing list