Open yjhmelody opened 1 year ago
What's wrong with this approach?
const isEqRefs = changetype<usize>(obj1) == changetype<usize>(obj2)
What's wrong with this approach?
const isEqRefs = changetype<usize>(obj1) == changetype<usize>(obj2)
its ok,but should be builtin
Feature suggestion
When meet
==
operator overload. There is no way to know if the ref is same.For reference type, it's very helpful to know the ref equality in many scenarios. For value equality, we want to compare whether the values are equal. For example, as an index key, it is impossible to rely on comparison references, because the external key is newly constructed by itself. But we still need the ref equality for such type.
BTW, use
===
to represent this sematic is fine.