What can _not_ be marked pure?

Guillaume Piolat via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 9 01:57:31 PST 2016


On Wednesday, 9 March 2016 at 09:56:05 UTC, 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?
>
> It seems more function can be marked pure that I previously 
> thought.

Another question that ensues is: will the compiler prevent 
incorrect use of pure, so that it's safe to spam it in your code?


More information about the Digitalmars-d-learn mailing list