On Wednesday, 11 November 2020 at 13:30:16 UTC, Simen Kjærås
wrote:
The short answer is 'because that's how we've chosen to define
it'. A more involved answer is that changing every reference is
prohibitively expensive - it would require the equivalent of a
GC collection on every reallocation,
Alright, thanks for sharing this thoughts and arguments!
On Wednesday, 11 November 2020 at 10:17:09 UTC, zack wrote:
I am new to D. Appending to an array can lead to reallocation,
that's clear. But why is the "reference" b not changed
accordingly to the new position and still points to "old"
memory? Why is b not also changed when reallocating array
On Wednesday, 11 November 2020 at 10:17:09 UTC, zack wrote:
I am new to D. Appending to an array can lead to reallocation,
that's clear. But why is the "reference" b not changed
accordingly to the new position and still points to "old"
memory? Why is b not also changed when reallocating array
I am new to D. Appending to an array can lead to reallocation,
that's clear. But why is the "reference" b not changed
accordingly to the new position and still points to "old" memory?
Why is b not also changed when reallocating array a and the old
data getting invalid/freed?
auto a =