1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // template <class Clock, class Duration1, class Duration2>
16 // operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
18 // template <class Clock, class Duration1, class Duration2>
20 // operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs);
25 #include "test_macros.h"
29 typedef std::chrono::system_clock Clock;
30 typedef std::chrono::milliseconds Duration1;
31 typedef std::chrono::microseconds Duration2;
32 typedef std::chrono::time_point<Clock, Duration1> T1;
33 typedef std::chrono::time_point<Clock, Duration2> T2;
49 T2 t2(Duration2(3000));
55 T2 t2(Duration2(3001));
62 constexpr T1 t1(Duration1(3));
63 constexpr T1 t2(Duration1(3));
64 static_assert( (t1 == t2), "");
65 static_assert(!(t1 != t2), "");
68 constexpr T1 t1(Duration1(3));
69 constexpr T1 t2(Duration1(4));
70 static_assert(!(t1 == t2), "");
71 static_assert( (t1 != t2), "");
74 constexpr T1 t1(Duration1(3));
75 constexpr T2 t2(Duration2(3000));
76 static_assert( (t1 == t2), "");
77 static_assert(!(t1 != t2), "");
80 constexpr T1 t1(Duration1(3));
81 constexpr T2 t2(Duration2(3001));
82 static_assert(!(t1 == t2), "");
83 static_assert( (t1 != t2), "");