c++ vector to set code example
Example 1: convert vector to set c++
#include <set>
std::set<std::string> set_name(vector_name.begin(), vector_name.end());
Example 2: convert set to vector c++
#include <set>
#include <vector>
std::vector<int> some_vector(some_set.begin(), some_set.end());
Example 3: convert vector to set c++
set <int> convertToSet(vector<int> v)
{
set<int> s(v.begin(),v.end());
return s;
}