bit-level logic operations on enums

Era Scarecrow rtcvb32 at yahoo.com
Fri Mar 1 16:22:14 PST 2013


On Friday, 1 March 2013 at 23:00:58 UTC, Steven Schveighoffer 
wrote:
> I was sure too.  It's not.  Any operation between A types 
> results in A.
>
> writeln(typeof(a + a).stringof); // => A
> writeln(typeof(a << a).stringof); // => A
> writeln(typeof(a * a).stringof); // => A

  It has to be a bug, as it doesn't make sense for it to be legal.


More information about the Digitalmars-d mailing list