您的位置:首页 > 大数据 > 人工智能

std::set 和 std::pair 搭配使用

2011-08-01 19:18 246 查看
struct CompareKey : public std::unary_function<std::pair<int, int>, bool>

{

bool operator ()(const std::pair<int, int>& p1,

const std::pair<int, int>& p2) const

{

return p1.first < p2.first;

}

};

std::set<std::pair<int, long>, CompareKey > somevar;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: