dip1000 + pure is a DEADLY COMBO

Per Nordlöw per.nordlow at gmail.com
Fri May 14 09:02:35 UTC 2021


On Wednesday, 12 May 2021 at 13:14:30 UTC, Dennis wrote:
> The idea is, presumably, that `pure` functions can't escape 
> references because they have no interaction with global 
> variables. This is false of course, since they can still return 
> them or assign them to other parameters.

No, pure function can _neither_ access module global _nor_ 
process global (__gshared) variables whatsoever regardless of 
`scope` nor `return` qualifier on parameters and return type.

Please show an example that contradicts this statement.

I fail to see the general issue here.


More information about the Digitalmars-d mailing list