[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 07:27:20 PDT 2022


yurai007 marked 2 inline comments as done.
yurai007 added inline comments.


================
Comment at: llvm/include/llvm/ADT/SmallVector.h:1290
 template <typename R>
-SmallVector<ValueTypeFromRangeType<R>,
-            CalculateSmallVectorDefaultInlinedElements<
-                ValueTypeFromRangeType<R>>::value>
+SmallVector<ValueTypeFromRangeType<R>, InlineSize<R>::value>
 to_vector(R &&Range) {
----------------
nikic wrote:
> Why do we need to explicitly pass `InlineSize<R>::value`? Isn't that the default anyway?
Yes, it's indeed redundant! Interesting, I didn't even bother thinking about removing it since it was present on to_vector before my change. And given that's about widely used SmallVector header I didn't expect that it could have anything superfluous.


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