Is a fixed length array created on the heap and a dynamic array on the stack ? And is this important with relation to the garbage collector ?
Thread overview | ||||||
---|---|---|---|---|---|---|
|
May 06, 2021 Fixed length vs dynamic arrays | ||||
---|---|---|---|---|
| ||||
May 06, 2021 Re: Fixed length vs dynamic arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alain De Vos | On Thursday, 6 May 2021 at 22:35:38 UTC, Alain De Vos wrote: >Is a fixed length array created on the heap and a dynamic array on the stack ? And is this important with relation to the garbage collector ? Static arrays ( Dynamic arrays ( For more information about slices in D, I highly recommend this excellent article by Steven Schveighoffer: |
May 07, 2021 Re: Fixed length vs dynamic arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Backus | Following code compiles without errors, only errors during runtime
|
May 08, 2021 Re: Fixed length vs dynamic arrays | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alain De Vos | On Friday, 7 May 2021 at 22:21:09 UTC, Alain De Vos wrote: >Following code compiles without errors, only errors during runtime
The result of a When you assign a dynamic array to a static array, the elements from the dynamic array on the right-hand side are copied into the static array on the left-hand side. [2] So the statement
...is essentially shorthand for
Because [1] https://dlang.org/spec/expression.html#cat_expressions |