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