enum

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Apr 13 15:49:57 PDT 2014


On 4/12/14, 8:15 PM, deadalnix wrote:
> On Saturday, 12 April 2014 at 19:43:30 UTC, Andrei Alexandrescu wrote:
>> Sorry, your speculations are mistaken. The pattern works well and
>> we've been using it repeatedly and with good results since C++
>> introduced "enum class".
>>
>
> Can you provide a sample code so we understand what you are talking
> about ? It do not seems to me that enum classes defeat Jonathan point,
> but I may be wrong.

The UserID example is a good one. You need to cast a couple of times 
when doing I/O, then passing user IDs around is nice because no other 
integers can be passed instead.

Andrei



More information about the Digitalmars-d mailing list