I'm curious why this would break and not work, as is should compare against it's location/entity correct? I wonder why it breaks then for structs on the stack. I can only find 'opIs missing' when searching for it, so...

struct X {
  int x;
}

class Y {
  int y;
}

  Y y1 = new Y();
  Y y2 = new Y();
  X x1, x2;

  assert(y1.y == y2.y);
  assert(y1 !is y2);
  assert(y1 != y2); //same as !is by default as i recall

//  writefln("x1 = 0x%s\nx2 = 0x%s", &x1, &x2);
  assert(x1 == x2);
  assert(x1 !is x2); //fails

Reply via email to