Most basic nothrow, pure, @safe functions?
Walter Bright
newshound2 at digitalmars.com
Fri Mar 21 11:18:05 PDT 2014
On 3/21/2014 12:59 AM, monarch_dodra wrote:
> Ok. That's a fair point. So in that case, our function is pointing at "data",
> and is allowed to mutate it, and observe its state.
>
> Now, if *another* piece of code is doing the same thing at the same time
> (potentially mutating "data", does that still violate purity?
A mutex essentially reads and writes a global flag, which other functions can
also read and write.
That makes it NOT pure.
More information about the Digitalmars-d
mailing list