[PATCH] D145390: [ADT] Introduce `map_to_vector` helper
Jakub Kuderski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat May 6 14:25:57 PDT 2023
kuhar added inline comments.
================
Comment at: llvm/include/llvm/ADT/SmallVectorExtras.h:23-24
+/// Map a range to a SmallVector with element types deduced from the mapping.
+template <class ContainerTy, class FuncTy>
+auto map_to_vector(ContainerTy &&C, FuncTy &&F) {
+ return to_vector(
----------------
I'd expect this to optionally accept small size, just like `to_vector<N>(...)` does. Is there a specific reason why only the default size is allowed?
Also, do you plan on adding `map_to_vector_of`? IIRC `to_vector_of` was required for some common mlir functions like `DenseElementAttribute::getValues<T>()`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145390/new/
https://reviews.llvm.org/D145390
More information about the llvm-commits
mailing list