LLVM 19.0.0git
SmallVectorExtras.h
Go to the documentation of this file.
1//===- llvm/ADT/SmallVectorExtras.h -----------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// This file defines less commonly used SmallVector utilities.
11///
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_ADT_SMALLVECTOREXTRAS_H
15#define LLVM_ADT_SMALLVECTOREXTRAS_H
16
17#include "llvm/ADT/STLExtras.h"
19
20namespace llvm {
21
22/// Map a range to a SmallVector with element types deduced from the mapping.
23template <unsigned Size, class ContainerTy, class FuncTy>
24auto map_to_vector(ContainerTy &&C, FuncTy &&F) {
25 return to_vector<Size>(
26 map_range(std::forward<ContainerTy>(C), std::forward<FuncTy>(F)));
27}
28template <class ContainerTy, class FuncTy>
29auto map_to_vector(ContainerTy &&C, FuncTy &&F) {
30 return to_vector(
31 map_range(std::forward<ContainerTy>(C), std::forward<FuncTy>(F)));
32}
33
34} // namespace llvm
35
36#endif // LLVM_ADT_SMALLVECTOREXTRAS_H
#define F(x, y, z)
Definition: MD5.cpp:55
This file contains some templates that are useful if you are working with the STL at all.
This file defines the SmallVector class.
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
auto map_to_vector(ContainerTy &&C, FuncTy &&F)
Map a range to a SmallVector with element types deduced from the mapping.
auto map_range(ContainerTy &&C, FuncTy F)
Definition: STLExtras.h:377
SmallVector< ValueTypeFromRangeType< R >, Size > to_vector(R &&Range)
Given a range of type R, iterate the entire range and return a SmallVector with elements of the vecto...
Definition: SmallVector.h:1312