Disallow side effects in assert
Iain Buclaw
ibuclaw at gdcproject.org
Mon Feb 3 09:10:06 PST 2014
On 3 February 2014 17:00, bearophile <bearophileHUGS at lycos.com> wrote:
> Daniel Murphy:
>
>
>> Enough to tell it _might_ have a side effect, not enough to know it
>> _will_. The number of false positives would make it near useless.
>
>
> How many impure functions do you call in your asserts?
Rephrase to 'How many *functions* do you call in your asserts?'
If a function has a side effect (or returns), I'd have thought that
typically people want to store that value first, then test it using
assert().
Regards
Iain.
More information about the Digitalmars-d
mailing list