bit-level logic operations on enums

FG home at fgda.pl
Fri Mar 1 12:33:32 PST 2013


On 2013-03-01 20:56, Steven Schveighoffer wrote:
>> 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.

What fails? Are we talking something compiler-version-specific here?

     enum BING_e { ... } ... // rest the same as in original post
     BING_e c = a & b;  // this works for me
     BING_e d = a & 1;  // fails, and it should fail



More information about the Digitalmars-d mailing list