https://issues.dlang.org/show_bug.cgi?id=24540
Nick Treleaven <n...@geany.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |n...@geany.org --- Comment #2 from Nick Treleaven <n...@geany.org> --- (In reply to apham from comment #0) > void set(Foo e) > { > v |= 1 << e.order; > } > > bool isSet(Foo e) > { > return (v & (1 << e.order)) != 0; > } It's not possible to take a runtime enum value and produce its index in an enum without some runtime overhead. Another issue is that `e.order` is already valid code, meaning call `order(e)`. --