-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.P-lowLow priorityLow priority
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>
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.P-lowLow priorityLow priority