#include <set>
#include <iostream>

using pair_type = std::pair<int, int>;

auto comp = [](const pair_type& a, const pair_type& b) {
    return (a.first < b.first) || ((a.first == b.first) && (a.second < b.second));
};

class A{
public:
    A() : edge_(comp) {}
    void test();
private:
    std::set<pair_type, decltype(comp)> edge_;
};

void A::test()
{
    edge_.insert(std::make_pair(3, 2));
    edge_.insert(std::make_pair(1, 2));
    edge_.insert(std::make_pair(2, 1));
    edge_.insert(std::make_pair(1, 1));

    for (auto const &e : edge_)
        std::cout << e.first << " - " << e.second << std::endl;
}

int main()
{
    A a;
    a.test();
    return 0;
}
