I do such comparison of two std::set
std::set
#include #include using namespace std; #include #include
Another way would be this:
template bool set_compare(Set const &lhs, Set const &rhs){ return lhs.size() == rhs.size() && equal(lhs.begin(), lhs.end(), rhs.begin()); }
Inspired from the elegant answer here.