`enum x;` - what is it?

FeepingCreature feepingcreature at gmail.com
Wed Aug 19 14:14:03 UTC 2020


On Wednesday, 19 August 2020 at 14:06:16 UTC, Victor Porton wrote:
> This declaration does compile:
>
> enum x;
>
> But what is it? Is it an equivalent of
>
> enum x { }
>
> ?
>
> What in the specification allows this looking a nonsense
>
> enum x;
>
> ?

It's an enum type whose members we don't know.

So we can't declare "x var;" but we can declare "x* var;".

It's the enum version of "struct SomeExternCStruct;".


More information about the Digitalmars-d-learn mailing list