Skip to content

Commit 3af9f2d

Browse files
simplify time_point checks
1 parent 12a38fb commit 3af9f2d

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

libcxx/include/__chrono/is_clock.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,6 @@ class duration;
3131
template <class _Clock, class _Duration>
3232
class time_point;
3333

34-
template <class _TimePoint, class _Clock>
35-
constexpr bool __is_valid_clock_time_point_v = false;
36-
37-
template <class _Clock, class _Duration, class _ClockType>
38-
constexpr bool __is_valid_clock_time_point_v<time_point<_Clock, _Duration>, _ClockType> =
39-
_IsSame<time_point<_Clock, _Duration>, time_point<_ClockType>>::value ||
40-
_IsSame<_Duration, typename _ClockType::duration>::value;
41-
4234
// Check if a clock satisfies the Cpp17Clock requirements as defined in [time.clock.req]
4335
template <class _Tp>
4436
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_clock_v = requires {
@@ -52,7 +44,7 @@ _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_clock_v = requires {
5244
requires _IsSame<typename _Tp::duration, duration<typename _Tp::rep, typename _Tp::period>>::value;
5345

5446
typename _Tp::time_point;
55-
requires __is_valid_clock_time_point_v<typename _Tp::time_point, _Tp>;
47+
requires _IsSame<typename _Tp::time_point::duration, typename _Tp::duration>::value;
5648

5749
_Tp::is_steady;
5850
requires _IsSame<decltype(_Tp::is_steady), const bool>::value;

0 commit comments

Comments
 (0)