File tree Expand file tree Collapse file tree 3 files changed +6
-24
lines changed
libcxx/time/time.traits.is.clock
std/time/time.traits.is.clock Expand file tree Collapse file tree 3 files changed +6
-24
lines changed Original file line number Diff line number Diff line change 1111#define _LIBCPP___CHRONO_IS_CLOCK_H
1212
1313#include < __config>
14+
15+ #include < __chrono/duration.h>
16+ #include < __chrono/time_point.h>
17+ #include < __concepts/same_as.h>
1418#include < __type_traits/integral_constant.h>
1519#include < __type_traits/is_arithmetic.h>
1620#include < __type_traits/is_same.h>
@@ -26,12 +30,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2630
2731namespace chrono {
2832
29- template <class _Rep , class _Period >
30- class duration ;
31-
32- template <class _Clock , class _Duration >
33- class time_point ;
34-
3533// Helper to check that _Tp::time_point has the form time_point<_, typename _Tp::duration>.
3634template <class _TimePoint , class _ClockType >
3735inline constexpr bool __is_valid_clock_time_point_v = false ;
Original file line number Diff line number Diff line change 1111#include < chrono>
1212#include < ratio>
1313
14- #if !__has_warning("-Winvalid-specializations")
15- // expected-no-diagnostics
16- #else
17-
18- namespace std ::chrono {
19- // try adding specializations to is_clock
2014template <>
21- struct is_clock <int > : std::false_type {}; // expected-error@*:* {{'is_clock' cannot be specialized}}
15+ struct std ::chrono:: is_clock<int > : std::false_type {}; // expected-error@*:* {{'is_clock' cannot be specialized}}
2216
2317template <>
24- constexpr bool is_clock_v<float > = false ; // expected-error@*:* {{'is_clock_v' cannot be specialized}}
25-
26- } // namespace std::chrono
27-
28- #endif
18+ constexpr bool std::chrono::is_clock_v<float > = false ; // expected-error@*:* {{'is_clock_v' cannot be specialized}}
Original file line number Diff line number Diff line change @@ -176,19 +176,13 @@ static_assert(std::chrono::is_clock_v<std::chrono::system_clock>);
176176
177177// Test standard clock types
178178static_assert (std::chrono::is_clock_v<std::chrono::system_clock>);
179- #if _LIBCPP_HAS_MONOTONIC_CLOCK
180- static_assert (std::chrono::is_clock_v<std::chrono::steady_clock>);
181- #endif
182179static_assert (std::chrono::is_clock_v<std::chrono::high_resolution_clock>);
183180
184181// Test non-clock types
185182static_assert (!std::chrono::is_clock_v<EmptyStruct>);
186183static_assert (!std::chrono::is_clock_v<int >);
187184static_assert (!std::chrono::is_clock_v<void >);
188185static_assert (!std::chrono::is_clock_v<std::chrono::system_clock::time_point>);
189- #if _LIBCPP_HAS_MONOTONIC_CLOCK
190- static_assert (!std::chrono::is_clock_v<std::chrono::steady_clock::time_point>);
191- #endif
192186static_assert (!std::chrono::is_clock_v<std::chrono::seconds>);
193187static_assert (!std::chrono::is_clock_v<std::chrono::milliseconds>);
194188
You can’t perform that action at this time.
0 commit comments