milliseconds.pass.cpp revision b64f8b07c104c6cc986570ac8ee0ed16a9f23976
15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)//===----------------------------------------------------------------------===// 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// The LLVM Compiler Infrastructure 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// 55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// This file is dual licensed under the MIT and the University of Illinois Open 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Source Licenses. See LICENSE.TXT for details. 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)//===----------------------------------------------------------------------===// 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// <chrono> 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// typedef duration<signed integral type of at least 45 bits, milli> milliseconds; 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include <chrono> 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include <type_traits> 165f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles)#include <limits> 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)int main() 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles){ 205f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) typedef std::chrono::milliseconds D; 215f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) typedef D::rep Rep; 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) typedef D::period Period; 235f1c94371a64b3196d4be9466099bb892df9b88eTorne (Richard Coles) static_assert(std::is_signed<Rep>::value, ""); 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static_assert(std::is_integral<Rep>::value, ""); 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static_assert(std::numeric_limits<Rep>::digits >= 44, ""); 265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) static_assert((std::is_same<Period, std::milli>::value), ""); 275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} 285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)