Closed
Bug 1143077
Opened 11 years ago
Closed 11 years ago
Add assignment operators for mozilla::Pair
Categories
(Core :: MFBT, defect)
Core
MFBT
Tracking
()
RESOLVED
FIXED
mozilla39
| Tracking | Status | |
|---|---|---|
| firefox39 | --- | fixed |
People
(Reporter: seth, Assigned: seth)
Details
Attachments
(2 files)
|
990 bytes,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
|
1012 bytes,
patch
|
Details | Diff | Splinter Review |
Now that mozilla::Pair supports copying and moving, we should make it support assignment operators too.
| Assignee | ||
Comment 1•11 years ago
|
||
Here's the patch. Trivial, except that again due to MSVC 2013 we can't use "= default" for the move assignment operator.
Attachment #8577531 -
Flags: review?(jwalden+bmo)
Comment 2•11 years ago
|
||
Comment on attachment 8577531 [details] [diff] [review]
Add assignment operators to mozilla::Pair
Review of attachment 8577531 [details] [diff] [review]:
-----------------------------------------------------------------
Worth adding an assignment to the test file just to exercise this at least a little.
::: mfbt/Pair.h
@@ +167,5 @@
> Pair(const Pair& aOther) = default;
>
> + Pair& operator=(Pair&& aOther)
> + {
> + MOZ_ASSERT(this != &aOther, "Self-moves are prohibited");
More common to not capitalize the first letter of an assertion, I think.
Attachment #8577531 -
Flags: review?(jwalden+bmo) → review+
| Assignee | ||
Comment 3•11 years ago
|
||
Thanks for the review! Pushed:
https://hg.mozilla.org/integration/mozilla-inbound/rev/14e7f9959c85
I'll push a followup to update the test.
| Assignee | ||
Comment 4•11 years ago
|
||
Here's that followup. I can't push it right now because inbound is down.
| Assignee | ||
Comment 5•11 years ago
|
||
Pushed that followup:
https://hg.mozilla.org/integration/mozilla-inbound/rev/098d9685e26f
Comment 6•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/14e7f9959c85
https://hg.mozilla.org/mozilla-central/rev/098d9685e26f
Status: NEW → RESOLVED
Closed: 11 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•