Following is my code:
//adds element j into the same set as element i
void addelem(int j, int i, set<set<int>> s)
{
for (auto itr1 = s.begin(); itr1 != s.end(); ++itr1) {
for (auto itr2 = (*itr1).begin(); itr2 != (*itr1).end(); ++itr2) {
if (*itr2 == i) {
(*itr1).insert(j);
}
}
}
}
But I'm getting an error in this line:
(*itr1).insert(j);
Error reads:
no instance of overloaded function matches argument list C++