adding elements of a vector to an unordered set June 6, 2023 by Tarik If you’re constructing the unordered_set then: std::vector<int> v; std::unordered_set<int> s(v.begin(), v.end());