Bug 294615

Summary: [WTF] Add overloads of WTF::arePointingToEqualData for non-nullable pointer-like types
Product: WebKit Reporter: Sam Weinig <sam>
Component: Web Template FrameworkAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 18   
Hardware: Unspecified   
OS: Unspecified   

Sam Weinig
Reported 2025-06-17 09:11:03 PDT
To replace the relatively common idiom of: ``` foo.ptr() == bar.ptr() || foo.get() == bar.get(); ``` used for Ref and UniqueRef that want value semantics, we can add overloads of WTF::arePointingToEqualData that do the right thing. At some point later, we should consider replacing these uses with types that do the same thing. For instance, for the UniqueRef case, the upcoming std::indirect would be a good fit - https://en.cppreference.com/w/cpp/memory/indirect.html. For Ref, we would need to make our own "boxed ref" type.
Attachments
Sam Weinig
Comment 1 2025-06-17 09:55:16 PDT
EWS
Comment 2 2025-06-17 20:43:05 PDT
Committed 296358@main (f7123211c62d): <https://commits.webkit.org/296358@main> Reviewed commits have been landed. Closing PR #46857 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2025-06-17 20:45:22 PDT
Note You need to log in before you can comment on or make changes to this bug.