File indexing completed on 2026-05-10 08:43:08
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_ADT_SMALLVECTOREXTRAS_H
0015 #define LLVM_ADT_SMALLVECTOREXTRAS_H
0016
0017 #include "llvm/ADT/STLExtras.h"
0018 #include "llvm/ADT/SmallVector.h"
0019
0020 namespace llvm {
0021
0022
0023 template <unsigned Size, class ContainerTy, class PredicateFn>
0024 auto filter_to_vector(ContainerTy &&C, PredicateFn &&Pred) {
0025 return to_vector<Size>(make_filter_range(std::forward<ContainerTy>(C),
0026 std::forward<PredicateFn>(Pred)));
0027 }
0028
0029
0030 template <class ContainerTy, class PredicateFn>
0031 auto filter_to_vector(ContainerTy &&C, PredicateFn &&Pred) {
0032 return to_vector(make_filter_range(std::forward<ContainerTy>(C),
0033 std::forward<PredicateFn>(Pred)));
0034 }
0035
0036
0037 template <unsigned Size, class ContainerTy, class FuncTy>
0038 auto map_to_vector(ContainerTy &&C, FuncTy &&F) {
0039 return to_vector<Size>(
0040 map_range(std::forward<ContainerTy>(C), std::forward<FuncTy>(F)));
0041 }
0042
0043
0044 template <class ContainerTy, class FuncTy>
0045 auto map_to_vector(ContainerTy &&C, FuncTy &&F) {
0046 return to_vector(
0047 map_range(std::forward<ContainerTy>(C), std::forward<FuncTy>(F)));
0048 }
0049
0050 }
0051
0052 #endif