[PATCH] D129781: [WIP][NFC] Introduce llvm::to_vector_of to allow creation of SmallVector<T> from range of items convertible to type T

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 09:54:11 PDT 2022


dexonsmith added a subscriber: dblaikie.
dexonsmith added a comment.

In D129781#3652424 <https://reviews.llvm.org/D129781#3652424>, @nikic wrote:

> By the way, I think it would be worthwhile to add an `ArrayRef` constructor to SmallVector, or else drop the existing `iterator_range` ctor. I've wanted to switch an iterator_range to ArrayRef a few times in the past, and always gave up due to the SmallVector fallout. We should support both or neither.

“Neither” makes some sense to me, since to_vector and to_vector_of are clear and support any range naturally. @dblaikie, any thoughts?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129781/new/

https://reviews.llvm.org/D129781



More information about the llvm-commits mailing list