operator == 方法

bool operator ==(
  1. Object other
)
override

Pointer 的等价性只取决于它们的地址。

实现

bool operator ==(Object other) {
  if (other is! Pointer) return false;
  Pointer otherPointer = other;
  return address == otherPointer.address;
}