Does D actually support flexible array members?

IchorDev zxinsworld at gmail.com
Tue Sep 6 11:51:35 UTC 2022


On Thursday, 18 August 2022 at 11:25:22 UTC, Paul Backus wrote:
>
> I think the closest way to approximate this in D is to use a 
> zero-length static array:
>
> ```d
> struct ArenaChunk {
>     size_t size;
>     ArenaChunk* next;
>     char[0] memory;
> }
> ```

Would Nullable be a good option as well? 
[https://dlang.org/phobos/std_typecons.html#Nullable](https://dlang.org/phobos/std_typecons.html#Nullable)


More information about the Digitalmars-d-learn mailing list