Bug 294615
| Summary: | [WTF] Add overloads of WTF::arePointingToEqualData for non-nullable pointer-like types | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sam Weinig <sam> |
| Component: | Web Template Framework | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Sam Weinig
Pull request: https://github.com/WebKit/WebKit/pull/46857
EWS
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
<rdar://problem/153701651>