std::chrono::is_clock

Header: <chrono>

If T satisfies the Clock requirements, provides the member constant value equal true. For any other type, value is false.

# Declarations

template< class T >
struct is_clock;

(since C++20)

# Notes

If T otherwise meets the Clock requirements, but T::is_steady is not of type const bool, or T::now() is not of type T::time_point, the result of is_clock_v is unspecified.

# Example

#include <chrono>
#include <ratio>
 
static_assert
(
    std::chrono::is_clock_v<std::chrono::utc_clock> and
    not std::chrono::is_clock_v<std::chrono::duration<int, std::exa>>
);
 
int main() {}