Is there a way around the cast below to see if ci is i?
If not, is there already a standard template method that does DeepUnqual.
Finally, if not a workaround is this safe?

Thanks
Dan
----------------------
import std.traits;

void main() {
  const(int[string]) ci;
  int[string] i;
  // FAILS TO COMPILE if(ci is i) { }
if(cast(DeepUnqual!(typeof(ci)))ci is cast(DeepUnqual!(typeof(i)))i) { }
}

template DeepUnqual(T) {
  static if(isAssociativeArray!T) {
alias Unqual!(Unqual!(ValueType!T)[Unqual!(KeyType!T)]) DeepUnqual;
  } else static if(isDynamicArray!T) {
    alias Unqual!(Unqual!(ArrayElementType!T)[]) DeepUnqual;
  } else static if(isPointer!T) {
    alias Unqual!(PointerTarget!T) * DeepUnqual;
  } else {
    alias Unqual!T DeepUnqual;
  }
}

Reply via email to