On Wednesday, 26 July 2017 at 16:27:57 UTC, WhatMeWorry wrote:
On Wednesday, 26 July 2017 at 02:31:33 UTC, Mike Parker wrote:
With static arrays, the memory for the elements if part of the
array itself, so it is counted in the size. For dynamic
arrays, it is not. For .sizeof to report the size
On Wednesday, 26 July 2017 at 02:32:07 UTC, Adam D. Ruppe wrote:
I've hand rolled a function which is working for me currently,
but with my coding ability, I'd feel much safer with something
official :)
You could also do (cast(ubyte[]) array).length.
This was my (way over complicated) att
On Wednesday, 26 July 2017 at 02:31:33 UTC, Mike Parker wrote:
On Wednesday, 26 July 2017 at 02:24:06 UTC, WhatMeForget wrote:
[...]
Because .sizeof has nothing to do with how many elements are in
the array. It tells you how much space the array itself takes
up.
Totally agree. .length ret
On Wednesday, 26 July 2017 at 02:24:06 UTC, WhatMeForget wrote:
Static Arrays have property
.sizeof which returns the array length multiplied by the number
of bytes per array element.
Dynamic Arrays have property
.sizeof which returns the size of the dynamic array reference,
which is 8 in 32-
On Wednesday, 26 July 2017 at 02:24:06 UTC, WhatMeForget wrote:
Static Arrays have property
.sizeof which returns the array length multiplied by the number
of bytes per array element.
Dynamic Arrays have property
.sizeof which returns the size of the dynamic array reference,
which is 8 in 32-
Static Arrays have property
.sizeof which returns the array length multiplied by the number
of bytes per array element.
Dynamic Arrays have property
.sizeof which returns the size of the dynamic array reference,
which is 8 in 32-bit builds and 16 on 64-bit builds.
Why not have dynamic arrays