Commit 09790ba 1 parent ef00de2 commit 09790ba Copy full SHA for 09790ba
File tree 1 file changed +19
-0
lines changed
1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 25
25
#include < memory>
26
26
#include < ostream>
27
27
#include < tuple>
28
+ #include < utility>
28
29
#include < vector>
29
30
31
+ #include " absl/hash/hash.h"
30
32
#include " absl/memory/memory.h"
31
33
#include " cartographer/common/port.h"
32
34
#include " cartographer/common/time.h"
@@ -420,4 +422,21 @@ class MapById {
420
422
} // namespace mapping
421
423
} // namespace cartographer
422
424
425
+ template <>
426
+ struct std ::hash<cartographer::mapping::NodeId> {
427
+ std::size_t operator ()(
428
+ const cartographer::mapping::NodeId& id) const noexcept {
429
+ return absl::Hash<std::pair<int , int >>{}({id.trajectory_id , id.node_index });
430
+ }
431
+ };
432
+
433
+ template <>
434
+ struct std ::hash<cartographer::mapping::SubmapId> {
435
+ std::size_t operator ()(
436
+ const cartographer::mapping::SubmapId& id) const noexcept {
437
+ return absl::Hash<std::pair<int , int >>{}(
438
+ {id.trajectory_id , id.submap_index });
439
+ }
440
+ };
441
+
423
442
#endif // CARTOGRAPHER_MAPPING_ID_H_
You can’t perform that action at this time.
0 commit comments