Replace mozilla::Tie with structured bindings where appropriate in mozilla::Encoding/Decoder/Encoder usage
Categories
(Core :: Internationalization, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox96 | --- | fixed |
People
(Reporter: hsivonen, Assigned: ssummar)
References
Details
(Keywords: good-first-bug)
Attachments
(1 file)
Various things in mozilla/Encoding.h return mozilla::Tuple. Now that we're on C++17, review the callers to see which call sites would become more readable if migrated to structured bindings.
Updated•6 years ago
|
| Assignee | ||
Comment 1•4 years ago
|
||
Hi :hsivonen, do you mean to change all std::tie usages to structured bindings in all files where a function defined in Encoding.h is used? Or am I misunderstanding? Can you kindly elaborate this. Thank you.
| Reporter | ||
Comment 2•4 years ago
|
||
I mean using structured bindings on all call sites that now call methods from mozilla/Encoding.h that now return mozilla::Tuple.
Comment 3•4 years ago
|
||
Shazib is working on this as a good-first-bug, and discovered that mozilla::Tuple doesn't support structured bindings (previously reported as bug 1633345). I then wrote a patch for that, and I could submit it there but I also found the (much older) bug 1276351 that suggests we should just migrate APIs away from mozilla:Tuple and instead use std::tuple. I'm thinking that using std::tuple might be the better approach for this bug. Your thoughts/preferences?
| Reporter | ||
Comment 4•4 years ago
|
||
Botond, is there a reason to stay with mozilla::Tuple or should we migrate to std::tuple?
Comment 5•4 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #4)
Botond, is there a reason to stay with
mozilla::Tupleor should we migrate tostd::tuple?
I'm supportive of migrating to std::tuple.
I tried it a few years ago, and at the time a major sticking point was that nsAutoPtr could not be stored in std::tuple (and there was a lot of code passing nsAutoPtr to runnable wrappers, whose implementation involved storing the arguments in a tuple). Since then, I see that nsAutoPtr has been removed in bug 1610067, so hopefully a migration should be much smoother now.
| Assignee | ||
Comment 6•4 years ago
|
||
Thanks :botond. I'll be working on migrating to std::tuple then. You can expect a patch in a few days.
| Assignee | ||
Comment 7•4 years ago
|
||
Updated•4 years ago
|
| Assignee | ||
Comment 9•4 years ago
|
||
Thanks :)
Comment 10•4 years ago
|
||
| bugherder | ||
Comment 11•4 years ago
|
||
Backed out for causing toolchains build bustages (Bug 1739589)
Updated•4 years ago
|
| Assignee | ||
Comment 12•4 years ago
|
||
(In reply to Cristian Tuns from comment #11)
Backed out for causing toolchains build bustages (Bug 1739589)
Sorry about this. I didnt know non-debug and debug builds are different. I only tested on debug builds. I'm working on fixing this.
Comment 13•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/b2e956b4671e
use std::tie instead of mozilla::Tie in comm-central. rs=bustage-fix DONTBUILD
Comment 14•4 years ago
|
||
Updated•4 years ago
|
Comment 15•4 years ago
|
||
| Assignee | ||
Comment 16•4 years ago
|
||
Fixed in latest revision. Hopefully won't need anymore revs.
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
| bugherder | ||
Comment 19•4 years ago
|
||
Description
•