#include#include int main() { llvm::SmallVector vec{1, 2, 3}; std::cout << vec.front() << '\n'; // Output: 1 }
#includeint main() { llvm::SmallVector vec{1, 2, 3}; int& first = vec.front(); first = 4; // vec now contains {4, 2, 3} }
#includeIn all three examples, the SmallVector class is used from the LLVM/clang library.int main() { llvm::SmallVector vec{1, 2, 3}; while (!vec.empty()) { int& elem = vec.front(); // Process elem vec.erase(vec.begin()); // Remove the processed elem } }