PhobosWatch: manifest => enum
Walter Bright
newshound1 at digitalmars.com
Sun Dec 30 12:46:57 PST 2007
Sascha Katzner wrote:
> Walter Bright wrote:
>> Anonymous enums don't have a type (and didn't in D1.0, either).
>> There's no way to get a grip on such a type anyway, as it has no name
>> and:
>> enum { FOO, BAR } x;
>> style declarations are not allowed in D.
>
> Now I'm confused. I thought an anonymous enum was an enum without a
> name. But it is entirely possible to create an anonymous enum with a
> type, for example:
>
> enum : uint {red, green, blue}
>
> At least I use that kind of enums a lot and I allways thought of these
> as anonymous enums.
I meant that:
enum { FOO, BAR } x;
is not allowed because enum{FOO,BAR} is not a type declarator. This
isn't allowed either:
enum ABC { FOO, BAR } x;
while:
enum ABC { FOO, BAR }
ABC x;
is allowed.
More information about the Digitalmars-d
mailing list