2010-08-22 02:59:46 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2010-11-16 23:09:02 +01:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-08-22 02:59:46 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// <chrono>
|
|
|
|
|
2010-11-20 20:16:30 +01:00
|
|
|
// steady_clock
|
2010-08-22 02:59:46 +02:00
|
|
|
|
|
|
|
// check clock invariants
|
|
|
|
|
|
|
|
#include <chrono>
|
|
|
|
|
2012-12-12 22:14:28 +01:00
|
|
|
template <class _Tp>
|
|
|
|
void test(const _Tp &) {}
|
|
|
|
|
2010-08-22 02:59:46 +02:00
|
|
|
int main()
|
|
|
|
{
|
2010-11-20 20:16:30 +01:00
|
|
|
typedef std::chrono::steady_clock C;
|
2010-08-22 02:59:46 +02:00
|
|
|
static_assert((std::is_same<C::rep, C::duration::rep>::value), "");
|
|
|
|
static_assert((std::is_same<C::period, C::duration::period>::value), "");
|
|
|
|
static_assert((std::is_same<C::duration, C::time_point::duration>::value), "");
|
2010-11-20 20:16:30 +01:00
|
|
|
static_assert(C::is_steady, "");
|
2012-12-12 22:14:28 +01:00
|
|
|
test(std::chrono::steady_clock::is_steady);
|
2010-08-22 02:59:46 +02:00
|
|
|
}
|