[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/chrono/is_clock [Back]  [Original]

std::chrono::is_clock cppreference.com
cppreference.com

std::chrono::is_clock

cppreference.com
 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
 
(C++11)
(C++20)
(C++11)
(C++11)      
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
(C++20)(C++20)
(C++20)

(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)
(C++20)(C++20)
(C++20)
(C++20)
(C++20)
/ chrono
(C++20)
C
 
<tbody> </tbody>
template< class T > struct is_clock;
( C++20)

T Clock, value, true. value false.

, , Clock, , , T Clock, :

  • T::rep, T::period, T::duration T::time_point , ;
  • T::is_steady T::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>>
    );
}

}}


Web Proxy Viewer  |  New URL  |  Original Page