6 #ifndef CNOID_UTIL_ID_PAIR_H
7 #define CNOID_UTIL_ID_PAIR_H
36 void set(T id0, T id1){
52 return (
id[0] == pair2.
id[0] &&
id[1] == pair2.
id[1]);
56 if(
id[0] < pair2.
id[0]){
58 }
else if(
id[0] == pair2.
id[0]){
59 return (
id[1] < pair2.
id[1]);
70 template<
class T>
struct hash<
cnoid::IdPair<T>>
72 void hash_combine(std::size_t& seed,
const T& v)
const {
74 seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
79 hash_combine(seed, idPair(0));
80 hash_combine(seed, idPair(1));
85 template<>
struct hash<
cnoid::IdPair<int32_t>>
88 return hash<int64_t>()(
static_cast<int64_t
>(idPair(0)) |
static_cast<int64_t
>(idPair(1)) << 32);