Closed Bug 1054115 Opened 5 years ago Closed 10 months ago

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

Categories

(Core :: MFBT, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: seth, Assigned: gerald)

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)
Duplicate of this bug: 1056407
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
https://hg.mozilla.org/mozilla-central/rev/99d33ba5e213
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.