CppCommon 1.0.6.0
C++ Common Library
Loading...
Searching...
No Matches
timestamp.inl
Go to the documentation of this file.
1
8
9namespace CppCommon {
10
11inline void Timestamp::swap(Timestamp& timestamp) noexcept
12{
13 using std::swap;
14 swap(_timestamp, timestamp._timestamp);
15}
16
17inline void swap(Timestamp& timestamp1, Timestamp& timestamp2) noexcept
18{
19 timestamp1.swap(timestamp2);
20}
21
22} // namespace CppCommon
23
25template <>
26struct std::hash<CppCommon::Timestamp>
27{
28 typedef CppCommon::Timestamp argument_type;
29 typedef size_t result_type;
30
31 result_type operator() (const argument_type& value) const
32 {
33 result_type result = 17;
34 result = result * 31 + std::hash<int64_t>()(value.total());
35 return result;
36 }
37};
void swap(Timestamp &timestamp) noexcept
Swap two instances.
Definition timestamp.inl:11
uint64_t _timestamp
Timestamp value.
Definition timestamp.h:231
Timestamp() noexcept
Initialize timestamp with an epoch time.
Definition timestamp.h:33
C++ Common project definitions.
void swap(FileCache &cache1, FileCache &cache2) noexcept
Definition filecache.inl:23