Trying to use mixin, i get an unsupported char error.

protected template GenMessageGetId(uint id) {
    immutable string GenMessageGetId
= "public immutable(int) getId() const { \n" ~ id ~ "; \n}";
}

public mixin template Packet(uint id, T...) {
    ...

    private static string buildPacket() {
         ...

         return GenMessageGetId!(id);
    }

    mixin (buildPacket());
}

class MyPacket : Message {
    mixin Packet!(3, ...); -> Error: unsupported char 0x03
}

GenMessageGetId is generating "unsupported char 0x03".

Reply via email to