xxxxxxxxxx
// C++ program to implement
// the above approach
#include <bits/stdc++.h>
using namespace std;
// Driver code
int main()
{
// Initialize an array of
// integers
int old_arr[] = {4, 3, 6, 1, 8};
int n = (sizeof(old_arr) /
sizeof(old_arr[0]));
// Adding these elements stored
// in the array
set<int>New_set(old_arr,
old_arr + n);
// Traverse through the unordered_map
for(auto x: New_set)
{
cout << x << endl;
}
return 0;
}