Closed
Description
< Dzmitry> I have 2 pointers to a shared structure (@). How do I know it's the
same structure?
< Dzmitry> comparing this pointers issues a compile error saying that @Eq is not
implemented for the structure
<@pcwalton> Dzmitry: box::ptr_eq
<@pcwalton> Eq is deep
<@pcwalton> there is a separate method for it
<@pcwalton> "it" == shallow comparison
< Dzmitry> pcwalton: interesting. But what if my pointers are wrapped in
Option<>, can I compare two options by ptr_eq?
<@pcwalton> no, you can't at the moment
<@pcwalton> probably PtrEq or ShallowEq should be a trait like Eq
<@pcwalton> and then implemented on Option<T>