What can _not_ be marked pure?
Guillaume Piolat via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Mar 9 02:26:09 PST 2016
On Wednesday, 9 March 2016 at 10:08:33 UTC, ag0aep6g wrote:
> On 09.03.2016 10:56, Guillaume Piolat wrote:
>> If I understand purity correctly
>> (http://klickverbot.at/blog/2012/05/purity-in-d/), every
>> function out
>> there can be marked pure as long as it doesn't modify globals,
>> shared
>> variables or do I/O?
>
> Pure functions also can't *read* mutable globals. But then
> that's it, I think.
Thanks. Now I'm excited to spam it over my codebase and see the
kind of speedup one can achieve.
More information about the Digitalmars-d-learn
mailing list