Change the use of integrals to chrono types as appropriate

This commit is contained in:
Howard Hinnant
2015-11-16 17:45:31 -05:00
committed by Nik Bougalis
parent 8db0094c73
commit 5423fa25d4

View File

@@ -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>