[Issue 11046] [enh] Pure functions with default and out parameters are allowed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 15 14:06:28 PDT 2013


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



--- Comment #4 from Jonathan M Davis <jmdavisProg at gmx.com> 2013-09-15 14:06:27 PDT ---
> Sorry, it is definitely a bug because global variable is mutable.

It mutates global mutable state via one of its arguments. pure functions cannot
access global mutable state _directly_, but they can do so if passed a
reference or pointer to global data. This is intended behavior and does not
present a problem. It's just fine for weakly pure functions and violates
nothing for strongly pure functions (because they could never pass a reference
or pointer to  a weakly pure function, because they can't access them).

-- 
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