As a result, it is impossible to use thing like bitfields in templates.

I'm trying to do something like

struct MySuperStruct(E) {
        enum DataSize = ulong.sizeof * 8 - EnumSize!E;
        
        import std.bitmanip;
        mixin(bitfields!(
                E, "kind", EnumSize!E,
                ulong, "data", DataSize,
        ));
        
        // More stuuuuuuufffffff \o/
}

But obviously, that won't work as mixins are using the real type of E, and not E. I ran into that problem on other forms, and always was able to work around it, but on that one, there is no way around it.

Reply via email to