Hello.

I need a template for casting arrays to another type without changing const and immutable attributes:

template ByteType(T) {
  // some magic
}

const(int)[] ca;
immutable(short)[] is;
long[] ml;

static assert(is(ByteType!ca == const(byte)[]));
static assert(is(ByteType!is == immutable(byte)[]));
static assert(is(ByteType!ml == byte[]));

What kind of template magic I should use?

Reply via email to