enums and version/static if/"inheritance"
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Wed Jul 31 17:51:59 UTC 2024
On 01/08/2024 4:04 AM, Max Samukha wrote:
> On Wednesday, 31 July 2024 at 06:11:15 UTC, Walter Bright wrote:
>
>> version (x86_64)
>> {
>> enum FOO
>> {
>> A = 5,
>> B = 6,
>> C = 7,
>> }
>> }
>> else version (AArch64)
>> {
>> enum FOO
>> {
>> A = 5,
>> B = 6,
>> C = 17,
>> }
>> }
>> else
>> static assert(0);
>> ```
>>
>> Ah, doesn't that look nicer?
>
> It's been said maybe a billion times why this solution rarely works in
> the read world. And the arguments have been dismissed in the classic D way.
Yeah not supporting this, just doesn't fit D anymore.
Too many people try it, which shows that it is clearly good language design.
It helps to fulfill peoples ideas, so an easy win to me.
More information about the Digitalmars-d
mailing list