Closed Bug 1054115 Opened 10 years ago Closed 6 years ago

Make Maybe<T> support functors and argument perfect forwarding for map()

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: seth, Assigned: mozbugz)

References

Details

Attachments

(1 file)

It was necessary to rip out support for functors and argument perfect forwarding for Maybe<T>::map() at the last minute, because the decltype() technique I was using to make them work fails on GCC 4.4. (The error is "sorry, unimplemented: mangling template_id_expr".) We still want these things. In this bug we hopefully figure out a way to get them on GCC 4.4. In the worst case, we can use the implementations that worked everywhere but GCC 4.4 when we finally drop that compiler; look at bug 913586 comment 53 and the next couple of comments for the old patches.
2.5 years later... We now require gcc 4.8 (soon 4.9), so it should be ok to re-add some useful functions that couldn't make it in bug 913586. Seth, any interest and bandwidth for this? If not, I'd be happy to take over; please let me know, thanks!
Depends on: 1077549
Flags: needinfo?(seth.bugzilla)
I'm 99% sure that Seth would be fine with you taking this bug.
Assignee: seth.bugzilla → nobody
Flags: needinfo?(seth.bugzilla)
And 1.7 years later (sorry), we're now using gcc 6.1 and C++14, so it's easier to write more efficient Maybe::map and apply.
Assignee: nobody → gsquelart
Status: NEW → ASSIGNED
No need to specify the return type in C++14, this save some less-readable decltype&declval work. And we make sure to std::forward the function object before invoking it, to preserve its const and l/rvalue qualifiers.
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/99d33ba5e213 Maybe::map and apply now take the function through a forwarding reference - r=froydnj
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: