Enum template with mixin, need 'this'

Meta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Dec 24 12:08:06 PST 2014


I am curious, however, why changing `enum` to `auto` (or bool) 
doesn't work. You said that the mixin tries to interpret the 
expression `cast(bool)(embeddedTest.bits & <enumName>)` at 
compile time, but I don't understand why that would be so when 
the storage is auto and not enum. I guess mixin doesn't work 
quite like I thought it did; it's not quite the equivalent of 
pasting the mixed-in code.


More information about the Digitalmars-d-learn mailing list