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

Dawid Jurczak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 15 09:45:54 PDT 2022


yurai007 added a comment.

In D129781#3653012 <https://reviews.llvm.org/D129781#3653012>, @dblaikie wrote:

> In D129781#3652460 <https://reviews.llvm.org/D129781#3652460>, @dexonsmith wrote:
>
>> 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?
>
> Yeah, I'd tend to lean that way - if std::vector doesn't have generic range-based construction, I'm happy with SmallVector not having it either.

All right, I will prepare separate change for this.


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