Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图了解 llvm 内联如何工作(内联类)。我不明白的操作如下:
SmallVector<std::pair<CallSite, int>, 16> CallSites;
当 SmallVector 是 llvm 类时。特别是我不明白这段代码中“16”的功能是什么..
你声明了SmallVector16 个元素,每个元素都是一个std::pair<CallSite, int>.
SmallVector
std::pair<CallSite, int>
编辑:正如 Eli 正确指出的那样,SmallVector 可以动态调整大小。16 只是内置大小(这意味着存储多达 16 个元素不会在任何堆分配中产生)。