这里以submapId为例
struct SubmapId {
SubmapId(int trajectory_id, int submap_index)
: trajectory_id(trajectory_id), submap_index(submap_index) {}
int trajectory_id;
int submap_index;
bool operator==(const SubmapId& other) const {
return std::forward_as_tuple(trajectory_id, submap_index) ==
std::forward_as_tuple(other.trajectory_id, other.submap_index);
}
bool operator!=(const SubmapId& other) const { return !operator==(other); }
bool operator<(const SubmapId& other) const {
return std::forward_as_tuple(trajectory_id, submap_index) <
std::forward_as_tuple(other.trajectory_id, other.submap_index);
}
};