I want to print out the vector element in a set container. I did the code as follows:
int main() {
vector<int> aa = {3, 2, 1, 1};
vector<int> bb = {5, 1, 7, 9};
set<vector<int>> myset; // setVector
myset.insert(aa);
myset.insert(bb);
for (auto elem : myset) {
cout << elem << ", ";
}
return 0;
}
However, this code can not print out the vector: (3, 2, 1, 1)
and (5, 1, 7, 9)
.