CppCommon  1.0.4.1
C++ Common Library
timezone.inl
Go to the documentation of this file.
1 
9 namespace CppCommon {
10 
11 inline void Timezone::swap(Timezone& timezone) noexcept
12 {
13  using std::swap;
14  swap(_name, timezone._name);
15  swap(_offset, timezone._offset);
16  swap(_dstoffset, timezone._dstoffset);
17 }
18 
19 inline void swap(Timezone& timezone1, Timezone& timezone2) noexcept
20 {
21  timezone1.swap(timezone2);
22 }
23 
24 } // namespace CppCommon
25 
27 template <>
28 struct std::hash<CppCommon::Timezone>
29 {
30  typedef CppCommon::Timezone argument_type;
31  typedef size_t result_type;
32 
33  result_type operator() (const argument_type& value) const
34  {
35  result_type result = 17;
36  result = result * 31 + std::hash<std::string>()(value.name());
37  result = result * 31 + std::hash<CppCommon::Timespan>()(value.offset());
38  result = result * 31 + std::hash<CppCommon::Timespan>()(value.daylight());
39  return result;
40  }
41 };
void swap(Timezone &timezone) noexcept
Swap two instances.
Definition: timezone.inl:11
C++ Common project definitions.
Definition: token_bucket.h:15
void swap(FileCache &cache1, FileCache &cache2) noexcept
Definition: filecache.inl:23
void swap(Timezone &timezone1, Timezone &timezone2) noexcept
Definition: timezone.inl:19