--- Comment #49 from art.08...@gmail.com 2012-06-04 11:29:39 PDT ---
As this discussions was mostly about what *should* be happening, I decided to
see what actually *is* happening right now.
It seems that the compiler will only optimize based on "pureness" if a function
takes an 'immutable T*' argument, even 'immutable(T)*' is enough to turn the
So, right now, it is extremely conservative - and there is no bug in the
implementation. (accessing mutable data via an immutable pointer can be done,
but would be clearly illegal, just as using a cast)
But that also means that a lot of valid optimizations aren't done, making
purity significantly less useful than it could be. Basically, only functions
that don't take any (non-immutable) references as arguments can benefit from
"pure". But it also means D can still be incrementally fixed, as long as a sane
definition of function purity is used.
But this bug is a spec issue, hence probably INVALID, as there is no
specification. Sorry for the noise.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------