[Issue 12360] struct field not actually updated

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Mar 13 20:03:07 PDT 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12360


Adam D. Ruppe <destructionator at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator at gmail.com


--- Comment #1 from Adam D. Ruppe <destructionator at gmail.com> 2014-03-13 20:03:05 PDT ---
You should take the buffered array as ref in the push function. Otherwise, it
is passed as value, so it updates in the function, but those changes aren't
preserved outside the function.

So it isn't really a bug, though it might have worked a few years ago because
D1 array slices were a weird value/reference hybrid. (Well, they still are a
hybrid, but they aren't so weird anymore and consistently act like a value when
appending; see: http://dlang.org/d-array-article.html )

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


More information about the Digitalmars-d-bugs mailing list