Before C++17 vector.insert(vector.end(), set.begin(), set.end()); After C++17 vector.reserve(set.size()); for (auto it = set.begin(); it != set.end(); ) { vector.push_back(std::move(set.extract(it++).value())); }