#include#include int main() { llvm::DenseMap my_map; my_map.insert(std::make_pair(1, "val1")); my_map.insert(std::make_pair(2, "val2")); my_map.insert(std::make_pair(3, "val3")); std::cout << my_map[1] << std::endl; // prints "val1" std::cout << my_map[2] << std::endl; // prints "val2" std::cout << my_map[3] << std::endl; // prints "val3" return 0; }
#includeDenseMap is part of the LLVM project, which is a collection of modular and reusable compiler and toolchain technologies.#include int main() { llvm::DenseMap my_map; my_map.insert(std::make_pair(1, "val1")); my_map.insert(std::make_pair(2, "val2")); my_map[1] = "new_val1"; std::cout << my_map[1] << std::endl; // prints "new_val1" std::cout << my_map[2] << std::endl; // prints "val2" return 0; }