Purity
Simen kjaeraas
simen.kjaras at gmail.com
Fri Feb 11 14:51:00 PST 2011
Bruno Medeiros <brunodomedeiros+spam at com.gmail> wrote:
> In this code sample if the optimization is applied on the second call to
> func, it would cause different code with be executed: the else clause
> instead of the then clause. Obviously this is not acceptable for an
> optimization, even if such code would be rare in practice.
Ah yes, I see now. I could argue that 'is' is cheating. :p
I believe actually, that pure is only said to promise that the returned
values should be such that func(args) == func(args), not accounting for
overloaded operators.
--
Simen
More information about the Digitalmars-d
mailing list