[Webkit-unassigned] [Bug 233384] New: Ref<T> should support indirection operator *
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Nov 19 14:36:11 PST 2021
https://bugs.webkit.org/show_bug.cgi?id=233384
Bug ID: 233384
Summary: Ref<T> should support indirection operator *
Product: WebKit
Version: Other
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Web Template Framework
Assignee: webkit-unassigned at lists.webkit.org
Reporter: jean-yves.avenard at apple.com
While Ref<T> was supposed to be a replacement for T& with lifetime guarantees, C++ limitations made it act more like a pointer than a reference.
Ref<T> is more like a RefPtr<T> that guarantees it's never null.
A Ref can be converted into a RefPtr directly.
You already have to dereference the content of a Ref<T> using operator->().
So it makes sense that it also implements the indirection operator *.
I propose that Ref<T> be made to at the very least support the indirection operator and maybe even be officially be made into just a RefPtr that guarantees to never be null (so get() would return T* rather than T&
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211119/c618a75b/attachment-0001.htm>
More information about the webkit-unassigned
mailing list