По сути, мне нужно следующее:
Код: Выделить всё
unordered_set a = {1, 2, 3};
unordered_set b = {2, 4, 1};
unordered_set c = a.intersect(b); // Should be {1, 2}
Код: Выделить всё
unordered_set c;
for (int element : a) {
if (b.count(element) > 0) {
c.insert(element);
}
}
Подробнее здесь: https://stackoverflow.com/questions/481 ... rdered-set
Мобильная версия