```d @safe: struct S { bool opEquals(const ref S x) const { if(&x==&this) return true; ... } } ```
Can I replace this pattern with ```(x is this)``` or are there some special cases where this doen't work?
Dom DiSc via Digitalmars-d-learn Thu, 25 Jul 2024 03:56:39 -0700
```d @safe: struct S { bool opEquals(const ref S x) const { if(&x==&this) return true; ... } } ```
Can I replace this pattern with ```(x is this)``` or are there some special cases where this doen't work?