Bug 6987 – The "Memory Management" documentation incorrectly claims arrays are passed by reference.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-11-22T03:50:00Z
Last change time
2012-01-21T01:07:03Z
Keywords
spec
Assigned to
nobody
Creator
b.helyer

Comments

Comment #0 by b.helyer — 2011-11-22T03:50:14Z
http://www.d-programming-language.org/memory.html >Consider the case of passing an array to a function, possibly modifying the >contents of the array, and returning the modified array. Since arrays are passed >by reference, not by value, a crucial issue is who owns the contents of the >array? The semantics of using an array passed to a function may be reference like, but the array is most certainly not 'passed by reference'. Glossing this over will lead to confusion for people later on when they resize an array passed to a function and wonder why the changes haven't been reflected at the call site.
Comment #1 by b.helyer — 2011-11-22T03:53:26Z
I would suggest something like "as the contents of an array are accessed through a reference..."
Comment #2 by b.helyer — 2011-12-11T20:27:59Z