mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Change the use of integrals to chrono types as appropriate
This commit is contained in:
committed by
Nik Bougalis
parent
8db0094c73
commit
5423fa25d4
@@ -25,6 +25,7 @@
|
||||
#include <beast/hash/endian.h>
|
||||
#include <beast/utility/meta.h>
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <functional>
|
||||
@@ -472,6 +473,24 @@ hash_append (Hasher& h, std::shared_ptr<T> const& p) noexcept
|
||||
hash_append(h, p.get());
|
||||
}
|
||||
|
||||
// chrono
|
||||
|
||||
template <class Hasher, class Rep, class Period>
|
||||
inline
|
||||
void
|
||||
hash_append (Hasher& h, std::chrono::duration<Rep, Period> const& d) noexcept
|
||||
{
|
||||
hash_append(h, d.count());
|
||||
}
|
||||
|
||||
template <class Hasher, class Clock, class Duration>
|
||||
inline
|
||||
void
|
||||
hash_append (Hasher& h, std::chrono::time_point<Clock, Duration> const& tp) noexcept
|
||||
{
|
||||
hash_append(h, tp.time_since_epoch());
|
||||
}
|
||||
|
||||
// variadic
|
||||
|
||||
template <class Hasher, class T0, class T1, class ...T>
|
||||
|
||||
Reference in New Issue
Block a user