std::chrono::is_clock
cppreference.com
<tbody>
</tbody>
template< class T > struct is_clock; |
( C++20) | |
T Clock, value, true. value false.
-
T::rep,T::period,T::durationT::time_point, ; -
T::is_steadyT::now(), .
, std::is_clock std::is_clock_v .
| T |
<tbody> </tbody>
template< class T > inline constexpr bool is_clock_v = is_clock<T>::value; |
( C++20) | |
std::integral_constant
value [static] |
true, T Clock , false (public static -) |
-
operator bool |
bool, value (public -) |
operator() (C++14) |
value (public -) |
value_type
|
bool
|
type
|
std::integral_constant<bool, value>
|
template<class>
struct is_clock : std::false_type {};
template<class T>
requires
requires {
typename T::rep;
typename T::period;
typename T::duration;
typename T::time_point;
T::is_steady;
T::now();
}
struct is_clock<T> : std::true_type {};
|
#include <chrono>
#include <ratio>
int main()
{
static_assert
(
std::chrono::is_clock_v<std::chrono::utc_clock>
and
not std::chrono::is_clock_v<std::chrono::duration<int, std::exa>>
);
}
}}