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 //===----------------------------------------------------------------------===//
12 // template <class T1, class T2> struct pair
14 // template <class T1, class T2> bool operator==(const pair<T1,T2>&, const pair<T1,T2>&);
15 // template <class T1, class T2> bool operator!=(const pair<T1,T2>&, const pair<T1,T2>&);
16 // template <class T1, class T2> bool operator< (const pair<T1,T2>&, const pair<T1,T2>&);
17 // template <class T1, class T2> bool operator> (const pair<T1,T2>&, const pair<T1,T2>&);
18 // template <class T1, class T2> bool operator>=(const pair<T1,T2>&, const pair<T1,T2>&);
19 // template <class T1, class T2> bool operator<=(const pair<T1,T2>&, const pair<T1,T2>&);
24 #include "test_macros.h"
29 typedef std::pair<int, short> P;
30 P p1(3, static_cast<short>(4));
31 P p2(3, static_cast<short>(4));
40 typedef std::pair<int, short> P;
41 P p1(2, static_cast<short>(4));
42 P p2(3, static_cast<short>(4));
51 typedef std::pair<int, short> P;
52 P p1(3, static_cast<short>(2));
53 P p2(3, static_cast<short>(4));
62 typedef std::pair<int, short> P;
63 P p1(3, static_cast<short>(4));
64 P p2(2, static_cast<short>(4));
73 typedef std::pair<int, short> P;
74 P p1(3, static_cast<short>(4));
75 P p2(3, static_cast<short>(2));
86 typedef std::pair<int, short> P;
87 constexpr P p1(3, static_cast<short>(4));
88 constexpr P p2(3, static_cast<short>(2));
89 static_assert(!(p1 == p2), "");
90 static_assert( (p1 != p2), "");
91 static_assert(!(p1 < p2), "");
92 static_assert(!(p1 <= p2), "");
93 static_assert( (p1 > p2), "");
94 static_assert( (p1 >= p2), "");