Given that I have a std::set
, how do I find out if one element of the set is before the other. For example, something like this -
bool before(const std::set &s, const int first, const int second) const {
auto it_first = s.find(first);
auto it_second = s.find(second);
return it_first <= it_second;
}
The above code does not work since <=
is not defined for the bidirectional iterators, but how would one go about doing something like this?