Closed
Bug 819523
Opened 12 years ago
Closed 12 years ago
Make it possible to pass any TArray (fallible or not) to a const ref taking any other TArray (fallible or not)
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
mozilla20
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(3 files, 1 obsolete file)
5.32 KB,
patch
|
justin.lebar+bug
:
review+
|
Details | Diff | Splinter Review |
3.19 KB,
patch
|
peterv
:
review+
justin.lebar+bug
:
review+
|
Details | Diff | Splinter Review |
663 bytes,
patch
|
Details | Diff | Splinter Review |
Since if people don't cast away const they can't use the allocator anyway.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #690047 -
Flags: review?(justin.lebar+bug)
Assignee | ||
Comment 2•12 years ago
|
||
Peter, I can understand if you don't want to take this black magic....
Attachment #690049 -
Flags: review?(peterv)
Assignee | ||
Comment 3•12 years ago
|
||
Attachment #690051 -
Flags: review?(peterv)
Assignee | ||
Updated•12 years ago
|
Attachment #690049 -
Attachment is obsolete: true
Attachment #690049 -
Flags: review?(peterv)
Comment 4•12 years ago
|
||
Comment on attachment 690047 [details] [diff] [review] part 1. Make it possible to use the various-allocator nsTArrays interchangeably as long as you're working with const objects. > + // Allow converting to a const array with a different kind of allocator, > + // Since the allocator doesn't matter for const arrays Would you mind changing the second line so it begins with a lower-case letter and ends with a period? r=me, and thanks for writing a test!
Attachment #690047 -
Flags: review?(justin.lebar+bug) → review+
Comment 5•12 years ago
|
||
Comment on attachment 690051 [details] [diff] [review] Part 2, even compiling > + // mIsNull MUST COME FIRST because otherwise the casting in our array > + // conversion operators would shift where it is found in the struct. > + bool mIsNull; > T mValue; > - bool mIsNull; > > public: > Nullable() > : mIsNull(true) > {} > > - Nullable(T aValue) > + explicit Nullable(T aValue) > : mValue(aValue) > , mIsNull(false) -Werror on tinderbox doesn't like the fact that the initialization list's order doesn't match the order of the members.
Comment 6•12 years ago
|
||
Assignee | ||
Comment 7•12 years ago
|
||
Ah, thank you. Good catch. I'm being tempted to land part 1 and not worry about part 2, fwiw...
Comment 8•12 years ago
|
||
Comment on attachment 690051 [details] [diff] [review] Part 2, even compiling r=me, fwiw. Are you OK if I land these two patches along with bug 819791?
Attachment #690051 -
Flags: review+
Assignee | ||
Comment 9•12 years ago
|
||
Yes, go for it! Three patches, that is, counting your initializer reordering.
Comment 10•12 years ago
|
||
Landed with followup folded in to part 2. https://hg.mozilla.org/integration/mozilla-inbound/rev/6ed3f784cdd3 https://hg.mozilla.org/integration/mozilla-inbound/rev/51e3f82d820b
Comment 11•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/6ed3f784cdd3 https://hg.mozilla.org/mozilla-central/rev/51e3f82d820b
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Updated•12 years ago
|
Attachment #690051 -
Flags: review?(peterv) → review+
You need to log in
before you can comment on or make changes to this bug.
Description
•