Implicit enum conversions are a stupid PITA

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Mar 25 12:21:23 PDT 2010


On 03/25/2010 01:57 PM, Adam D. Ruppe wrote:
> On Thu, Mar 25, 2010 at 12:18:57PM -0500, Andrei Alexandrescu wrote:
>> I missed this. There's no need for anything close to that. We all could
>> get "upset" regarding a post or a notion, not against the person airing it.
>>
>> As far as the matter at hand of that thread is concerned, you mentioned
>> the possibility:
>>
>> alias Flags!(ubyte, "do_nothing",
>>                      "walk_dog"
>>                      "cook_breakfast"
>>                      "deliver_newspaper"
>>                      "visit_miss_kerbopple"
>>                      "wash_covers") Todo;
>>
>> I encourage you to code that up and see how it swims.
>
>
> It just occurred to me that such a thing could work on the use-side exactly
> like the built in enum too, thanks to opDispatch.

Exactly.

Andrei



More information about the Digitalmars-d mailing list