bit-level logic operations on enums

Steven Schveighoffer schveiguy at yahoo.com
Fri Mar 1 11:56:12 PST 2013


On Fri, 01 Mar 2013 14:32:11 -0500, FG <home at fgda.pl> wrote:

> On 2013-03-01 20:13, Steven Schveighoffer wrote:
>> D does not (or at least should not) allow assignments of integers back  
>> to
>> enumeration types.  You have to cast.
>
> or use normal int enum instead of byte enum, if you have the space for  
> it.

It still fails if int is the enum base.  The issue is not whether the bit  
pattern will fit in the base type, the issue is assigning an enum from int.

-Steve


More information about the Digitalmars-d mailing list