How do I create a set of pairs, the elements of which (the pairs) are sorted with a custom bool function? I write
set <pair<int,int>,compare> myset;
and get error : Type/value mismatch at argument 2, expected a type, got "compare"
I have defined "compare" as
bool compare(pair <int,int> g1, pair <int,int> g2)
{
return (g1.second-g1.first > g2.second-g2.first);
}
and of course
#include <vector>
#include <set>