[Issue 8185] Pure functions and pointers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 4 06:41:34 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8185



--- Comment #33 from klickverbot <code at klickverbot.at> 2012-06-04 06:43:32 PDT ---
(In reply to comment #32)
> That's correct. You should not expect *any* optimizations from weakly pure
> functions. The ONLY purpose of weakly pure functions is to increase the number
> of strongly pure functions. In all other respects, they are no different from
> an impure function.

Const-pure functions invoked with immutable _arguments_ (even though parameters
might only be const) can receive exactly the same amount of optimizations. Even
if not implemented in DMD today (as are many other possible purity-related
optimizations), this is very useful, because otherwise functions would have to
accept immutable values just for the sake of optimization even though they
could work with const values just as well otherwise.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list