Код: Выделить всё
#include
#include
struct Num {
auto operator (const Num& other) const{
std::println ("{} {}", val, other.val);
return val other.val;
};
int val;
};
int main() {
std::set s{{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}};
std::println("------------");
return !s.contains({8});
}
< /code>
Это распечатано (среди прочего): < /p>
...
8 8
7
8 8
Подробнее здесь: https://stackoverflow.com/questions/797 ... et-element