[Issue 2832] pure function too pure

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 11 23:30:25 PST 2009


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


Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com
           Severity|normal                      |enhancement


--- Comment #5 from Walter Bright <bugzilla at digitalmars.com> 2009-12-11 23:30:21 PST ---
This would reintroduce "tail-const" for the parameters, something that we tried
hard to make work and failed. I'd rather just leave the parameters const. If
you have to make a mutable copy, as in:

  pure int fun(int d, int divisor)
  { auto x = d;
    if (x < 0)
        x -= divisor - 1;
    return x / divisor;
  }

that isn't much of a burden, and the compiler will optimize the extra copy away
anyway.

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