Skip to content

Commit

Permalink
timepoint hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Oct 29, 2024
1 parent 9ce6fef commit 0850433
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/cista/hashing.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,14 @@ struct hashing<std::chrono::duration<Rep, Period>> {
}
};

template <typename Clock, typename Duration>
struct hashing<std::chrono::time_point<Clock, Duration>> {
hash_t operator()(std::chrono::time_point<Clock, Duration> const& el,
hash_t const seed = BASE_HASH) {
return hashing<Duration>{}(el.time_since_epoch(), seed);
}
};

template <typename T1, typename T2>
struct hashing<std::pair<T1, T2>> {
constexpr hash_t operator()(std::pair<T1, T2> const& el,
Expand Down

0 comments on commit 0850433

Please sign in to comment.