brintos

brintos / llvm-project-archived public Read only

0
0
Text · 943 B · e4197aa Raw
39 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// <chrono>10 11// time_point12 13// time_point();14 15#include <chrono>16#include <cassert>17#include <ratio>18 19#include "test_macros.h"20#include "../../rep.h"21 22int main(int, char**)23{24    typedef std::chrono::system_clock Clock;25    typedef std::chrono::duration<Rep, std::milli> Duration;26    {27    std::chrono::time_point<Clock, Duration> t;28    assert(t.time_since_epoch() == Duration::zero());29    }30#if TEST_STD_VER > 1131    {32    constexpr std::chrono::time_point<Clock, Duration> t;33    static_assert(t.time_since_epoch() == Duration::zero(), "");34    }35#endif36 37  return 0;38}39