CppCommon  1.0.4.1
C++ Common Library
timestamp.inl
Go to the documentation of this file.
1 
9 namespace CppCommon {
10 
11 inline void Timestamp::swap(Timestamp& timestamp) noexcept
12 {
13  using std::swap;
14  swap(_timestamp, timestamp._timestamp);
15 }
16 
17 inline void swap(Timestamp& timestamp1, Timestamp& timestamp2) noexcept
18 {
19  timestamp1.swap(timestamp2);
20 }
21 
22 } // namespace CppCommon
23 
25 template <>
26 struct 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
C++ Common project definitions.
Definition: token_bucket.h:15
void swap(FileCache &cache1, FileCache &cache2) noexcept
Definition: filecache.inl:23
void swap(Timestamp &timestamp1, Timestamp &timestamp2) noexcept
Definition: timestamp.inl:17