[PATCH] D27723: ADT: Add OwningArrayRef class.

Richard Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 20 16:03:46 PST 2016


rsmith added a comment.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D27723





More information about the llvm-commits mailing list