Skip to content

Commit f39e93b

Browse files
committed
Fix issues & revert version bump
1 parent ca5a16f commit f39e93b

File tree

18 files changed

+67
-64
lines changed

18 files changed

+67
-64
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,6 @@ Status
424424
---------------------------------------------------------- -----------------
425425
``__cpp_lib_bitset`` ``202306L``
426426
---------------------------------------------------------- -----------------
427-
``__cpp_lib_chrono`` ``202306L``
428-
---------------------------------------------------------- -----------------
429427
``__cpp_lib_constexpr_algorithms`` ``202306L``
430428
---------------------------------------------------------- -----------------
431429
``__cpp_lib_constexpr_forward_list`` ``202502L``

libcxx/include/__chrono/day.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr day& day::operator-=(const days& __dd) no
9696
# if _LIBCPP_STD_VER >= 26
9797

9898
template <>
99-
struct hash<chrono::day> : public __unary_function<chrono::day, size_t> {
100-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::day& __d) const _NOEXCEPT {
99+
struct hash<chrono::day> {
100+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::day& __d) noexcept {
101101
return hash<unsigned>{}(static_cast<unsigned>(__d));
102102
}
103103
};

libcxx/include/__chrono/duration.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ using namespace literals::chrono_literals;
543543

544544
template <class _Rep, class _Period>
545545
requires __has_enabled_hash<_Rep>::value
546-
struct hash<chrono::duration<_Rep, _Period>> : public __unary_function<chrono::duration<_Rep, _Period>, size_t> {
547-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::duration<_Rep, _Period>& __d) const {
546+
struct hash<chrono::duration<_Rep, _Period>> {
547+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::duration<_Rep, _Period>& __d) {
548548
return hash<_Rep>{}(__d.count());
549549
}
550550
};

libcxx/include/__chrono/leap_second.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ class leap_second {
126126
# if _LIBCPP_STD_VER >= 26
127127

128128
template <>
129-
struct hash<chrono::leap_second> : public __unary_function<chrono::leap_second, size_t> {
130-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::leap_second& __lp) const _NOEXCEPT {
131-
return hash<chrono::seconds>{}(__lp.value());
129+
struct hash<chrono::leap_second> {
130+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::leap_second& __lp) noexcept {
131+
return std::__hash_combine(hash<chrono::sys_seconds>{}(__lp.date()), hash<chrono::seconds>{}(__lp.value()));
132132
}
133133
};
134134

libcxx/include/__chrono/month.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ inline constexpr month December{12};
112112
# if _LIBCPP_STD_VER >= 26
113113

114114
template <>
115-
struct hash<chrono::month> : public __unary_function<chrono::month, size_t> {
116-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::month& __m) const _NOEXCEPT {
115+
struct hash<chrono::month> {
116+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month& __m) noexcept {
117117
return hash<unsigned>{}(static_cast<unsigned>(__m));
118118
}
119119
};

libcxx/include/__chrono/month_weekday.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,18 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_weekday_last operator/(const weekda
102102
# if _LIBCPP_STD_VER >= 26
103103

104104
template <>
105-
struct hash<chrono::month_weekday> : public __unary_function<chrono::month_weekday, size_t> {
106-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::month_weekday& __mw) const _NOEXCEPT {
107-
return hash<chrono::month>{}(__mw.month()) ^ hash<chrono::weekday_indexed>{}(__mw.weekday_indexed());
105+
struct hash<chrono::month_weekday> {
106+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_weekday& __mw) noexcept {
107+
return std::__hash_combine(
108+
hash<chrono::month>{}(__mw.month()), hash<chrono::weekday_indexed>{}(__mw.weekday_indexed()));
108109
}
109110
};
110111

111112
template <>
112-
struct hash<chrono::month_weekday_last> : public __unary_function<chrono::month_weekday_last, size_t> {
113-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::month_weekday_last& __mwl) const _NOEXCEPT {
114-
return hash<chrono::month>{}(__mwl.month()) ^ hash<chrono::weekday_last>{}(__mwl.weekday_last());
113+
struct hash<chrono::month_weekday_last> {
114+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_weekday_last& __mwl) noexcept {
115+
return std::__hash_combine(
116+
hash<chrono::month>{}(__mwl.month()), hash<chrono::weekday_last>{}(__mwl.weekday_last()));
115117
}
116118
};
117119

libcxx/include/__chrono/monthday.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr month_day_last operator/(last_spec, int _
130130
# if _LIBCPP_STD_VER >= 26
131131

132132
template <>
133-
struct hash<chrono::month_day> : public __unary_function<chrono::month_day, size_t> {
134-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::month_day& __md) const _NOEXCEPT {
135-
return hash<chrono::month>{}(__md.month()) ^ hash<chrono::day>{}(__md.day());
133+
struct hash<chrono::month_day> {
134+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_day& __md) noexcept {
135+
return std::__hash_combine(hash<chrono::month>{}(__md.month()), hash<chrono::day>{}(__md.day()));
136136
}
137137
};
138138

139139
template <>
140-
struct hash<chrono::month_day_last> : public __unary_function<chrono::month_day_last, size_t> {
141-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::month_day_last& __mdl) const _NOEXCEPT {
140+
struct hash<chrono::month_day_last> {
141+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::month_day_last& __mdl) noexcept {
142142
return hash<chrono::month>{}(__mdl.month());
143143
}
144144
};

libcxx/include/__chrono/time_point.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,8 @@ operator-(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock,
229229

230230
template <class _Clock, class _Duration>
231231
requires __has_enabled_hash<_Duration>::value
232-
struct hash<chrono::time_point<_Clock, _Duration>>
233-
: public __unary_function<chrono::time_point<_Clock, _Duration>, size_t> {
234-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::time_point<_Clock, _Duration>& __tp) const {
232+
struct hash<chrono::time_point<_Clock, _Duration>> {
233+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::time_point<_Clock, _Duration>& __tp) {
235234
return hash<_Duration>{}(__tp.time_since_epoch());
236235
}
237236
};

libcxx/include/__chrono/weekday.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,22 +164,22 @@ inline constexpr weekday Saturday{6};
164164
# if _LIBCPP_STD_VER >= 26
165165

166166
template <>
167-
struct hash<chrono::weekday> : public __unary_function<chrono::weekday, size_t> {
168-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::weekday& __w) const _NOEXCEPT {
167+
struct hash<chrono::weekday> {
168+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday& __w) noexcept {
169169
return hash<unsigned>{}(__w.c_encoding());
170170
}
171171
};
172172

173173
template <>
174-
struct hash<chrono::weekday_indexed> : public __unary_function<chrono::weekday_indexed, size_t> {
175-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::weekday_indexed& __wi) const _NOEXCEPT {
176-
return hash<chrono::weekday>{}(__wi.weekday()) ^ hash<unsigned>{}(__wi.index());
174+
struct hash<chrono::weekday_indexed> {
175+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday_indexed& __wi) noexcept {
176+
return std::__hash_combine(hash<chrono::weekday>{}(__wi.weekday()), hash<unsigned>{}(__wi.index()));
177177
}
178178
};
179179

180180
template <>
181-
struct hash<chrono::weekday_last> : public __unary_function<chrono::weekday_last, size_t> {
182-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::weekday_last& __wl) const _NOEXCEPT {
181+
struct hash<chrono::weekday_last> {
182+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::weekday_last& __wl) noexcept {
183183
return hash<chrono::weekday>{}(__wl.weekday());
184184
}
185185
};

libcxx/include/__chrono/year.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ _LIBCPP_HIDE_FROM_ABI constexpr bool year::ok() const noexcept {
113113
# if _LIBCPP_STD_VER >= 26
114114

115115
template <>
116-
struct hash<chrono::year> : public __unary_function<chrono::year, size_t> {
117-
_LIBCPP_HIDE_FROM_ABI size_t operator()(const chrono::year& __y) const _NOEXCEPT {
116+
struct hash<chrono::year> {
117+
_LIBCPP_HIDE_FROM_ABI static size_t operator()(const chrono::year& __y) noexcept {
118118
return hash<int>{}(static_cast<int>(__y));
119119
}
120120
};

0 commit comments

Comments
 (0)