How to merge multiple sets into a single std::set (set union) October 9, 2023 by Tarik You can do something like: std::set<int> s1; std::set<int> s2; // fill your sets s1.insert(s2.begin(), s2.end());