Closed
Bug 1680724
Opened 5 years ago
Closed 5 years ago
Add a utility function that converts a T* to a Maybe<T&>
Categories
(Core :: MFBT, task)
Core
MFBT
Tracking
()
RESOLVED
FIXED
85 Branch
Tracking | Status | |
---|---|---|
firefox85 | --- | fixed |
People
(Reporter: sg, Assigned: sg)
Details
Attachments
(2 files)
It would be convenient to have a utility function that converts a potentially nullptr
T*
to a Maybe<T&>
like:
template<typename T>
Maybe<T&> ToMaybeRef(T* const aPtr) {
return aPtr ? SomeRef(*aPtr) : Nothing{};
}
Assignee | ||
Updated•5 years ago
|
Assignee: nobody → sgiesecke
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
Depends on D98783
Updated•5 years ago
|
Attachment #9191328 -
Attachment description: Bug 1680724 - Use ToMaybeRef where possible. r=#dom-workers-and-storage → Bug 1680724 - Use ToMaybeRef or SafeRefPtr::maybeDeref where possible. r=#dom-workers-and-storage
Pushed by sgiesecke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7264e6cb9041
Add a utility function that converts a T* to a Maybe<T&>. r=jwalden
https://hg.mozilla.org/integration/autoland/rev/79190513b660
Use ToMaybeRef or SafeRefPtr::maybeDeref where possible. r=dom-workers-and-storage-reviewers,janv
Comment 4•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7264e6cb9041
https://hg.mozilla.org/mozilla-central/rev/79190513b660
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
status-firefox85:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 85 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•