// -*- C++ -*- //===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef _LIBCPP___CHRONO_IS_CLOCK_H #define _LIBCPP___CHRONO_IS_CLOCK_H #include <__config> #include <__chrono/duration.h> #include <__chrono/time_point.h> #include <__concepts/same_as.h> #include <__type_traits/integral_constant.h> #include <__type_traits/is_arithmetic.h> #include <__type_traits/is_class.h> #include <__type_traits/is_union.h> #include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) # pragma GCC system_header #endif #if _LIBCPP_STD_VER >= 20 _LIBCPP_BEGIN_NAMESPACE_STD namespace chrono { // Helper to check that _Tp::time_point has the form time_point<_, typename _Tp::duration>. template inline constexpr bool __is_valid_clock_time_point_v = false; template inline constexpr bool __is_valid_clock_time_point_v, _ClockType> = true; // Check if a clock satisfies the Cpp17Clock requirements as defined in [time.clock.req] template _LIBCPP_NO_SPECIALIZATIONS inline constexpr bool is_clock_v = requires { typename _Tp::rep; requires is_arithmetic_v || is_class_v || is_union_v; typename _Tp::period; requires __is_ratio_v; typename _Tp::duration; requires same_as>; typename _Tp::time_point; requires __is_valid_clock_time_point_v; _Tp::is_steady; requires same_as; _Tp::now(); requires same_as; }; template struct _LIBCPP_NO_SPECIALIZATIONS is_clock : bool_constant> {}; } // namespace chrono _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_STD_VER #endif // _LIBCPP___CHRONO_IS_CLOCK_H