This is a MutableArrayRef that owns its array.
I plan to use this in D22296.
Details
Details
Diff Detail
Diff Detail
- Build Status
Buildable 2094 Build 2094: arc lint + arc unit
Event Timeline
Comment Actions
LGTM. Things like this ArrayRef constructor really make me wish that C++ had labelled arguments, though.
llvm/trunk/include/llvm/ADT/ArrayRef.h | ||
---|---|---|
419 ↗ | (On Diff #81283) | Please use = default; |
Comment Actions
This doesn't make any sense to me at all. The whole point of ArrayRef is as a non-owning handle to an externally-owned array. Why would someone use this rather than, say, vector or SmallVector? (The only real difference I can see compared to vector is that you save one pointer by not allowing the size and capacity to differ, at the cost of tying together allocation and initialization.)
If this genuinely is useful, please update http://llvm.org/docs/ProgrammersManual.html#picking-the-right-data-structure-for-a-task to explain when this container should be used.