![](/img/trans.png)
[英]lower_bound on a vector of pair<int,int> works, upper_bound does not
[英]Searching a map<pair<int, int>, ...> with lower and upper bound
我想知道查找以一对整数(坐标)为键的带有lower_bound 和upper_bound 的地图是否有任何可用意义?
using Point = std::pair<int, int>;
std::map<Point, Vertex> vertex_map = {};
const auto p = std::make_pair(0, 0);
const auto q = std::make_pair(10, 10);
auto foo = vertex_map.lower_bound(p);
auto bar = vertex_map.upper_bound(q);
特别是,我想检查地图是否包含由给定矩形(p,q)绑定的任何顶点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.