CppCommon 1.0.5.0
C++ Common Library
Loading...
Searching...
No Matches
timezone.inl
Go to the documentation of this file.
1
9namespace CppCommon {
10
11inline 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
19inline void swap(Timezone& timezone1, Timezone& timezone2) noexcept
20{
21 timezone1.swap(timezone2);
22}
23
24} // namespace CppCommon
25
27template <>
28struct 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};
friend void swap(Timezone &timezone1, Timezone &timezone2) noexcept
Definition timezone.inl:19
C++ Common project definitions.
void swap(FileCache &cache1, FileCache &cache2) noexcept
Definition filecache.inl:23