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-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <stack> 10 11 // template <class T, class Container> 12 // bool operator< (const stack<T, Container>& x,const stack<T, Container>& y); 13 // 14 // template <class T, class Container> 15 // bool operator> (const stack<T, Container>& x,const stack<T, Container>& y); 16 // 17 // template <class T, class Container> 18 // bool operator>=(const stack<T, Container>& x,const stack<T, Container>& y); 19 // 20 // template <class T, class Container> 21 // bool operator<=(const stack<T, Container>& x,const stack<T, Container>& y); 22 23 #include <stack> 24 #include <cassert> 25 26 #include "test_macros.h" 27 28 template <class C> 29 C 30 make(int n) 31 { 32 C c; 33 for (int i = 0; i < n; ++i) 34 c.push(i); 35 return c; 36 } 37 38 int main(int, char**) 39 { 40 std::stack<int> q1 = make<std::stack<int> >(5); 41 std::stack<int> q2 = make<std::stack<int> >(10); 42 assert(q1 < q2); 43 assert(q2 > q1); 44 assert(q1 <= q2); 45 assert(q2 >= q1); 46 47 return 0; 48 } 49