Skip to content

Commit 5fcfd58

Browse files
Apply suggestions in libcxx/include/__chrono/is_clock.h
Co-authored-by: A. Jiang <[email protected]>
1 parent 74f494a commit 5fcfd58

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

libcxx/include/__chrono/is_clock.h

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,18 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2424

2525
namespace chrono {
2626

27-
template <class>
28-
struct is_clock : std::false_type {};
29-
3027
template <class _Tp>
31-
requires requires {
32-
typename _Tp::rep;
33-
typename _Tp::period;
34-
typename _Tp::duration;
35-
typename _Tp::time_point;
36-
_Tp::is_steady;
37-
_Tp::now();
38-
}
39-
struct is_clock<_Tp> : std::true_type {};
28+
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_clock_v = requires {
29+
typename _Tp::rep;
30+
typename _Tp::period;
31+
typename _Tp::duration;
32+
typename _Tp::time_point;
33+
_Tp::is_steady;
34+
_Tp::now();
35+
};
4036

4137
template <class _Tp>
42-
_LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_clock_v = is_clock<_Tp>::value;
38+
struct _LIBCPP_NO_SPECIALIZATIONS is_clock : bool_constant<is_clock_v<_Tp>> {};
4339

4440
} // namespace chrono
4541

0 commit comments

Comments
 (0)