[Webkit-unassigned] [Bug 281835] New: UniqueRef<T>::operator-> shouldn't return a const T*

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Oct 20 02:44:48 PDT 2024


https://bugs.webkit.org/show_bug.cgi?id=281835

            Bug ID: 281835
           Summary: UniqueRef<T>::operator-> shouldn't return a const T*
           Product: WebKit
           Version: WebKit Nightly Build
          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

UniqueRef<T> is supposed to operate like a std::unique_ptr<T> which is never null.

But both its `operator->()` and `operator*()` return a const object, unlike std::unique_ptr<T> equivalent that will return a non const object (just like a T* type would)

This prevents `const UniqueRef<T>` from being commonly use, which not only indicates that it will never be null, but that it also will never be modified during the lifetime of its `this` parent.

-- 
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/20241020/c4c91d7c/attachment.htm>


More information about the webkit-unassigned mailing list