#include#include int main() { llvm::SmallVector vec{1, 2, 3, 4}; std::cout << "Before clear: "; for (auto elem : vec) { std::cout << elem << " "; } std::cout << "\n"; vec.clear(); std::cout << "After clear: "; for (auto elem : vec) { std::cout << elem << " "; } std::cout << "\n"; return 0; }
Before clear: 1 2 3 4 After clear:The package/library that provides SmallVector is LLVM, a collection of modular and reusable compiler and toolchain technologies. SmallVector is an implementation in the LLVM ADT (Abstract Data Type) library, which provides a set of useful data structures for C++ programming.