pure functions cannot be removed, actually: pure vs. total

Stefan Koch uplink.coder at googlemail.com
Tue Jun 5 17:05:02 UTC 2018


On Tuesday, 5 June 2018 at 14:48:23 UTC, FeepingCreature wrote:
> I'm just posting to clear up the misunderstanding that a call 
> to a pure function can be removed. Actually, even calls to 
> strongly pure functions cannot always be removed. This is 
> because there is one thing that a pure function can do that 
> will change program behavior if it is removed, even if it does 
> not change any global state whatsoever: it can simply never 
> return.
>
> [...]

In that instance you can have false negatives. catgorizing total 
functions an non total.

But no false positives afaics.


More information about the Digitalmars-d mailing list