enum

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Apr 10 12:22:35 PDT 2014


On 4/9/14, 9:47 PM, Walter Bright wrote:
> On 4/9/2014 5:39 PM, Jonathan M Davis wrote:
>> On Wednesday, April 09, 2014 14:14:21 Andrei Alexandrescu wrote:
>>> One wants to call a function taking such an enum. -- Andrei
>>
>> But it _isn't_ going to be a valid enum value. IMHO, a function which is
>> taking or-ed flags where those flags are enums needs to take uint or
>> ulong or
>> whatever the base type of the enum is and _not_ the enum type.
>
> It makes perfect sense if you think of an enum as an integral type, some
> values of which have names, as in the "Color" example I posted earlier.

Problem is you think of it like that in a subset of cases only. FWIW I 
wouldn't have advocated for final switch if that was the fostered view. 
-- Andrei


More information about the Digitalmars-d mailing list