Struct inheritance

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Tue Dec 3 19:58:59 UTC 2024


On 04/12/2024 8:30 AM, Derek Fawcus wrote:
> If one wants classful behaviour in betterC, then I'd suggest somehow 
> making classes work in betterC, and leaving structs without and 
> possibility of classful stuff. That keeps more closely to the spirit of 
> C, and without any of the Simula-67 like C-with-Classes stuff.

C++ classes work in -betterC.

Its not too difficult to implement down casting either.

https://github.com/Project-Sidero/basic_memory/blob/main/source/sidero/base/allocators/classes.d

I.e.

https://github.com/Project-Sidero/fileformats/blob/master/source/sidero/fileformats/errors.d



More information about the dip.ideas mailing list