Closed Bug 1053420 Opened 6 years ago Closed 6 years ago
Improve new ns
TArray rvalue reference methods
The new rvalue reference versions of nsTArray::AppendElement and InsertElementAt want to move their parameter to the Construct function. Since this isn't a template-deduced reference parameter, they should Move rather than Forward. It looks as if jrmuizel did originally try to template on the parameter to AppendElement but was just trying various combinations until it compiled :-\ Note that template<class Item> elem_type* AppendElement(elem_type&& aItem) matches non-const lvalues which is why you can't blindly Move them. In fact it quite happily takes const lvalues too, making the other overload redundant.
My second try run (the first got hit by our infra issues) for my suggested AppendElement change seems to be reasonably green. Patch is at https://hg.mozilla.org/try/rev/9922524dc8dd
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #8473357 - Flags: review?(nfroyd)
Attachment #8473357 - Flags: review?(nfroyd) → review+
I botched the bug# on my checkin comment. Oops. https://hg.mozilla.org/mozilla-central/rev/2976adaf3278
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.