#endif // C++17
#if __cplusplus > 201703L
- template<typename _Tp>
- struct is_clock;
-
- template<typename _Tp>
- inline constexpr bool is_clock_v = is_clock<_Tp>::value;
-
#if __cpp_lib_concepts
template<typename _Tp>
- struct is_clock : false_type
- { };
+ inline constexpr bool is_clock_v = false;
template<typename _Tp>
requires requires {
requires same_as<typename _Tp::time_point::duration,
typename _Tp::duration>;
}
- struct is_clock<_Tp> : true_type
- { };
+ inline constexpr bool is_clock_v<_Tp> = true;
#else
template<typename _Tp, typename = void>
- struct __is_clock_impl : false_type
- { };
+ inline constexpr bool is_clock_v = false;
template<typename _Tp>
- struct __is_clock_impl<_Tp,
- void_t<typename _Tp::rep, typename _Tp::period,
- typename _Tp::duration,
- typename _Tp::time_point::duration,
- decltype(_Tp::is_steady),
- decltype(_Tp::now())>>
- : __and_<is_same<typename _Tp::duration,
- duration<typename _Tp::rep, typename _Tp::period>>,
- is_same<typename _Tp::time_point::duration,
- typename _Tp::duration>,
- is_same<decltype(&_Tp::is_steady), const bool*>,
- is_same<decltype(_Tp::now()), typename _Tp::time_point>>::type
- { };
+ inline constexpr bool
+ is_clock_v<_Tp, void_t<typename _Tp::rep, typename _Tp::period,
+ typename _Tp::duration,
+ typename _Tp::time_point::duration,
+ decltype(_Tp::is_steady),
+ decltype(_Tp::now())>>
+ = __and_v<is_same<typename _Tp::duration,
+ duration<typename _Tp::rep, typename _Tp::period>>,
+ is_same<typename _Tp::time_point::duration,
+ typename _Tp::duration>,
+ is_same<decltype(&_Tp::is_steady), const bool*>,
+ is_same<decltype(_Tp::now()), typename _Tp::time_point>>;
+#endif
template<typename _Tp>
- struct is_clock : __is_clock_impl<_Tp>::type
+ struct is_clock
+ : bool_constant<is_clock_v<_Tp>>
{ };
-#endif
#endif // C++20
#if __cplusplus >= 201703L